mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
22 lines
541 B
C++
22 lines
541 B
C++
#include <windows.h>
|
|
|
|
#include "flutter/shell/platform/windows/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
|