OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 function checkWindowRestored() { |
| 5 var standalone = matchMedia( '(display-mode: standalone)' ); |
| 6 chrome.test.assertTrue(standalone.matches, |
| 7 "Display mode of the restored window is 'standalone'"); |
| 8 |
| 9 chrome.test.succeed(); |
| 10 } |
| 11 |
| 12 function checkWindowFullscreened() { |
| 13 var fullscreen = matchMedia( '(display-mode: fullscreen)' ); |
| 14 chrome.test.assertTrue(fullscreen.matches, |
| 15 "Display mode of the fullscreened window is 'fullscreen'"); |
| 16 |
| 17 window.onresize = checkWindowRestored; |
| 18 chrome.app.window.current().restore(); |
| 19 } |
| 20 |
| 21 window.onload = function() { |
| 22 function checkDisplayModeMediaFeature() { |
| 23 var standalone = matchMedia( '(display-mode: standalone)' ); |
| 24 chrome.test.assertTrue(standalone.matches, |
| 25 "Initially display mode is 'standalone'"); |
| 26 window.onresize = checkWindowFullscreened; |
| 27 chrome.app.window.current().fullscreen(); |
| 28 }; |
| 29 chrome.test.runTests([checkDisplayModeMediaFeature]); |
| 30 } |
OLD | NEW |