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

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

Issue 11614021: Revert 173612 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: 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 side-by-side diff with in-line comments
Download patch
Index: chrome/test/data/extensions/api_test/developer/test/common.js
===================================================================
--- chrome/test/data/extensions/api_test/developer/test/common.js (revision 173621)
+++ chrome/test/data/extensions/api_test/developer/test/common.js (working copy)
@@ -1,44 +0,0 @@
-// Copyright (c) 2012 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.
-
-var assertEq = chrome.test.assertEq;
-var assertTrue = chrome.test.assertTrue;
-var fail = chrome.test.fail;
-var callback = chrome.test.callback;
-
-function getItemNamed(list, name) {
- for (var i = 0; i < list.length; i++) {
- if (list[i].name == name) {
- return list[i];
- }
- }
- fail("didn't find item with name: " + name);
- return null;
-}
-
-// Verifies that the item's name, enabled, and type properties match |name|,
-// |enabled|, and |type|, and checks against any additional name/value
-// properties from |additional_properties|.
-function checkItem(item, name, enabled, type, additional_properties) {
- assertTrue(item !== null);
- assertEq(name, item.name);
- assertEq(type, item.type);
- assertEq(enabled, item.enabled);
-
- for (var propname in additional_properties) {
- var value = additional_properties[propname];
- if (typeof value === 'string')
- value = value.replace("<ID>", item.id);
- assertTrue(propname in item);
- assertEq(value, item[propname]);
- }
-}
-
-// Gets an extension/app with |name| in |list|, verifies that its enabled
-// and type properties match |enabled| and |type|, and checks against any
-// additional name/value properties from |additional_properties|.
-function checkItemInList(list, name, enabled, type, additional_properties) {
- var item = getItemNamed(list, name);
- checkItem(item, name, enabled, type, additional_properties);
-}

Powered by Google App Engine
This is Rietveld 408576698