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

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

Issue 22647003: Remove chrome.* Function Instrumentation Inlining and Use a Separate Instrumented Object (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@SMLog
Patch Set: Quick Spacing Fix Created 7 years, 4 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
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() {} 7 function emptyMock() {}
8 8
9 function buildTaskManager() { 9 function buildTaskManager() {
10 return { 10 return {
11 debugSetStepName: emptyMock, 11 debugSetStepName: emptyMock,
12 instrumentApiFunction: emptyMock, 12 instrumentChromeApiFunction: emptyMock,
13 }; 13 };
14 } 14 }
15 15
16 function buildAuthenticationManager() { 16 function buildAuthenticationManager() {
17 return { 17 return {
18 addListener: emptyMock 18 addListener: emptyMock
19 }; 19 };
20 } 20 }
21 21
22 var instrumentApiFunction = emptyMock; 22 var instrumentApiFunction = emptyMock;
23 var buildAttemptManager = emptyMock; 23 var buildAttemptManager = emptyMock;
24 var buildCardSet = emptyMock; 24 var buildCardSet = emptyMock;
25 var emptyListener = {addListener: emptyMock}; 25 var emptyListener = {addListener: emptyMock};
26 chrome['location'] = {onLocationUpdate: emptyListener}; 26 var instrumented = {};
27 chrome['notifications'] = { 27 instrumented['location'] = {onLocationUpdate: emptyListener};
28 instrumented['notifications'] = {
28 onButtonClicked: emptyListener, 29 onButtonClicked: emptyListener,
29 onClicked: emptyListener, 30 onClicked: emptyListener,
30 onClosed: emptyListener 31 onClosed: emptyListener
31 }; 32 };
32 chrome['omnibox'] = {onInputEntered: emptyListener}; 33 instrumented['omnibox'] = {onInputEntered: emptyListener};
33 chrome['preferencesPrivate'] = { 34 instrumented['preferencesPrivate'] = {
34 googleGeolocationAccessEnabled: { 35 googleGeolocationAccessEnabled: {
35 onChange: emptyListener 36 onChange: emptyListener
36 } 37 }
37 }; 38 };
38 chrome['runtime'] = { 39 instrumented['runtime'] = {
39 onInstalled: emptyListener, 40 onInstalled: emptyListener,
40 onStartup: emptyListener 41 onStartup: emptyListener
41 }; 42 };
42 43
43 var storage = {};
OLDNEW
« no previous file with comments | « chrome/browser/resources/google_now/background.js ('k') | chrome/browser/resources/google_now/background_unittest.gtestjs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698