| 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 |
| 110 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, | 116 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, |
| 111 ScreenOrientationChange) { | 117 MAYBE_ScreenOrientationChange) { |
| 112 std::string types[] = { "portrait-primary", | 118 std::string types[] = { "portrait-primary", |
| 113 "portrait-secondary", | 119 "portrait-secondary", |
| 114 "landscape-primary", | 120 "landscape-primary", |
| 115 "landscape-secondary" }; | 121 "landscape-secondary" }; |
| 116 GURL test_url = GetTestUrl("screen_orientation", | 122 GURL test_url = GetTestUrl("screen_orientation", |
| 117 "screen_orientation_screenorientationchange.html"); | 123 "screen_orientation_screenorientationchange.html"); |
| 118 | 124 |
| 119 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 125 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 120 shell()->LoadURL(test_url); | 126 shell()->LoadURL(test_url); |
| 121 navigation_observer.Wait(); | 127 navigation_observer.Wait(); |
| (...skipping 15 matching lines...) Expand all Loading... |
| 137 SendFakeScreenOrientation(angle, types[i]); | 143 SendFakeScreenOrientation(angle, types[i]); |
| 138 | 144 |
| 139 TestNavigationObserver navigation_observer(shell()->web_contents()); | 145 TestNavigationObserver navigation_observer(shell()->web_contents()); |
| 140 navigation_observer.Wait(); | 146 navigation_observer.Wait(); |
| 141 EXPECT_EQ(angle, GetOrientationAngle()); | 147 EXPECT_EQ(angle, GetOrientationAngle()); |
| 142 EXPECT_EQ(types[i], GetOrientationType()); | 148 EXPECT_EQ(types[i], GetOrientationType()); |
| 143 } | 149 } |
| 144 } | 150 } |
| 145 #endif // defined(USE_AURA) || defined(OS_ANDROID) | 151 #endif // defined(USE_AURA) || defined(OS_ANDROID) |
| 146 | 152 |
| 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 |
| 147 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, | 159 IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, |
| 148 WindowOrientationChange) { | 160 MAYBE_WindowOrientationChange) { |
| 149 GURL test_url = GetTestUrl("screen_orientation", | 161 GURL test_url = GetTestUrl("screen_orientation", |
| 150 "screen_orientation_windoworientationchange.html"); | 162 "screen_orientation_windoworientationchange.html"); |
| 151 | 163 |
| 152 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); | 164 TestNavigationObserver navigation_observer(shell()->web_contents(), 1); |
| 153 shell()->LoadURL(test_url); | 165 shell()->LoadURL(test_url); |
| 154 navigation_observer.Wait(); | 166 navigation_observer.Wait(); |
| 155 #if USE_AURA || defined(OS_ANDROID) | 167 #if USE_AURA || defined(OS_ANDROID) |
| 156 WaitForResizeComplete(shell()->web_contents()); | 168 WaitForResizeComplete(shell()->web_contents()); |
| 157 #endif // USE_AURA || defined(OS_ANDROID) | 169 #endif // USE_AURA || defined(OS_ANDROID) |
| 158 | 170 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 253 TestNavigationObserver navigation_observer(shell()->web_contents(), 2); | 265 TestNavigationObserver navigation_observer(shell()->web_contents(), 2); |
| 254 shell()->LoadURL(test_url); | 266 shell()->LoadURL(test_url); |
| 255 navigation_observer.Wait(); | 267 navigation_observer.Wait(); |
| 256 | 268 |
| 257 EXPECT_EQ("NotSupportedError", | 269 EXPECT_EQ("NotSupportedError", |
| 258 shell()->web_contents()->GetLastCommittedURL().ref()); | 270 shell()->web_contents()->GetLastCommittedURL().ref()); |
| 259 } | 271 } |
| 260 #endif // defined(OS_ANDROID) | 272 #endif // defined(OS_ANDROID) |
| 261 | 273 |
| 262 } // namespace content | 274 } // namespace content |
| OLD | NEW |