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

Side by Side Diff: chrome/test/data/extensions/api_test/developer/test/common.js

Issue 11428116: First few API implementation of AppsDebuggerPrivate. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixing build on windows 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) 2012 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 var assertEq = chrome.test.assertEq;
6 var assertTrue = chrome.test.assertTrue;
7 var fail = chrome.test.fail;
8 var callback = chrome.test.callback;
9
10 function getItemNamed(list, name) {
11 for (var i = 0; i < list.length; i++) {
12 if (list[i].name == name) {
13 return list[i];
14 }
15 }
16 fail("didn't find item with name: " + name);
17 return null;
18 }
19
20 // Verifies that the item's name, enabled, and type properties match |name|,
21 // |enabled|, and |type|, and checks against any additional name/value
22 // properties from |additional_properties|.
23 function checkItem(item, name, enabled, type, additional_properties) {
24 assertTrue(item !== null);
25 assertEq(name, item.name);
26 assertEq(type, item.type);
27 assertEq(enabled, item.enabled);
28
29 for (var propname in additional_properties) {
30 var value = additional_properties[propname];
31 if (typeof value === 'string')
32 value = value.replace("<ID>", item.id);
33 assertTrue(propname in item);
34 assertEq(value, item[propname]);
35 }
36 }
37
38 // Gets an extension/app with |name| in |list|, verifies that its enabled
39 // and type properties match |enabled| and |type|, and checks against any
40 // additional name/value properties from |additional_properties|.
41 function checkItemInList(list, name, enabled, type, additional_properties) {
42 var item = getItemNamed(list, name);
43 checkItem(item, name, enabled, type, additional_properties);
44 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698