Chromium Code Reviews| Index: LayoutTests/screen_orientation/locking-failure.html |
| diff --git a/LayoutTests/screen_orientation/locking-failure.html b/LayoutTests/screen_orientation/locking-failure.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d1514aea7957f45d7a52be7b28799e2df3cf7c96 |
| --- /dev/null |
| +++ b/LayoutTests/screen_orientation/locking-failure.html |
| @@ -0,0 +1,30 @@ |
| +<!DOCTYPE html> |
| +<html> |
| +<body> |
| +<script src="../resources/js-test.js"></script> |
| +<script> |
| +description("Validates that screen.lockOrientation() returns false on bad input"); |
| +window.jsTestIsAsync = true; |
| + |
| +function onOrientationChangeEvent(ev) { |
| + testFailed("Unexpected 'orientationchange' event"); |
| +} |
| + |
| +function completeTest() { |
| + shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| + screen.unlockOrientation(); |
| + finishJSTest(); |
| +} |
| + |
| +screen.addEventListener("orientationchange", onOrientationChangeEvent); |
| + |
| +shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| +shouldBeFalse("screen.lockOrientation('invalid-orientation')"); |
| +shouldBeEqualToString("screen.orientation", "portrait-primary"); |
| +shouldThrow("screen.lockOrientation()", '"TypeError: Failed to execute \'lockOrientation\' 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.
|
| + |
| +// Finish asynchronously to give events a chance to fire. |
| +setTimeout(completeTest, 100); |
| +</script> |
| +</body> |
| +</html> |