| Index: LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html
|
| diff --git a/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html b/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html
|
| index e255afdb09edf348cf7cae133754bd31c6f02e25..2d696be5d55e3ff079434fc1edb4d81ccab351f5 100644
|
| --- a/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html
|
| +++ b/LayoutTests/screen_orientation/lockOrientation-bad-array-argument.html
|
| @@ -9,7 +9,7 @@ window.jsTestIsAsync = true;
|
| function onOrientationChangeEvent(ev) {
|
| testFailed("Unexpected 'orientationchange' event");
|
| }
|
| -
|
| +
|
| function completeTest() {
|
| shouldBeEqualToString("screen.orientation", "portrait-primary");
|
| screen.unlockOrientation();
|
| @@ -18,13 +18,17 @@ function completeTest() {
|
|
|
| screen.addEventListener("orientationchange", onOrientationChangeEvent);
|
|
|
| +function typeErrorEnum(argStr) {
|
| + return "TypeError: Failed to execute 'lockOrientation' on 'Screen': parameter 1 ('" + argStr + "') is not a valid enum value.";
|
| +}
|
| +
|
| shouldBeEqualToString("screen.orientation", "portrait-primary");
|
| // Bad argument to lockOrientation(), we should not get locked.
|
| -shouldBeFalse("screen.lockOrientation(['portrait-primary', 'invalid-orientation'])");
|
| -shouldBeFalse("screen.lockOrientation(['portrait-primary', null])");
|
| -shouldBeFalse("screen.lockOrientation(['portrait-primary', undefined])");
|
| -shouldBeFalse("screen.lockOrientation(['portrait-primary', 123])");
|
| -shouldBeFalse("screen.lockOrientation(['portrait-primary', window])");
|
| +shouldThrow("screen.lockOrientation(['portrait-primary', 'invalid-orientation'])", "typeErrorEnum('portrait-primary,invalid-orientation')");
|
| +shouldThrow("screen.lockOrientation(['portrait-primary', null])", "typeErrorEnum('portrait-primary,')");
|
| +shouldThrow("screen.lockOrientation(['portrait-primary', undefined])", "typeErrorEnum('portrait-primary,')");
|
| +shouldThrow("screen.lockOrientation(['portrait-primary', 123])", "typeErrorEnum('portrait-primary,123')");
|
| +shouldThrow("screen.lockOrientation(['portrait-primary', window])", "typeErrorEnum('portrait-primary,[object Window]')");
|
|
|
| // Finish asynchronously to give events a chance to fire.
|
| setTimeout(completeTest, 0);
|
|
|