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

Unified Diff: chrome/test/data/extensions/platform_apps/restore_state/test.js

Issue 14031021: Save and restore State for ShellWindows, including panels (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 7 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/platform_apps/restore_state/test.js
diff --git a/chrome/test/data/extensions/platform_apps/restore_state/test.js b/chrome/test/data/extensions/platform_apps/restore_state/test.js
new file mode 100644
index 0000000000000000000000000000000000000000..d7497bed7f5eb348d4a6b193b20908c4e0b66158
--- /dev/null
+++ b/chrome/test/data/extensions/platform_apps/restore_state/test.js
@@ -0,0 +1,46 @@
+// Copyright (c) 2012 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.
+
+var assertState = function(win) {
+ if (win.id == 'normal') {
+ chrome.test.assertFalse(win.isMinimized());
+ chrome.test.assertFalse(win.isMaximized());
+ }
+ if (win.id == 'maximized') {
+ chrome.test.assertFalse(win.isMinimized());
+ chrome.test.assertTrue(win.isMaximized());
+ }
+}
+
+var testRestoreState = function(state_type) {
+ chrome.app.window.create(
+ 'empty.html',
+ { id: state_type, state: state_type },
+ chrome.test.callbackPass(windowCreated)
+ );
+ function windowCreated(win) {
+ assertState(win);
+ win.onClosed.addListener(chrome.test.callbackPass(windowClosed));
+ win.close();
+ function windowClosed() {
+ chrome.app.window.create(
+ 'empty.html',
+ { id: state_type },
+ function(win2) { assertState(win2); }
+ );
+ }
+ };
+}
+
+chrome.app.runtime.onLaunched.addListener(function() {
+ chrome.test.runTests([
+ function testRestoreNormal() {
+ testRestoreState('normal');
+ },
+ function testRestoreMaximized() {
+ testRestoreState('maximized');
+ },
+ // Minimize and fullscreen behavior are platform dependent.
+ ]);
+});
« no previous file with comments | « chrome/test/data/extensions/platform_apps/restore_state/manifest.json ('k') | ui/aura/client/aura_constants.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698