| 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
|
| index d7497bed7f5eb348d4a6b193b20908c4e0b66158..9af41092ee8639eff58d035046516602ce8f8131 100644
|
| --- a/chrome/test/data/extensions/platform_apps/restore_state/test.js
|
| +++ b/chrome/test/data/extensions/platform_apps/restore_state/test.js
|
| @@ -2,6 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +callbackPass = chrome.test.callbackPass;
|
| +
|
| var assertState = function(win) {
|
| if (win.id == 'normal') {
|
| chrome.test.assertFalse(win.isMinimized());
|
| @@ -17,20 +19,24 @@ var testRestoreState = function(state_type) {
|
| chrome.app.window.create(
|
| 'empty.html',
|
| { id: state_type, state: state_type },
|
| - chrome.test.callbackPass(windowCreated)
|
| + callbackPass(function(win) {
|
| + win.onWindowFirstShown.addListener(callbackPass(function() {
|
| + assertState(win);
|
| + win.onClosed.addListener(callbackPass(function() {
|
| + chrome.app.window.create(
|
| + 'empty.html',
|
| + { id: state_type },
|
| + callbackPass(function(win2) {
|
| + win2.onWindowFirstShown.addListener(callbackPass(function() {
|
| + assertState(win2);
|
| + }));
|
| + })
|
| + );
|
| + }));
|
| + win.close();
|
| + }));
|
| + })
|
| );
|
| - 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() {
|
|
|