| Flutter Windows Embedder |

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/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
dpi_utils.h
flutter::testing::TEST
TEST(AccessibilityBridgeWindows, GetParent)
Definition: accessibility_bridge_windows_unittests.cc:243
flutter
Definition: accessibility_bridge_windows.cc:11
flutter::GetDpiForHWND
UINT GetDpiForHWND(HWND hwnd)
Definition: dpi_utils.cc:128
flutter::GetDpiForMonitor
UINT GetDpiForMonitor(HMONITOR monitor)
Definition: dpi_utils.cc:132