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

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

Issue 2900783003: Handle app custom icon via aura::Window property. (Closed)
Patch Set: fix mac compile Created 3 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
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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();
});
+
« no previous file with comments | « chrome/test/BUILD.gn ('k') | components/exo/shell_surface.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698