Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Side by Side Diff: content/browser/screen_orientation/screen_orientation_browsertest.cc

Issue 1037693003: Disable Screen Orientation API locking ability for WebView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add missing file Created 5 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « content/browser/browser_main_loop.cc ('k') | content/public/common/content_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698