Flutter Engine
win32_dpi_utils_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 <windows.h>
6 
7 #include "flutter/shell/platform/windows/win32_dpi_utils.h"
8 #include "gtest/gtest.h"
9 
10 namespace flutter {
11 namespace testing {
12 
13 TEST(DpiUtilsTest, NonZero) {
14  ASSERT_GT(GetDpiForHWND(nullptr), 0);
15  ASSERT_GT(GetDpiForMonitor(nullptr), 0);
16 };
17 
18 TEST(DpiUtilsTest, NullHwndUsesPrimaryMonitor) {
19  const POINT target_point = {0, 0};
20  HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTOPRIMARY);
21  ASSERT_EQ(GetDpiForHWND(nullptr), GetDpiForMonitor(monitor));
22 };
23 
24 } // namespace testing
25 } // namespace flutter
UINT GetDpiForMonitor(HMONITOR monitor)
UINT GetDpiForHWND(HWND hwnd)
TEST(EmbeddedViewParams, GetBoundingRectAfterMutationsWithNoMutations)