Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <body> | |
| 4 <script src="../resources/js-test.js"></script> | |
| 5 <script> | |
| 6 description("Validates that screen.lockOrientation() returns false on bad input" ); | |
| 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 shouldBeFalse("screen.lockOrientation('invalid-orientation')"); | |
| 23 shouldBeEqualToString("screen.orientation", "portrait-primary"); | |
| 24 shouldThrow("screen.lockOrientation()", '"TypeError: Failed to execute \'lockOri entation\' on \'Screen\': 1 argument required, but only 0 present."'); | |
|
mlamouri (slow - plz ping)
2014/02/12 20:11:26
Could you add tests that pass some garbage values
Inactive
2014/02/12 21:08:04
Done.
| |
| 25 | |
| 26 // Finish asynchronously to give events a chance to fire. | |
| 27 setTimeout(completeTest, 100); | |
| 28 </script> | |
| 29 </body> | |
| 30 </html> | |
| OLD | NEW |