OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <body> |
| 4 <script src="../resources/js-test.js"></script> |
| 5 <script> |
| 6 description("Validates that lockOrientation() returns false on bad orientation v
alue in array argument."); |
| 7 window.jsTestIsAsync = true; |
| 8 |
| 9 function onOrientationChangeEvent(ev) { |
| 10 testFailed("Unexpected 'orientationchange' event"); |
| 11 } |
| 12 |
| 13 function completeTest() { |
| 14 shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| 15 screen.unlockOrientation(); |
| 16 finishJSTest(); |
| 17 } |
| 18 |
| 19 screen.addEventListener("orientationchange", onOrientationChangeEvent); |
| 20 |
| 21 shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| 22 // Bad argument to lockOrientation(), we should not get locked. |
| 23 shouldBeFalse("screen.lockOrientation(['portrait-primary', 'invalid-orientation'
])"); |
| 24 shouldBeFalse("screen.lockOrientation(['portrait-primary', null])"); |
| 25 shouldBeFalse("screen.lockOrientation(['portrait-primary', undefined])"); |
| 26 shouldBeFalse("screen.lockOrientation(['portrait-primary', 123])"); |
| 27 shouldBeFalse("screen.lockOrientation(['portrait-primary', window])"); |
| 28 |
| 29 // Finish asynchronously to give events a chance to fire. |
| 30 setTimeout(completeTest, 0); |
| 31 </script> |
| 32 </body> |
| 33 </html> |
| 34 |
OLD | NEW |