| Index: chrome/test/data/extensions/platform_apps/app_icon/test.js
|
| diff --git a/chrome/test/data/extensions/platform_apps/app_icon/test.js b/chrome/test/data/extensions/platform_apps/app_icon/test.js
|
| index 3b3887a44de97bd77798c27b9a0e74fd15b31709..bebd82e090c99d44dd3b61508588d1daa147ae9a 100644
|
| --- a/chrome/test/data/extensions/platform_apps/app_icon/test.js
|
| +++ b/chrome/test/data/extensions/platform_apps/app_icon/test.js
|
| @@ -2,29 +2,54 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -chrome.app.runtime.onLaunched.addListener(function() {
|
| - chrome.test.sendMessage("Launched");
|
| - // Create a panel window first
|
| - chrome.app.window.create(
|
| - 'main.html', { type: "panel" },
|
| - function (win) {
|
| - // Set the panel window icon
|
| - win.setIcon("icon64.png")
|
| +var panelWindow;
|
| +var nonShelfWindow;
|
| +var shelfWindow;
|
| +
|
| +function processNextCommand() {
|
| + chrome.test.sendMessage('ready', function(response) {
|
| + if (response == 'Exit') {
|
| + return;
|
| + }
|
| + if (response == 'createPanelWindow') {
|
| + chrome.app.window.create('main.html', { type: 'panel' }, function (win) {
|
| + panelWindow = win;
|
| + });
|
| + }
|
| + if (response == 'setPanelWindowIcon') {
|
| + panelWindow.setIcon('icon64.png')
|
| + }
|
| + if (response == 'createNonShelfWindow') {
|
| // Create the shell window; it should use the app icon, and not affect
|
| // the panel icon.
|
| chrome.app.window.create(
|
| - 'main.html', { type: "shell" },
|
| + 'main.html', { id: 'win',
|
| + type: 'shell' },
|
| + function (win) {
|
| + nonShelfWindow = win;
|
| + });
|
| + }
|
| + if (response == 'createShelfWindow') {
|
| + // Create the shell window which is shown in shelf; it should use
|
| + // another custom app icon.
|
| + chrome.app.window.create(
|
| + 'main.html', { id: 'win_with_icon',
|
| + type: 'shell',
|
| + showInShelf: true },
|
| function (win) {
|
| - // Create the shell window which is shown in shelf; it should use
|
| - // another custom app icon.
|
| - chrome.app.window.create(
|
| - 'main.html', { id: "win_with_icon",
|
| - type: "shell",
|
| - icon: "icon48.png",
|
| - showInShelf: true },
|
| - function (win) {
|
| - chrome.test.sendMessage("Completed");
|
| - });
|
| + shelfWindow = win;
|
| });
|
| - });
|
| + }
|
| + if (response == 'setShelfWindowIcon') {
|
| + shelfWindow.setIcon('icon32.png')
|
| + }
|
| + processNextCommand();
|
| + });
|
| +};
|
| +
|
| +
|
| +chrome.app.runtime.onLaunched.addListener(function() {
|
| + chrome.test.sendMessage('Launched');
|
| + processNextCommand();
|
| });
|
| +
|
|
|