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

Side by Side Diff: chrome/browser/resources/google_now/background_test_util.js

Issue 23477006: Unit tests for utility.js (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing unit test + more arv@ comments Created 7 years, 3 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Mocks for globals needed for loading background.js. 5 // Mocks for globals needed for loading background.js.
6 6
7 function emptyMock() {}
8
9 var wrapper = {instrumentChromeApiFunction: emptyMock}; 7 var wrapper = {instrumentChromeApiFunction: emptyMock};
10 8
11 function buildTaskManager() { 9 function buildTaskManager() {
12 return {debugSetStepName: emptyMock}; 10 return {debugSetStepName: emptyMock};
13 } 11 }
14 12
15 function buildAuthenticationManager() { 13 function buildAuthenticationManager() {
16 return { 14 return {
17 addListener: emptyMock 15 addListener: emptyMock
18 }; 16 };
19 } 17 }
20 18
21 var instrumentApiFunction = emptyMock; 19 var instrumentApiFunction = emptyMock;
22 var buildAttemptManager = emptyMock; 20 var buildAttemptManager = emptyMock;
23 var buildCardSet = emptyMock; 21 var buildCardSet = emptyMock;
24 var emptyListener = {addListener: emptyMock}; 22
25 var instrumented = {}; 23 var instrumented = {};
26 instrumented['location'] = {onLocationUpdate: emptyListener}; 24 mockChromeEvent(instrumented, 'location.onLocationUpdate');
27 instrumented['notifications'] = { 25 mockChromeEvent(instrumented, 'notifications.onButtonClicked');
28 onButtonClicked: emptyListener, 26 mockChromeEvent(instrumented, 'notifications.onClicked');
29 onClicked: emptyListener, 27 mockChromeEvent(instrumented, 'notifications.onClosed');
30 onClosed: emptyListener 28 mockChromeEvent(instrumented, 'omnibox.onInputEntered');
31 }; 29 mockChromeEvent(
32 instrumented['omnibox'] = {onInputEntered: emptyListener}; 30 instrumented, 'preferencesPrivate.googleGeolocationAccessEnabled.onChange');
33 instrumented['preferencesPrivate'] = { 31 mockChromeEvent(instrumented, 'runtime.onInstalled');
34 googleGeolocationAccessEnabled: { 32 mockChromeEvent(instrumented, 'runtime.onStartup');
35 onChange: emptyListener
36 }
37 };
38 instrumented['runtime'] = {
39 onInstalled: emptyListener,
40 onStartup: emptyListener
41 };
OLDNEW
« 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