Chromium Code Reviews| Index: content/browser/screen_orientation/screen_orientation_browsertest.cc |
| diff --git a/content/browser/screen_orientation/screen_orientation_browsertest.cc b/content/browser/screen_orientation/screen_orientation_browsertest.cc |
| index 253f16713fa36b45e7a5247bc8c0393ff3dd420d..badf77b97bce3c1c4fef3fe97090b7e502082c0f 100644 |
| --- a/content/browser/screen_orientation/screen_orientation_browsertest.cc |
| +++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc |
| @@ -6,6 +6,7 @@ |
| #include "base/command_line.h" |
| #include "base/macros.h" |
| +#include "base/strings/stringprintf.h" |
| #include "build/build_config.h" |
| #include "content/browser/frame_host/frame_tree.h" |
| #include "content/browser/frame_host/render_frame_host_impl.h" |
| @@ -355,4 +356,43 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationOOPIFBrowserTest, ScreenOrientation) { |
| } |
| } |
| +#ifdef OS_ANDROID |
| +IN_PROC_BROWSER_TEST_F(ScreenOrientationOOPIFBrowserTest, |
| + DISABLED_ScreenOrientationLock) { |
|
Charlie Reis
2017/06/06 22:41:37
Please include a comment for why this is disabled.
lfg
2017/06/07 22:30:57
Done.
|
| + GURL main_url(embedded_test_server()->GetURL( |
| + "a.com", "/cross_site_iframe_factory.html?a(b)")); |
| + EXPECT_TRUE(NavigateToURL(shell(), main_url)); |
| + WaitForResizeComplete(shell()->web_contents()); |
| + |
| + const char* types[] = {"portrait-primary", "portrait-secondary", |
| + "landscape-primary", "landscape-secondary"}; |
| + |
| + FrameTreeNode* root = web_contents()->GetFrameTree()->root(); |
| + FrameTreeNode* child = root->child_at(0); |
| + RenderFrameHostImpl* frames[] = {root->current_frame_host(), |
| + child->current_frame_host()}; |
| + |
| + EXPECT_TRUE(ExecuteScript(root->current_frame_host(), |
| + "document.body.webkitRequestFullscreen()")); |
| + for (const char* type : types) { |
| + std::string script = |
| + base::StringPrintf("screen.orientation.lock('%s')", type); |
| + EXPECT_TRUE(ExecuteScript(child->current_frame_host(), script)); |
| + |
| + for (auto* frame : frames) { |
| + std::string orientation_type; |
| + while (type != orientation_type) { |
| + EXPECT_TRUE(ExecuteScriptAndExtractString( |
| + frame, |
| + "window.domAutomationController.send(screen.orientation.type)", |
| + &orientation_type)); |
| + } |
| + } |
| + |
| + EXPECT_TRUE(ExecuteScript(child->current_frame_host(), |
| + "screen.orientation.unlock()")); |
| + } |
| +} |
| +#endif // OS_ANDROID |
| + |
| } // namespace content |