blob: 91d9d95ac40e1133773928d94c50dbda3e5754a1 [file] [log] [blame]
// Copyright 2013 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <windows.h>
#include "flutter/shell/platform/windows/dpi_utils_win32.h"
#include "gtest/gtest.h"
namespace flutter {
namespace testing {
TEST(DpiUtilsTest, NonZero) {
ASSERT_GT(GetDpiForHWND(nullptr), 0);
ASSERT_GT(GetDpiForMonitor(nullptr), 0);
};
TEST(DpiUtilsTest, NullHwndUsesPrimaryMonitor) {
const POINT target_point = {0, 0};
HMONITOR monitor = MonitorFromPoint(target_point, MONITOR_DEFAULTTOPRIMARY);
ASSERT_EQ(GetDpiForHWND(nullptr), GetDpiForMonitor(monitor));
};
} // namespace testing
} // namespace flutter