Flutter Engine
The Flutter Engine
mock_window.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/windows/testing/mock_window.h"
6
7namespace flutter {
8namespace testing {
10MockWindow::MockWindow(std::unique_ptr<WindowsProcTable> window_proc_table,
11 std::unique_ptr<TextInputManager> text_input_manager)
12 : FlutterWindow(1,
13 1,
14 std::move(window_proc_table),
15 std::move(text_input_manager)){};
16
17MockWindow::~MockWindow() = default;
18
20 return GetCurrentDPI();
21}
22
24 UINT Msg,
25 WPARAM wParam,
26 LPARAM lParam) {
27 return kWmResultDefault;
28}
29
31 std::unique_ptr<DirectManipulationOwner> owner) {
32 direct_manipulation_owner_ = std::move(owner);
33}
34
36 WPARAM const wparam,
37 LPARAM const lparam) {
38 return HandleMessage(message, wparam, lparam);
39}
40
42 for (int message_id = 0; message_id < count; message_id += 1) {
43 const Win32Message& message = messages[message_id];
45 InjectWindowMessage(message.message, message.wParam, message.lParam);
46 if (message.expected_result != kWmResultDontCheck) {
47 EXPECT_EQ(result, message.expected_result);
48 }
49 }
50}
51
53 WPARAM const wparam,
54 LPARAM const lparam) {
56}
57
58} // namespace testing
59} // namespace flutter
int count
Definition: FontMgrTest.cpp:50
std::unique_ptr< DirectManipulationOwner > direct_manipulation_owner_
LRESULT HandleMessage(UINT const message, WPARAM const wparam, LPARAM const lparam) noexcept
virtual void OnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
LRESULT InjectWindowMessage(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: mock_window.cc:35
void InjectMessageList(int count, const Win32Message *messages)
Definition: mock_window.cc:41
LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: mock_window.cc:23
void SetDirectManipulationOwner(std::unique_ptr< DirectManipulationOwner > owner)
Definition: mock_window.cc:30
void CallOnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
Definition: mock_window.cc:52
GAsyncResult * result
Win32Message message
constexpr LRESULT kWmResultDefault
Definition: wm_builders.h:15
constexpr LRESULT kWmResultDontCheck
Definition: wm_builders.h:16
Definition: ref_ptr.h:256
LONG_PTR LRESULT
Definition: windows_types.h:61
unsigned int UINT
Definition: windows_types.h:32
LONG_PTR LPARAM
Definition: windows_types.h:60
UINT_PTR WPARAM
Definition: windows_types.h:59