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

Unified Diff: LayoutTests/screen_orientation/lockOrientation-basic.html

Issue 261983005: Stop firing orientationchange events at pages that are not visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Simplify test case Created 6 years, 7 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
Index: LayoutTests/screen_orientation/lockOrientation-basic.html
diff --git a/LayoutTests/screen_orientation/lockOrientation-basic.html b/LayoutTests/screen_orientation/lockOrientation-basic.html
index a14ae787e6523faa97a433a2c332e2b0fba20ba4..ae860c72d9052dabd85123c8a9f7ae5429abb6d9 100644
--- a/LayoutTests/screen_orientation/lockOrientation-basic.html
+++ b/LayoutTests/screen_orientation/lockOrientation-basic.html
@@ -1,21 +1,29 @@
<!DOCTYPE html>
<html>
<body>
+<script src="../fullscreen/full-screen-test.js"></script>
<script src="../resources/js-test.js"></script>
<script>
description("Basic screen.lockOrientation() / screen.unlockOrientation() testing");
+window.jsTestIsAsync = true;
-shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldNotThrow("screen.unlockOrientation()");
+function runTest() {
+ shouldBeEqualToString("screen.orientation", "portrait-primary");
+ shouldNotThrow("screen.unlockOrientation()");
-[ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary',
- 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) {
- shouldBeTrue("screen.lockOrientation('" + orientation + "')");
-});
+ [ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary',
+ 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) {
+ shouldBeTrue("screen.lockOrientation('" + orientation + "')");
+ });
-// Update is made asynchronously so that shouldn't change.
-shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldNotThrow("screen.unlockOrientation()");
+ // Update is made asynchronously so that shouldn't change.
+ shouldBeEqualToString("screen.orientation", "portrait-primary");
+ shouldNotThrow("screen.unlockOrientation()");
+ finishJSTest();
+}
+
+waitForEvent(document, 'webkitfullscreenchange', runTest);
+runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
</script>
</body>
</html>

Powered by Google App Engine
This is Rietveld 408576698