OLD | NEW |
1 // Copyright 2016 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 #import "ios/web/web_state/page_viewport_state.h" | 5 #import "ios/web/web_state/page_viewport_state.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "testing/gtest/include/gtest/gtest.h" | 8 #include "testing/gtest/include/gtest/gtest.h" |
9 #include "url/gurl.h" | 9 #include "url/gurl.h" |
10 | 10 |
| 11 #if !defined(__has_feature) || !__has_feature(objc_arc) |
| 12 #error "This file requires ARC support." |
| 13 #endif |
| 14 |
11 namespace web { | 15 namespace web { |
12 | 16 |
13 // Verifies viewport length construction for "device-width" and "device-height". | 17 // Verifies viewport length construction for "device-width" and "device-height". |
14 TEST(ViewportLengthTest, DeviceDimension) { | 18 TEST(ViewportLengthTest, DeviceDimension) { |
15 ViewportLength device_width(@"device-width"); | 19 ViewportLength device_width(@"device-width"); |
16 EXPECT_TRUE(device_width.use_device_length()); | 20 EXPECT_TRUE(device_width.use_device_length()); |
17 EXPECT_TRUE(isnan(device_width.value())); | 21 EXPECT_TRUE(isnan(device_width.value())); |
18 ViewportLength device_height(@"device-height"); | 22 ViewportLength device_height(@"device-height"); |
19 EXPECT_TRUE(device_height.use_device_length()); | 23 EXPECT_TRUE(device_height.use_device_length()); |
20 EXPECT_TRUE(isnan(device_height.value())); | 24 EXPECT_TRUE(isnan(device_height.value())); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 EXPECT_TRUE(state.user_scalable()); | 69 EXPECT_TRUE(state.user_scalable()); |
66 state = PageViewportState(@"user-scalable=1"); | 70 state = PageViewportState(@"user-scalable=1"); |
67 EXPECT_TRUE(state.user_scalable()); | 71 EXPECT_TRUE(state.user_scalable()); |
68 state = PageViewportState(@"user-scalable=no"); | 72 state = PageViewportState(@"user-scalable=no"); |
69 EXPECT_FALSE(state.user_scalable()); | 73 EXPECT_FALSE(state.user_scalable()); |
70 state = PageViewportState(@"user-scalable=0"); | 74 state = PageViewportState(@"user-scalable=0"); |
71 EXPECT_FALSE(state.user_scalable()); | 75 EXPECT_FALSE(state.user_scalable()); |
72 } | 76 } |
73 | 77 |
74 } // namespace web | 78 } // namespace web |
OLD | NEW |