Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
jni_mock_unittest.cc
Go to the documentation of this file.
1// Copyright 2013 The Flutter Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5#include "flutter/shell/platform/android/jni/jni_mock.h"
6
7#include "gmock/gmock.h"
8#include "gtest/gtest.h"
9
10namespace flutter {
11namespace testing {
12
13TEST(JNIMock, FlutterViewHandlePlatformMessage) {
14 JNIMock mock;
15
16 auto message = std::make_unique<PlatformMessage>("<channel-name>", nullptr);
17 auto response_id = 1;
18
19 EXPECT_CALL(mock,
20 FlutterViewHandlePlatformMessage(
21 ::testing::Property(&std::unique_ptr<PlatformMessage>::get,
22 message.get()),
23 response_id));
24
25 mock.FlutterViewHandlePlatformMessage(std::move(message), response_id);
26}
27
28} // namespace testing
29} // namespace flutter
#define TEST(S, s, D, expected)
virtual void FlutterViewHandlePlatformMessage(std::unique_ptr< flutter::PlatformMessage > message, int responseId)=0
Sends a platform message. The message may be empty.
Win32Message message