Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(254)

Unified Diff: LayoutTests/screen_orientation/lockOrientation-bad-argument.html

Issue 204653002: Screen Orientation: use OrientationLockType enum for lockOrientation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@screen_orientation_type
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/screen_orientation/lockOrientation-bad-argument-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/screen_orientation/lockOrientation-bad-argument.html
diff --git a/LayoutTests/screen_orientation/lockOrientation-bad-argument.html b/LayoutTests/screen_orientation/lockOrientation-bad-argument.html
index 8a4fc88ab3c0866a06cb432683107135c31af89c..95456dbe7356b7605a236a39675d184f01fd8de8 100644
--- a/LayoutTests/screen_orientation/lockOrientation-bad-argument.html
+++ b/LayoutTests/screen_orientation/lockOrientation-bad-argument.html
@@ -18,18 +18,22 @@ 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");
-shouldBeFalse("screen.lockOrientation('invalid-orientation')");
+shouldThrow("screen.lockOrientation('invalid-orientation')", "typeErrorEnum('invalid-orientation')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldBeFalse("screen.lockOrientation(null)");
+shouldThrow("screen.lockOrientation(null)", "typeErrorEnum('null')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldBeFalse("screen.lockOrientation(undefined)");
+shouldThrow("screen.lockOrientation(undefined)", "typeErrorEnum('undefined')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldBeFalse("screen.lockOrientation(123)");
+shouldThrow("screen.lockOrientation(123)", "typeErrorEnum('123')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldBeFalse("screen.lockOrientation(window)");
+shouldThrow("screen.lockOrientation(window)", "typeErrorEnum('[object Window]')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
-shouldBeFalse("screen.lockOrientation(['portrait-primary', 'landscape-primary'])");
+shouldThrow("screen.lockOrientation(['portrait-primary', 'landscape-primary'])", "typeErrorEnum('portrait-primary,landscape-primary')");
shouldBeEqualToString("screen.orientation", "portrait-primary");
shouldThrow("screen.lockOrientation()", '"TypeError: Failed to execute \'lockOrientation\' on \'Screen\': 1 argument required, but only 0 present."');
« no previous file with comments | « no previous file | LayoutTests/screen_orientation/lockOrientation-bad-argument-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698