Flutter Engine
The Flutter Engine
display_unittest.cc
Go to the documentation of this file.
1// Copyright (c) 2011 The Chromium 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 "base/win/display.h"
6
7#include "gtest/gtest.h"
8
9namespace base {
10namespace win {
11
13 EXPECT_EQ(ScaleFactorToFloat(SCALE_100_PERCENT), 1.00f);
14 EXPECT_EQ(ScaleFactorToFloat(SCALE_120_PERCENT), 1.20f);
15 EXPECT_EQ(ScaleFactorToFloat(SCALE_125_PERCENT), 1.25f);
16 EXPECT_EQ(ScaleFactorToFloat(SCALE_140_PERCENT), 1.40f);
17 EXPECT_EQ(ScaleFactorToFloat(SCALE_150_PERCENT), 1.50f);
18 EXPECT_EQ(ScaleFactorToFloat(SCALE_160_PERCENT), 1.60f);
19 EXPECT_EQ(ScaleFactorToFloat(SCALE_175_PERCENT), 1.75f);
20 EXPECT_EQ(ScaleFactorToFloat(SCALE_180_PERCENT), 1.80f);
21 EXPECT_EQ(ScaleFactorToFloat(SCALE_200_PERCENT), 2.00f);
22 EXPECT_EQ(ScaleFactorToFloat(SCALE_225_PERCENT), 2.25f);
23 EXPECT_EQ(ScaleFactorToFloat(SCALE_250_PERCENT), 2.50f);
24 EXPECT_EQ(ScaleFactorToFloat(SCALE_350_PERCENT), 3.50f);
25 EXPECT_EQ(ScaleFactorToFloat(SCALE_400_PERCENT), 4.00f);
26 EXPECT_EQ(ScaleFactorToFloat(SCALE_450_PERCENT), 4.50f);
27 EXPECT_EQ(ScaleFactorToFloat(SCALE_500_PERCENT), 5.00f);
28 EXPECT_EQ(ScaleFactorToFloat(DEVICE_SCALE_FACTOR_INVALID), 1.0f);
29}
30
31} // namespace win
32} // namespace base
TEST(Display, ScaleFactorToFloat)
float ScaleFactorToFloat(DEVICE_SCALE_FACTOR scale_factor)
Definition: display.cc:83