Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/system_indicator/test.js |
| diff --git a/chrome/test/data/extensions/api_test/system_indicator/test.js b/chrome/test/data/extensions/api_test/system_indicator/test.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..cc6ea6218bfee53c48cb6598ad5be371233357ed |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/api_test/system_indicator/test.js |
| @@ -0,0 +1,35 @@ |
| +// Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +// System indicator test for Chrome. |
| +// browser_tests.exe --gtest_filter=ExtensionApiTest.SystemIndicator |
| + |
| +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
|
| + function showAndHideNonexistentIcon() { |
| + // Hide before show, just in case |
| + chrome.experimental.systemIndicator.hide(); |
| + chrome.experimental.systemIndicator.show(); |
| + chrome.experimental.systemIndicator.hide(); |
| + chrome.test.succeed(); |
| + }, |
| + function setUrl() { |
| + // Success in showing the icon? |
| + chrome.experimental.systemIndicator.setURL('128.png'); |
| + chrome.test.succeed(); |
| + }, |
| + function setImageData() { |
| + // create a canvas, then set the icon using it. |
| + var canvas = document.createElement('canvas'); |
| + canvas.width = 20; |
| + canvas.height = 20; |
| + |
| + var canvas_context = canvas.getContext('2d'); |
| + canvas_context.clearRect(0, 0, 20, 20); |
| + canvas_context.fillStyle = '#00FF00'; |
| + canvas_context.fillRect(5, 5, 15, 15); |
| + var imageData = canvas_context.getImageData(0, 0, 20, 20); |
| + chrome.experimental.systemIndicator.setImageData(imageData); |
| + chrome.test.succeed(); |
| + } |
| +]); |