blob: 90a580bb9531848f66e1708ff66325e093bf8157 [file] [log] [blame]
#include <windows.h>
#include "flutter/shell/platform/windows/win32_dpi_utils.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