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

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

Issue 456623003: Disable Screen Orientation API on Win8. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix compilation Created 6 years, 4 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/child/runtime_features.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 8216106ace3da5e265e71f9c1676b9f7fedd8bf9..90fe72943d8892c60fb892f60eaa6fb16143b599 100644
--- a/content/browser/screen_orientation/screen_orientation_browsertest.cc
+++ b/content/browser/screen_orientation/screen_orientation_browsertest.cc
@@ -21,6 +21,10 @@
#include "third_party/WebKit/public/platform/WebScreenInfo.h"
#include "ui/compositor/compositor_switches.h"
+#if defined(OS_WIN)
+#include "base/win/windows_version.h"
+#endif // OS_WIN
+
namespace content {
class ScreenOrientationBrowserTest : public ContentBrowserTest {
@@ -86,6 +90,13 @@ class ScreenOrientationBrowserTest : public ContentBrowserTest {
return type;
}
+ bool ScreenOrientationSupported() {
+ bool support;
+ ExecuteScriptAndGetValue(shell()->web_contents()->GetMainFrame(),
+ "'orientation' in screen")->GetAsBoolean(&support);
+ return support;
+ }
+
bool WindowOrientationSupported() {
bool support;
ExecuteScriptAndGetValue(shell()->web_contents()->GetMainFrame(),
@@ -123,6 +134,15 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, ScreenOrientationChange) {
WaitForResizeComplete(shell()->web_contents());
#endif // USE_AURA
+#if defined(OS_WIN)
+ // Screen Orientation is currently disabled on Windows 8.
+ // This test will break, requiring an update when the API will be enabled.
+ if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_WIN8) {
+ EXPECT_EQ(false, ScreenOrientationSupported());
+ return;
+ }
+#endif // defined(OS_WIN)
+
int angle = GetOrientationAngle();
for (int i = 0; i < 4; ++i) {
@@ -170,6 +190,16 @@ IN_PROC_BROWSER_TEST_F(ScreenOrientationBrowserTest, LockSmoke) {
TestNavigationObserver navigation_observer(shell()->web_contents(), 2);
shell()->LoadURL(test_url);
+
+#if defined(OS_WIN)
+ // Screen Orientation is currently disabled on Windows 8.
+ // This test will break, requiring an update when the API will be enabled.
+ if (base::win::OSInfo::GetInstance()->version() >= base::win::VERSION_WIN8) {
+ EXPECT_EQ(false, ScreenOrientationSupported());
+ return;
+ }
+#endif // defined(OS_WIN)
+
navigation_observer.Wait();
#if USE_AURA
WaitForResizeComplete(shell()->web_contents());
« no previous file with comments | « no previous file | content/child/runtime_features.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698