Chromium Code Reviews| Index: chrome/test/data/extensions/api_test/system_indicator/basics/test.js |
| diff --git a/chrome/test/data/extensions/api_test/system_indicator/basics/test.js b/chrome/test/data/extensions/api_test/system_indicator/basics/test.js |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e1031e6b7efc7d12a90d15fb6fbed5130cabb354 |
| --- /dev/null |
| +++ b/chrome/test/data/extensions/api_test/system_indicator/basics/test.js |
| @@ -0,0 +1,39 @@ |
| +// 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 |
|
not at google - send to devlin
2012/11/26 19:44:54
Do other tests have this? It seems unnecessary to
dewittj
2012/11/27 01:53:55
The test I first modeled this test after did have
|
| + |
| +var callback = function() { |
|
not at google - send to devlin
2012/11/26 19:44:54
unused?
dewittj
2012/11/27 01:53:55
Removed, replaced by callbackPass.
|
| + if (chrome.runtime.lastError) { |
| + console.log('Error detected:' + chrome.runtime.lastError); |
| + chrome.test.fail(); |
| + } else { |
| + chrome.test.succeed(); |
| + } |
| +}; |
| + |
| +// TODO(dewittj) Add binary files before adding setUrl tests. |
| +chrome.test.runTests([ |
| + function setIconAndShow() { |
| + 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 data = canvas_context.getImageData(0, 0, 19, 19); |
| + chrome.systemIndicator.setIcon({ imageData: data }, function () { |
|
not at google - send to devlin
2012/11/26 19:44:54
use callbackPass here (see chrome/renderer/resourc
dewittj
2012/11/27 01:53:55
Done.
|
| + if (chrome.runtime.lastError) { |
| + console.log('Error detected:' + chrome.runtime.lastError); |
| + chrome.test.fail(); |
| + } |
| + chrome.systemIndicator.enable(); |
| + chrome.systemIndicator.disable(); |
| + chrome.test.succeed(); |
| + }) |
| + } |
| +]); |