Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Unified Diff: chrome/test/data/extensions/api_test/fullscreen/mq_display_mode/window.js

Issue 1070423003: Set display mode for extensions::AppWindow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@display_mode
Patch Set: Added a reference to bug. Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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]);
+}

Powered by Google App Engine
This is Rietveld 408576698