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'");
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
]);