Index: chrome/test/data/extensions/api_test/fullscreen/mq_display_mode/window.js |
diff --git a/chrome/test/data/extensions/api_test/fullscreen/mq_display_mode/window.js b/chrome/test/data/extensions/api_test/fullscreen/mq_display_mode/window.js |
new file mode 100644 |
index 0000000000000000000000000000000000000000..99e5bb544392d2c3534b3c9a5b8d03ba0bb1cf48 |
--- /dev/null |
+++ b/chrome/test/data/extensions/api_test/fullscreen/mq_display_mode/window.js |
@@ -0,0 +1,30 @@ |
+// Copyright (c) 2015 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+function checkWindowRestored() { |
+ var standalone = matchMedia( '(display-mode: standalone)' ); |
+ chrome.test.assertTrue(standalone.matches, |
+ "Display mode of the restored window is 'standalone'"); |
+ |
+ chrome.test.succeed(); |
+} |
+ |
+function checkWindowFullscreened() { |
+ var fullscreen = matchMedia( '(display-mode: fullscreen)' ); |
+ chrome.test.assertTrue(fullscreen.matches, |
+ "Display mode of the fullscreened window is 'fullscreen'"); |
+ |
+ window.onresize = checkWindowRestored; |
+ chrome.app.window.current().restore(); |
+} |
+ |
+window.onload = function() { |
+ function checkDisplayModeMediaFeature() { |
+ var standalone = matchMedia( '(display-mode: standalone)' ); |
+ chrome.test.assertTrue(standalone.matches, |
+ "Initially display mode is 'standalone'"); |
+ window.onresize = checkWindowFullscreened; |
+ chrome.app.window.current().fullscreen(); |
+ }; |
+ chrome.test.runTests([checkDisplayModeMediaFeature]); |
+} |