Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / screen_orientation / lockOrientation-basic.html
blob5ae52de880e70be3c49c2a3109045ccd997e9a0c
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script src="../resources/testharness.js"></script>
5 <script src="../resources/testharnessreport.js"></script>
6 <script>
8 var previousOrientation = screen.orientation;
10 test(function() {
11 var caught = false;
12 try {
13 screen.orientation.unlock();
14 } catch (e) {
15 caught = true;
18 assert_false(caught);
19 }, "Test that screen.orientation.unlock() doesn't throw when there is no lock");
21 test(function() {
22 [ 'any', 'portrait', 'landscape', 'portrait-primary', 'portrait-secondary',
23 'landscape-primary', 'landscape-secondary' ].forEach(function(orientation) {
24 var pending = true;
25 screen.orientation.lock(orientation).then(function() {
26 pending = false;
27 }, function() {
28 pending = false;
29 });
31 assert_true(pending);
32 });
33 }, "Test that screen.orientation.lock returns a pending promise.");
35 test(function() {
36 assert_equals(screen.orientation, previousOrientation);
37 }, "Test that screen.orientation.lock() is actually async");
39 test(function() {
40 var caught = false;
41 try {
42 screen.orientation.unlock();
43 } catch (e) {
44 caught = true;
47 assert_false(caught);
48 }, "Test that screen.unlock() doesn't throw when there is a lock");
50 </script>
51 </body>
52 </html>