OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "remoting/host/screen_resolution.h" | 5 #include "remoting/host/screen_resolution.h" |
6 | 6 |
| 7 #include <stdint.h> |
| 8 |
7 #include <limits> | 9 #include <limits> |
8 | 10 |
9 #include "testing/gmock/include/gmock/gmock.h" | 11 #include "testing/gmock/include/gmock/gmock.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
11 | 13 |
12 namespace remoting { | 14 namespace remoting { |
13 | 15 |
14 TEST(ScreenResolutionTest, Empty) { | 16 TEST(ScreenResolutionTest, Empty) { |
15 ScreenResolution resolution1( | 17 ScreenResolution resolution1( |
16 webrtc::DesktopSize(100, 100), webrtc::DesktopVector(10, 10)); | 18 webrtc::DesktopSize(100, 100), webrtc::DesktopVector(10, 10)); |
(...skipping 16 matching lines...) Expand all Loading... |
33 resolution.ScaleDimensionsToDpi(webrtc::DesktopVector(5, 5)))); | 35 resolution.ScaleDimensionsToDpi(webrtc::DesktopVector(5, 5)))); |
34 | 36 |
35 EXPECT_TRUE(webrtc::DesktopSize(200, 200).equals( | 37 EXPECT_TRUE(webrtc::DesktopSize(200, 200).equals( |
36 resolution.ScaleDimensionsToDpi(webrtc::DesktopVector(20, 20)))); | 38 resolution.ScaleDimensionsToDpi(webrtc::DesktopVector(20, 20)))); |
37 } | 39 } |
38 | 40 |
39 TEST(ScreenResolutionTest, ScalingSaturation) { | 41 TEST(ScreenResolutionTest, ScalingSaturation) { |
40 ScreenResolution resolution( | 42 ScreenResolution resolution( |
41 webrtc::DesktopSize(10000000, 1000000), webrtc::DesktopVector(1, 1)); | 43 webrtc::DesktopSize(10000000, 1000000), webrtc::DesktopVector(1, 1)); |
42 | 44 |
43 int32 max_int = std::numeric_limits<int32>::max(); | 45 int32_t max_int = std::numeric_limits<int32_t>::max(); |
44 EXPECT_TRUE(webrtc::DesktopSize(max_int, max_int).equals( | 46 EXPECT_TRUE(webrtc::DesktopSize(max_int, max_int).equals( |
45 resolution.ScaleDimensionsToDpi( | 47 resolution.ScaleDimensionsToDpi( |
46 webrtc::DesktopVector(1000000, 1000000)))); | 48 webrtc::DesktopVector(1000000, 1000000)))); |
47 } | 49 } |
48 | 50 |
49 } // namespace remoting | 51 } // namespace remoting |
OLD | NEW |