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

Unified Diff: chrome/browser/resources/google_now/unit_test/background_globals.js

Issue 17125003: First unit test for Google Now extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 months 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/browser/resources/google_now/unit_test/background_globals.js
diff --git a/chrome/browser/resources/google_now/unit_test/background_globals.js b/chrome/browser/resources/google_now/unit_test/background_globals.js
new file mode 100644
index 0000000000000000000000000000000000000000..a8fe423e63a79cdaa4e7823fa59c7a25931de189
--- /dev/null
+++ b/chrome/browser/resources/google_now/unit_test/background_globals.js
@@ -0,0 +1,23 @@
+// Copyright (c) 2013 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.
+
+// Mocks for globals needed for loading background.js.
+
+function EMPTY() {}
+function buildTaskManager() { return {instrumentApiFunction: EMPTY}; }
+var instrumentApiFunction = EMPTY;
+var buildAttemptManager = EMPTY;
+var EMPTY_LISTENER = {addListener: EMPTY};
+chrome['location'] = {onLocationUpdate: EMPTY_LISTENER};
+chrome['notifications'] = {
+ onButtonClicked: EMPTY_LISTENER,
+ onClicked: EMPTY_LISTENER,
+ onClosed: EMPTY_LISTENER
+};
+chrome['omnibox'] = {onInputEntered: EMPTY_LISTENER};
+chrome['runtime'] = {
+ onInstalled: EMPTY_LISTENER,
+ onStartup: EMPTY_LISTENER
+};
+storage = {};

Powered by Google App Engine
This is Rietveld 408576698