| Index: chrome/test/data/extensions/api_test/browser_action/no_icon/background.js
|
| diff --git a/chrome/test/data/extensions/api_test/browser_action/no_icon/background.js b/chrome/test/data/extensions/api_test/browser_action/no_icon/background.js
|
| index 41609111d986ab0064f455e89ca4a3bef1313d06..a05368b4d699273756e6e3b201f767b492e9e9b0 100644
|
| --- a/chrome/test/data/extensions/api_test/browser_action/no_icon/background.js
|
| +++ b/chrome/test/data/extensions/api_test/browser_action/no_icon/background.js
|
| @@ -2,9 +2,30 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| +var canvas = document.getElementById("canvas").getContext('2d').
|
| + getImageData(0, 0, 19, 19);
|
| +var canvasHD = document.getElementById("canvas").getContext('2d').
|
| + getImageData(0, 0, 38, 38);
|
| +
|
| +var setIconParamQueue = [
|
| + // First value just to setup test to a valid state where some action icon is
|
| + // set.
|
| + {path: 'icon.png'},
|
| + {imageData: canvas},
|
| + {path: 'icon.png'},
|
| + {imageDataSet: {'19': canvas, '38': canvasHD}},
|
| + {pathSet: {'19': 'icon.png', '38': 'icon.png'}},
|
| + {pathSet: {'19': 'icon.png', '38': 'icon.png'}},
|
| +];
|
| +
|
| // Called when the user clicks on the browser action.
|
| chrome.browserAction.onClicked.addListener(function(windowId) {
|
| - chrome.tabs.executeScript(null, {code:"document.body.bgColor='red'"});
|
| + if (setIconParamQueue.length == 0) {
|
| + chrome.test.notifyFail("Queue of params for test cases unexpectedly empty");
|
| + return;
|
| + }
|
| + chrome.browserAction.setIcon(setIconParamQueue.shift(), function() {
|
| + chrome.test.notifyPass();});
|
| });
|
|
|
| chrome.test.notifyPass();
|
|
|