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

Unified Diff: content/browser/screen_orientation/screen_orientation_browsertest.cc

Issue 2916703002: Force resize event to be sent to OOPIF subframes when main frame resizes. (Closed)
Patch Set: add comment Created 3 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..08c3c6b89b233b4422f27a8fe380fc96c53bdccf 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,45 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationOOPIFBrowserTest, ScreenOrientation) {
}
}
+#ifdef OS_ANDROID
+// This test is disabled because th trybots run in system portrait lock, which
+// prevents the test from changing the screen orientation.
+IN_PROC_BROWSER_TEST_F(ScreenOrientationOOPIFBrowserTest,
+ DISABLED_ScreenOrientationLock) {
+ 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
« no previous file with comments | « no previous file | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698