Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
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
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
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)
void InjectMessageList(int count, const Win32Message *messages)
LRESULT Win32DefWindowProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
void SetDirectManipulationOwner(std::unique_ptr< DirectManipulationOwner > owner)
void CallOnImeComposition(UINT const message, WPARAM const wparam, LPARAM const lparam)
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
unsigned int UINT
LONG_PTR LPARAM
UINT_PTR WPARAM