Roll src/third_party/WebKit d9c6159:8139f33 (svn 201974:201975)
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / fullscreen / mq_display_mode / window.js
blob99e5bb544392d2c3534b3c9a5b8d03ba0bb1cf48
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'");
9 chrome.test.succeed();
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'");
17 window.onresize = checkWindowRestored;
18 chrome.app.window.current().restore();
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();
29 chrome.test.runTests([checkDisplayModeMediaFeature]);