Flutter Engine
win32_window_unittests.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_win32_window.h"
6 #include "gtest/gtest.h"
7 
8 namespace flutter {
9 namespace testing {
10 
11 TEST(MockWin32Window, CreateDestroy) {
12  MockWin32Window window;
13  ASSERT_TRUE(TRUE);
14 }
15 
16 TEST(MockWin32Window, GetDpiAfterCreate) {
17  MockWin32Window window;
18  ASSERT_TRUE(window.GetDpi() > 0);
19 }
20 
21 TEST(MockWin32Window, VerticalScroll) {
22  MockWin32Window window;
23  const int scroll_amount = 10;
24  // Vertical scroll should be passed along, adjusted for scroll tick size
25  // and direction.
26  EXPECT_CALL(window, OnScroll(0, -scroll_amount / 120.0)).Times(1);
27 
28  window.InjectWindowMessage(WM_MOUSEWHEEL, MAKEWPARAM(0, scroll_amount), 0);
29 }
30 
31 TEST(MockWin32Window, HorizontalScroll) {
32  MockWin32Window window;
33  const int scroll_amount = 10;
34  // Vertical scroll should be passed along, adjusted for scroll tick size.
35  EXPECT_CALL(window, OnScroll(scroll_amount / 120.0, 0)).Times(1);
36 
37  window.InjectWindowMessage(WM_MOUSEHWHEEL, MAKEWPARAM(0, scroll_amount), 0);
38 }
39 
40 } // namespace testing
41 } // namespace flutter
void InjectWindowMessage(UINT const message, WPARAM const wparam, LPARAM const lparam)
return TRUE
Definition: fl_view.cc:107
Mock for the Win32Window base class.
TEST(EmbeddedViewParams, GetBoundingRectAfterMutationsWithNoMutations)