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

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

Issue 653283007: Tests for CL 647933003. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix win8 Created 6 years, 2 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/test/data/screen_orientation/detached-iframe.html » ('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 94c15574fa40f0f733880d4b9ebdfd732b269123..33b026cf5bb4a21d0d53d0bd069366225efb40a5 100644
--- a/content/browser/screen_orientation/screen_orientation_browsertest.cc
+++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc
@@ -32,11 +32,6 @@ class ScreenOrientationBrowserTest : public ContentBrowserTest {
ScreenOrientationBrowserTest() {
}
- void SetUpCommandLine(CommandLine* command_line) override {
- command_line->AppendSwitch(
- switches::kEnableExperimentalWebPlatformFeatures);
- }
-
void SetUp() override {
// Painting has to happen otherwise the Resize messages will be added on top
// of each other without properly ack-painting which will fail and crash.
@@ -215,4 +210,30 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, LockSmoke) {
EXPECT_EQ(expected, shell()->web_contents()->GetLastCommittedURL().ref());
}
+// Check that using screen orientation after a frame is detached doesn't crash
+// the renderer process.
+// This could be a LayoutTest if they were not using a mock screen orientation
+// controller.
+IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, CrashTest_UseAfterDetach) {
+ GURL test_url = GetTestUrl("screen_orientation",
+ "screen_orientation_use_after_detach.html");
+
+ TestNavigationObserver navigation_observer(shell()->web_contents(), 2);
+ shell()->LoadURL(test_url);
+
+#if defined(OS_WIN)
+ // Screen Orientation is currently disabled on Windows 8.
+ // When implemented, this test will break, requiring an update.
+ if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_WIN8) {
+ EXPECT_EQ(false, ScreenOrientationSupported());
+ return;
+ }
+#endif // defined(OS_WIN)
+
+ navigation_observer.Wait();
+
+ // This is a success if the renderer process did not crash, thus, we end up
+ // here.
+}
+
} // namespace content
« no previous file with comments | « no previous file | content/test/data/screen_orientation/detached-iframe.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698