OLD | NEW |
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> |
OLD | NEW |