1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 var canvas
= document
.getElementById("canvas").getContext('2d').
6 getImageData(0, 0, 19, 19);
7 var canvasHD
= document
.getElementById("canvas").getContext('2d').
8 getImageData(0, 0, 38, 38);
10 var setIconParamQueue
= [
13 {imageData
: {'19': canvas
, '38': canvasHD
}},
14 {path
: {'19': 'icon.png', '38': 'icon.png'}},
15 {imageData
: {'19': canvas
}},
16 {path
: {'19': 'icon.png'}},
17 {imageData
: {'38': canvasHD
}},
22 // Called when the user clicks on the browser action.
23 chrome
.browserAction
.onClicked
.addListener(function(windowId
) {
24 if (setIconParamQueue
.length
== 0) {
25 chrome
.test
.notifyFail("Queue of params for test cases unexpectedly empty");
30 chrome
.browserAction
.setIcon(setIconParamQueue
.shift(), function() {
31 chrome
.test
.notifyPass();});
33 console
.log(error
.message
);
34 chrome
.test
.notifyFail(error
.message
);
38 chrome
.test
.notifyPass();