Flutter Engine
The Flutter Engine
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
10namespace flutter {
11namespace testing {
12
13TEST(DpiUtilsTest, NonZero) {
14 ASSERT_GT(GetDpiForHWND(nullptr), 0);
15 ASSERT_GT(GetDpiForMonitor(nullptr), 0);
16};
17
18TEST(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
TEST(DisplayListComplexity, EmptyDisplayList)
UINT GetDpiForHWND(HWND hwnd)
Definition: dpi_utils.cc:130
UINT GetDpiForMonitor(HMONITOR monitor)
Definition: dpi_utils.cc:134