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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <html> 2 <html>
3 <body> 3 <body>
4 <script src="../fullscreen/full-screen-test.js"></script>
4 <script src="../resources/js-test.js"></script> 5 <script src="../resources/js-test.js"></script>
5 <script> 6 <script>
6 description("Basic screen.lockOrientation() / screen.unlockOrientation() testing "); 7 description("Basic screen.lockOrientation() / screen.unlockOrientation() testing ");
8 window.jsTestIsAsync = true;
7 9
8 shouldBeEqualToString("screen.orientation", "portrait-primary"); 10 function runTest() {
9 shouldNotThrow("screen.unlockOrientation()"); 11 shouldBeEqualToString("screen.orientation", "portrait-primary");
12 shouldNotThrow("screen.unlockOrientation()");
10 13
11 [ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary', 14 [ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary',
12 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) { 15 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) {
13 shouldBeTrue("screen.lockOrientation('" + orientation + "')"); 16 shouldBeTrue("screen.lockOrientation('" + orientation + "')");
14 }); 17 });
15 18
16 // Update is made asynchronously so that shouldn't change. 19 // Update is made asynchronously so that shouldn't change.
17 shouldBeEqualToString("screen.orientation", "portrait-primary"); 20 shouldBeEqualToString("screen.orientation", "portrait-primary");
18 shouldNotThrow("screen.unlockOrientation()"); 21 shouldNotThrow("screen.unlockOrientation()");
22 finishJSTest();
23 }
24
25 waitForEvent(document, 'webkitfullscreenchange', runTest);
26 runWithKeyDown(function(){document.documentElement.webkitRequestFullScreen()});
19 </script> 27 </script>
20 </body> 28 </body>
21 </html> 29 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698