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

Unified Diff: chrome/browser/resources/google_now/background_test_util.js

Issue 17125003: First unit test for Google Now extension (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modifying .isolate dependencies 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
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/google_now/background_test_util.js
diff --git a/chrome/browser/resources/google_now/background_test_util.js b/chrome/browser/resources/google_now/background_test_util.js
new file mode 100644
index 0000000000000000000000000000000000000000..e431e8f592ddaf5f1f3e79babd8c3e2227381b60
--- /dev/null
+++ b/chrome/browser/resources/google_now/background_test_util.js
@@ -0,0 +1,25 @@
+// 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 emptyMock() {}
+function buildTaskManager() {
+ return {instrumentApiFunction: emptyMock};
+}
+var instrumentApiFunction = emptyMock;
+var buildAttemptManager = emptyMock;
+var emptyListener = {addListener: emptyMock};
+chrome['location'] = {onLocationUpdate: emptyListener};
+chrome['notifications'] = {
+ onButtonClicked: emptyListener,
+ onClicked: emptyListener,
+ onClosed: emptyListener
+};
+chrome['omnibox'] = {onInputEntered: emptyListener};
+chrome['runtime'] = {
+ onInstalled: emptyListener,
+ onStartup: emptyListener
+};
+var storage = {};
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698