OLD | NEW |
(Empty) | |
| 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. |
| 4 |
| 5 chrome.test.runTests([ |
| 6 function setIconAndShow() { |
| 7 var canvas = document.createElement('canvas'); |
| 8 canvas.width = 20; |
| 9 canvas.height = 20; |
| 10 |
| 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 })); |
| 22 } |
| 23 ]); |
OLD | NEW |