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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/screen-orientation/lock-bad-argument.html

Issue 1666363003: Import web-platform-tests@27e3d93f88a71a249d1df872a5d613b3243b9588 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Missed win failiure in TestExpectations Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../../../resources/testharness.js"></script>
5 <script src="../../../resources/testharnessreport.js"></script>
6 <script>
7
8 var test = async_test("Test that screen.orientation.lock() throws when the input isn't valid.");
9
10 function onOrientationChangeEvent(ev) {
11 assert_unreached('Unexpected orientation change');
12 }
13
14 window.screen.orientation.addEventListener('change', test.step_func(onOrientatio nChangeEvent));
15
16 test.step(function() {
17 assert_equals(screen.orientation.type, 'portrait-primary');
18 assert_throws(new TypeError(), function() {
19 screen.orientation.lock('invalid-orientation');
20 });
21
22 assert_equals(screen.orientation.type, 'portrait-primary');
23 assert_throws(new TypeError(), function() {
24 screen.orientation.lock(null);
25 });
26
27 assert_equals(screen.orientation.type, 'portrait-primary');
28 assert_throws(new TypeError(), function() {
29 screen.orientation.lock(undefined);
30 });
31
32 assert_equals(screen.orientation.type, 'portrait-primary');
33 assert_throws(new TypeError(), function() {
34 screen.orientation.lock(undefined);
35 });
36
37 assert_equals(screen.orientation.type, 'portrait-primary');
38 assert_throws(new TypeError(), function() {
39 screen.orientation.lock(123);
40 });
41
42 assert_equals(screen.orientation.type, 'portrait-primary');
43 assert_throws(new TypeError(), function() {
44 screen.orientation.lock(window);
45 });
46
47 assert_equals(screen.orientation.type, 'portrait-primary');
48 assert_throws(new TypeError(), function() {
49 screen.orientation.lock(['portrait-primary']);
50 });
51
52 assert_equals(screen.orientation.type, 'portrait-primary');
53 assert_throws(new TypeError(), function() {
54 screen.orientation.lock(['portrait-primary', 'landscape-primary']);
55 });
56
57 assert_equals(screen.orientation.type, 'portrait-primary');
58 assert_throws(new TypeError(), function() {
59 screen.orientation.lock();
60 });
61 });
62
63 // Finish asynchronously to give events a chance to fire.
64 setTimeout(test.step_func(function() {
65 assert_equals(screen.orientation.type, 'portrait-primary');
66 screen.orientation.unlock();
67 test.done();
68 }));
69
70 </script>
71 </body>
72 </html>
73
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698