| <script src="/resources/testharness.js"></script> |
| <script src="/resources/testharnessreport.js"></script> |
| var previousOrientation = screen.orientation; |
| screen.orientation.unlock(); |
| }, "Test that screen.orientation.unlock() doesn't throw when there is no lock"); |
| var orientations = ['any', 'portrait', 'landscape', 'portrait-secondary', |
| 'landscape-primary', 'landscape-secondary', 'portrait-primary']; |
| setOrientation = function(idx) { |
| if( idx == orientations.length) { |
| screen.orientation.unlock(); |
| screen.orientation.lock(orientations[i]).then(function() { |
| }, "Test that screen.orientation.lock returns a pending promise."); |
| assert_equals(screen.orientation, previousOrientation); |
| }, "Test that screen.orientation.lock() is actually async"); |