Index: chrome/test/data/extensions/platform_apps/geometry/test.js |
diff --git a/chrome/test/data/extensions/platform_apps/geometry/test.js b/chrome/test/data/extensions/platform_apps/geometry/test.js |
index 17a188015b95a86505d62fceb1a03ab4be7da948..f7359f1a3b8477067895a3e3d6d1c3bcfb38c9b4 100644 |
--- a/chrome/test/data/extensions/platform_apps/geometry/test.js |
+++ b/chrome/test/data/extensions/platform_apps/geometry/test.js |
@@ -24,7 +24,10 @@ var testRestoreSize = function(id, frameType) { |
win.setBounds(newBounds); |
function boundsChanged() { |
assertBoundsEqual(newBounds, win.getBounds()); |
+ win.onClosed.addListener(callbackPass(windowClosed)); |
win.close(); |
+ } |
+ function windowClosed() { |
chrome.app.window.create('empty.html', |
{ id: id, |
left: 113, top: 117, width: 314, height: 271, |
@@ -35,6 +38,37 @@ var testRestoreSize = function(id, frameType) { |
})); |
} |
+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 }, |
+ callbackPass(windowCreated) |
+ ); |
+ function windowCreated(win) { |
+ assertState(win); |
+ win.onClosed.addListener(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 testFramelessRestoreSize() { |
@@ -43,5 +77,12 @@ chrome.app.runtime.onLaunched.addListener(function() { |
function testFramedRestoreSize() { |
testRestoreSize('framed', 'chrome'); |
}, |
+ function testRestoreNormal() { |
+ testRestoreState('normal'); |
+ }, |
+ function testRestoreMaximized() { |
+ testRestoreState('maximized'); |
+ }, |
+ // Minimize and fullscreen behavior are platform dependent. |
]); |
}); |