| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <html> | 2 <html> |
| 3 <body> | 3 <body> |
| 4 <script src="../resources/js-test.js"></script> | 4 <script src="../resources/js-test.js"></script> |
| 5 <script> | 5 <script> |
| 6 description("Basic screen.lockOrientation() / screen.unlockOrientation() testing
"); | 6 description("Basic screen.lockOrientation() / screen.unlockOrientation() testing
"); |
| 7 | 7 |
| 8 shouldBeEqualToString("screen.orientation", "portrait-primary"); | 8 shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| 9 shouldNotThrow("screen.unlockOrientation()"); | 9 shouldNotThrow("screen.unlockOrientation()"); |
| 10 shouldBeTrue("screen.lockOrientation('landscape-primary')"); | 10 |
| 11 shouldBeEqualToString("screen.orientation", "portrait-primary"); // Should updat
e asynchronously. | 11 [ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary', |
| 12 shouldBeTrue("screen.lockOrientation('landscape-secondary')"); // Consecutive lo
cking. | 12 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) { |
| 13 shouldBeTrue("screen.lockOrientation('" + orientation + "')"); |
| 14 }); |
| 15 |
| 16 // Update is made asynchronously so that shouldn't change. |
| 17 shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| 13 shouldNotThrow("screen.unlockOrientation()"); | 18 shouldNotThrow("screen.unlockOrientation()"); |
| 14 </script> | 19 </script> |
| 15 </body> | 20 </body> |
| 16 </html> | 21 </html> |
| OLD | NEW |