Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(842)

Side by Side Diff: chrome/test/data/extensions/api_test/system_indicator/basics/test.js

Issue 11361189: Initial skeleton for System Indicator API (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Clean up extension action arguments, style, smaller tests. Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
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
7
8 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.
9 if (chrome.runtime.lastError) {
10 console.log('Error detected:' + chrome.runtime.lastError);
11 chrome.test.fail();
12 } else {
13 chrome.test.succeed();
14 }
15 };
16
17 // TODO(dewittj) Add binary files before adding setUrl tests.
18 chrome.test.runTests([
19 function setIconAndShow() {
20 var canvas = document.createElement('canvas');
21 canvas.width = 20;
22 canvas.height = 20;
23
24 var canvas_context = canvas.getContext('2d');
25 canvas_context.clearRect(0, 0, 20, 20);
26 canvas_context.fillStyle = '#00FF00';
27 canvas_context.fillRect(5, 5, 15, 15);
28 var data = canvas_context.getImageData(0, 0, 19, 19);
29 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.
30 if (chrome.runtime.lastError) {
31 console.log('Error detected:' + chrome.runtime.lastError);
32 chrome.test.fail();
33 }
34 chrome.systemIndicator.enable();
35 chrome.systemIndicator.disable();
36 chrome.test.succeed();
37 })
38 }
39 ]);
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698