Chromium Code Reviews| 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 // System indicator test for Chrome. | |
| 6 // browser_tests.exe --gtest_filter=ExtensionApiTest.SystemIndicator | |
| 7 | |
| 8 chrome.test.runTests([ | |
|
Pete Williamson
2012/11/13 18:01:41
can you take the verification in these tests a bit
dewittj
2012/11/14 00:25:07
Once I have some c++ code in there, I intend to ad
| |
| 9 function showAndHideNonexistentIcon() { | |
| 10 // Hide before show, just in case | |
| 11 chrome.experimental.systemIndicator.hide(); | |
| 12 chrome.experimental.systemIndicator.show(); | |
| 13 chrome.experimental.systemIndicator.hide(); | |
| 14 chrome.test.succeed(); | |
| 15 }, | |
| 16 function setUrl() { | |
| 17 // Success in showing the icon? | |
| 18 chrome.experimental.systemIndicator.setURL('128.png'); | |
| 19 chrome.test.succeed(); | |
| 20 }, | |
| 21 function setImageData() { | |
| 22 // create a canvas, then set the icon using it. | |
| 23 var canvas = document.createElement('canvas'); | |
| 24 canvas.width = 20; | |
| 25 canvas.height = 20; | |
| 26 | |
| 27 var canvas_context = canvas.getContext('2d'); | |
| 28 canvas_context.clearRect(0, 0, 20, 20); | |
| 29 canvas_context.fillStyle = '#00FF00'; | |
| 30 canvas_context.fillRect(5, 5, 15, 15); | |
| 31 var imageData = canvas_context.getImageData(0, 0, 20, 20); | |
| 32 chrome.experimental.systemIndicator.setImageData(imageData); | |
| 33 chrome.test.succeed(); | |
| 34 } | |
| 35 ]); | |
| OLD | NEW |