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

Side by Side Diff: third_party/WebKit/LayoutTests/imported/web-platform-tests/screen-orientation/lock-basic.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 previousOrientation = screen.orientation;
9
10 test(function() {
11 screen.orientation.unlock();
12 }, "Test that screen.orientation.unlock() doesn't throw when there is no lock");
13
14 async_test(function(t) {
15 var orientations = ['any', 'portrait', 'landscape', 'portrait-secondary',
16 'landscape-primary', 'landscape-secondary', 'portrait-pr imary'];
17
18 setOrientation = function(idx) {
19 if( idx == orientations.length) {
20 screen.orientation.unlock();
21 t.done();
22 return;
23 }
24 (function(i) {
25 screen.orientation.lock(orientations[i]).then(function() {
26 setOrientation(i+1);
27 },function() {});
28 })(idx);
29 };
30
31 setOrientation(0);
32
33 }, "Test that screen.orientation.lock returns a pending promise.");
34
35 test(function() {
36 assert_equals(screen.orientation, previousOrientation);
37 }, "Test that screen.orientation.lock() is actually async");
38
39 </script>
40 </body>
41 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698