OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <stdlib.h> | 5 #include <stdlib.h> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "content/browser/renderer_host/render_widget_host_impl.h" | 8 #include "content/browser/renderer_host/render_widget_host_impl.h" |
9 #include "content/common/view_messages.h" | 9 #include "content/common/view_messages.h" |
10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 } | 100 } |
101 | 101 |
102 private: | 102 private: |
103 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationBrowserTest); | 103 DISALLOW_COPY_AND_ASSIGN(ScreenOrientationBrowserTest); |
104 }; | 104 }; |
105 | 105 |
106 // This test doesn't work on MacOS X but the reason is mostly because it is not | 106 // This test doesn't work on MacOS X but the reason is mostly because it is not |
107 // used Aura. It could be set as !defined(OS_MACOSX) but the rule below will | 107 // used Aura. It could be set as !defined(OS_MACOSX) but the rule below will |
108 // actually support MacOS X if and when it switches to Aura. | 108 // actually support MacOS X if and when it switches to Aura. |
109 #if defined(USE_AURA) || defined(OS_ANDROID) | 109 #if defined(USE_AURA) || defined(OS_ANDROID) |
110 // Flaky on Chrome OS: http://crbug.com/468259 | |
111 #if defined(OS_CHROMEOS) | |
112 #define MAYBE_ScreenOrientationChange DISABLED_ScreenOrientationChange | |
113 #else | |
114 #define MAYBE_ScreenOrientationChange ScreenOrientationChange | |
115 #endif | |
116 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, | 110 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, |
117 MAYBE_ScreenOrientationChange) { | 111 ScreenOrientationChange) { |
118 std::string types[] = { "portrait-primary", | 112 std::string types[] = { "portrait-primary", |
119 "portrait-secondary", | 113 "portrait-secondary", |
120 "landscape-primary", | 114 "landscape-primary", |
121 "landscape-secondary" }; | 115 "landscape-secondary" }; |
122 GURL test_url = GetTestUrl("screen_orientation", | 116 GURL test_url = GetTestUrl("screen_orientation", |
123 "screen_orientation_screenorientationchange.html"); | 117 "screen_orientation_screenorientationchange.html"); |
124 | 118 |
125 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 119 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
126 shell()->LoadURL(test_url); | 120 shell()->LoadURL(test_url); |
127 navigation_observer.Wait(); | 121 navigation_observer.Wait(); |
(...skipping 15 matching lines...) Expand all Loading... |
143 SendFakeScreenOrientation(angle, types[i]); | 137 SendFakeScreenOrientation(angle, types[i]); |
144 | 138 |
145 TestNavigationObserver navigation_observer(shell()->web_contents()); | 139 TestNavigationObserver navigation_observer(shell()->web_contents()); |
146 navigation_observer.Wait(); | 140 navigation_observer.Wait(); |
147 EXPECT_EQ(angle, GetOrientationAngle()); | 141 EXPECT_EQ(angle, GetOrientationAngle()); |
148 EXPECT_EQ(types[i], GetOrientationType()); | 142 EXPECT_EQ(types[i], GetOrientationType()); |
149 } | 143 } |
150 } | 144 } |
151 #endif // defined(USE_AURA) || defined(OS_ANDROID) | 145 #endif // defined(USE_AURA) || defined(OS_ANDROID) |
152 | 146 |
153 // Flaky on Chrome OS: http://crbug.com/468259 | |
154 #if defined(OS_CHROMEOS) | |
155 #define MAYBE_WindowOrientationChange DISABLED_WindowOrientationChange | |
156 #else | |
157 #define MAYBE_WindowOrientationChange WindowOrientationChange | |
158 #endif | |
159 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, | 147 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, |
160 MAYBE_WindowOrientationChange) { | 148 WindowOrientationChange) { |
161 GURL test_url = GetTestUrl("screen_orientation", | 149 GURL test_url = GetTestUrl("screen_orientation", |
162 "screen_orientation_windoworientationchange.html"); | 150 "screen_orientation_windoworientationchange.html"); |
163 | 151 |
164 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 152 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
165 shell()->LoadURL(test_url); | 153 shell()->LoadURL(test_url); |
166 navigation_observer.Wait(); | 154 navigation_observer.Wait(); |
167 #if USE_AURA || defined(OS_ANDROID) | 155 #if USE_AURA || defined(OS_ANDROID) |
168 WaitForResizeComplete(shell()->web_contents()); | 156 WaitForResizeComplete(shell()->web_contents()); |
169 #endif // USE_AURA || defined(OS_ANDROID) | 157 #endif // USE_AURA || defined(OS_ANDROID) |
170 | 158 |
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
265 TestNavigationObserver navigation_observer(shell()->web_contents(), 2); | 253 TestNavigationObserver navigation_observer(shell()->web_contents(), 2); |
266 shell()->LoadURL(test_url); | 254 shell()->LoadURL(test_url); |
267 navigation_observer.Wait(); | 255 navigation_observer.Wait(); |
268 | 256 |
269 EXPECT_EQ("NotSupportedError", | 257 EXPECT_EQ("NotSupportedError", |
270 shell()->web_contents()->GetLastCommittedURL().ref()); | 258 shell()->web_contents()->GetLastCommittedURL().ref()); |
271 } | 259 } |
272 #endif // defined(OS_ANDROID) | 260 #endif // defined(OS_ANDROID) |
273 | 261 |
274 } // namespace content | 262 } // namespace content |
OLD | NEW |