| 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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 #endif // defined(OS_WIN) | 238 #endif // defined(OS_WIN) |
| 239 | 239 |
| 240 navigation_observer.Wait(); | 240 navigation_observer.Wait(); |
| 241 | 241 |
| 242 // This is a success if the renderer process did not crash, thus, we end up | 242 // This is a success if the renderer process did not crash, thus, we end up |
| 243 // here. | 243 // here. |
| 244 } | 244 } |
| 245 | 245 |
| 246 #if defined(OS_ANDROID) |
| 247 class ScreenOrientationLockDisabledBrowserTest : public ContentBrowserTest { |
| 248 public: |
| 249 ScreenOrientationLockDisabledBrowserTest() {} |
| 250 ~ScreenOrientationLockDisabledBrowserTest() override {} |
| 251 |
| 252 void SetUpCommandLine(base::CommandLine* command_line) override { |
| 253 command_line->AppendSwitch(switches::kDisableScreenOrientationLock); |
| 254 } |
| 255 }; |
| 256 |
| 257 // Check that when --disable-screen-orientation-lock is passed to the command |
| 258 // line, screen.orientation.lock() correctly reports to not be supported. |
| 259 IN_PROC_BROWSER_TEST_F(ScreenOrientationLockDisabledBrowserTest, NotSupported) { |
| 260 GURL test_url = GetTestUrl("screen_orientation", |
| 261 "screen_orientation_lock_disabled.html"); |
| 262 |
| 263 TestNavigationObserver navigation_observer(shell()->web_contents(), 2); |
| 264 shell()->LoadURL(test_url); |
| 265 navigation_observer.Wait(); |
| 266 |
| 267 EXPECT_EQ("NotSupportedError", |
| 268 shell()->web_contents()->GetLastCommittedURL().ref()); |
| 269 } |
| 270 #endif // defined(OS_ANDROID) |
| 271 |
| 246 } // namespace content | 272 } // namespace content |
| OLD | NEW |