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

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

Issue 436603002: Enable Screen Orientation integration tests for Chrome OS and Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@reduce_flakiness
Patch Set: fix android Created 6 years, 5 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/public/test/browser_test_base.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 40c372d22479edb20c8c2ac42781ab01cfd891de..94e1a00cf2cca3fe60450e3395c4b3e1c504957a 100644
--- a/content/browser/screen_orientation/screen_orientation_browsertest.cc
+++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc
@@ -89,8 +89,11 @@ class ScreenOrientationBrowserTest : public ContentBrowserTest {
DISALLOW_COPY_AND_ASSIGN(ScreenOrientationBrowserTest);
};
-#if !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
-IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, OrientationChange) {
+// This test doesn't work on MacOS X but the reason is mostly because it is not
+// used Aura. It could be set as !defined(OS_MACOSX) but the rule below will
+// actually support MacOS X if and when it switches to Aura.
+#if defined(USE_AURA) || defined(OS_ANDROID)
+IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, ScreenOrientationChange) {
std::string types[] = { "portrait-primary",
"portrait-secondary",
"landscape-primary",
@@ -98,7 +101,14 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, OrientationChange) {
GURL test_url = GetTestUrl("screen_orientation",
"screen_orientation_orientationchange.html");
- TestNavigationObserver navigation_observer(shell()->web_contents(), 1);
+ TestNavigationObserver navigation_observer(
+ shell()->web_contents(), 1
+ // Android doesn't paint (ie. UseSoftwareCompositing() has no effect) so we
+ // shouldn't wait for the first paint.
+ #if !defined(OS_ANDROID)
+ , TestNavigationObserver::FirstPaintRequired
+ #endif
+ );
shell()->LoadURL(test_url);
navigation_observer.Wait();
@@ -108,12 +118,12 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, OrientationChange) {
angle = (angle + 90) % 360;
SendFakeScreenOrientation(angle, types[i]);
- TestNavigationObserver navigation_observer(shell()->web_contents(), 1);
+ TestNavigationObserver navigation_observer(shell()->web_contents());
navigation_observer.Wait();
EXPECT_EQ(angle, GetOrientationAngle());
EXPECT_EQ(types[i], GetOrientationType());
}
}
-#endif // !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_CHROMEOS)
+#endif // defined(USE_AURA) || defined(OS_ANDROID)
} // namespace content
« no previous file with comments | « no previous file | content/public/test/browser_test_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698