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

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

Issue 19822007: Updated Google Now to Check the Geolocation Access Preference (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@r213016
Patch Set: CR Feedback Created 7 years, 5 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/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
index b4d2bccb9b0268e2cfa24261dfd71cf900340a0a..35d5b207b31f925eb0de84a68f1a0f7d668a3199 100644
--- a/chrome/browser/resources/google_now/background_test_util.js
+++ b/chrome/browser/resources/google_now/background_test_util.js
@@ -6,18 +6,28 @@
function emptyMock() {}
function buildTaskManager() {
- return {instrumentApiFunction: emptyMock};
+ return {
+ debugSetStepName: emptyMock,
vadimt 2013/07/26 01:00:37 This one is not called while the page loads, corre
robliao 2013/07/26 01:12:17 True, but we're getting rid of this. Once we do, w
+ instrumentApiFunction: emptyMock,
+ };
}
var instrumentApiFunction = emptyMock;
var buildAttemptManager = emptyMock;
var emptyListener = {addListener: emptyMock};
-chrome['location'] = {onLocationUpdate: emptyListener};
+chrome['location'] = {
+ onLocationUpdate: emptyListener,
+};
chrome['notifications'] = {
onButtonClicked: emptyListener,
onClicked: emptyListener,
onClosed: emptyListener
};
chrome['omnibox'] = {onInputEntered: emptyListener};
+chrome['preferencesPrivate'] = {
+ googleGeolocationAccessEnabled: {
+ onChange: emptyListener
+ }
+};
chrome['runtime'] = {
onInstalled: emptyListener,
onStartup: emptyListener
@@ -40,6 +50,11 @@ function invokeCallback(savedArgs, callbackParameter, var_args) {
var callbackArguments = Array.prototype.slice.call(arguments, 2);
return callFunction(function() {
savedArgs.arguments[callbackParameter].apply(null, callbackArguments);
+
+ // Mock4JS does not clear the saved args after invocation.
+ // To allow reuse of the same SaveMockArguments for multiple
+ // invocations with similar arguments, clear them here.
+ savedArgs.arguments.splice(0, savedArgs.arguments.length);
});
}

Powered by Google App Engine
This is Rietveld 408576698