OLD | NEW |
1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/chromeos/arc/settings_bridge.h" | 5 #include "components/arc/intent_helper/font_size_util.h" |
6 | 6 |
7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
8 | 8 |
9 namespace arc { | 9 namespace arc { |
10 | 10 |
11 namespace fontsizes { | 11 TEST(ArcSettingsServiceTest, FontSizeConvertChromeToAndroid) { |
12 | |
13 TEST(SettingsBridgeTest, FontSizeConvertChromeToAndroid) { | |
14 // Does not return a value smaller than Small. | 12 // Does not return a value smaller than Small. |
15 EXPECT_DOUBLE_EQ(kAndroidFontScaleSmall, | 13 EXPECT_DOUBLE_EQ(kAndroidFontScaleSmall, |
16 ConvertFontSizeChromeToAndroid(0, 0, 0)); | 14 ConvertFontSizeChromeToAndroid(0, 0, 0)); |
17 | 15 |
18 // Does not return a value larger than Huge | 16 // Does not return a value larger than Huge |
19 EXPECT_DOUBLE_EQ(kAndroidFontScaleHuge, | 17 EXPECT_DOUBLE_EQ(kAndroidFontScaleHuge, |
20 ConvertFontSizeChromeToAndroid(100, 100, 100)); | 18 ConvertFontSizeChromeToAndroid(100, 100, 100)); |
21 | 19 |
22 // The max of any Chrome values is what determines the Android value. | 20 // The max of any Chrome values is what determines the Android value. |
23 EXPECT_DOUBLE_EQ(kAndroidFontScaleLarge, | 21 EXPECT_DOUBLE_EQ(kAndroidFontScaleLarge, |
(...skipping 17 matching lines...) Expand all Loading... |
41 | 39 |
42 // Large converts properly. | 40 // Large converts properly. |
43 EXPECT_DOUBLE_EQ(kAndroidFontScaleLarge, | 41 EXPECT_DOUBLE_EQ(kAndroidFontScaleLarge, |
44 ConvertFontSizeChromeToAndroid(20, 0, 0)); | 42 ConvertFontSizeChromeToAndroid(20, 0, 0)); |
45 | 43 |
46 // Very large converts properly. | 44 // Very large converts properly. |
47 EXPECT_DOUBLE_EQ(kAndroidFontScaleHuge, | 45 EXPECT_DOUBLE_EQ(kAndroidFontScaleHuge, |
48 ConvertFontSizeChromeToAndroid(24, 0, 0)); | 46 ConvertFontSizeChromeToAndroid(24, 0, 0)); |
49 } | 47 } |
50 | 48 |
51 } // namespace fontsizes | |
52 | |
53 } // namespace arc | 49 } // namespace arc |
OLD | NEW |