Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / test / data / extensions / api_test / system_indicator / basics / test.js
blob1e65442a74c601b52b2a420e263fb56ace3fb008
1 // Copyright (c) 2010 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 chrome.test.runTests([
6 function setIconAndShow() {
7 var canvas = document.createElement('canvas');
8 canvas.width = 20;
9 canvas.height = 20;
11 var canvas_context = canvas.getContext('2d');
12 canvas_context.clearRect(0, 0, 20, 20);
13 canvas_context.fillStyle = '#00FF00';
14 canvas_context.fillRect(5, 5, 15, 15);
15 var data = canvas_context.getImageData(0, 0, 19, 19);
16 chrome.systemIndicator.setIcon(
17 { imageData: data },
18 chrome.test.callbackPass(function() {
19 chrome.systemIndicator.enable();
20 chrome.systemIndicator.disable();
21 }));
23 ]);