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

Unified Diff: chrome/browser/geolocation/geolocation_permission_context_unittest.cc

Issue 852593002: Allow overriding GoogleLocationSettingsHelper for tests. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments Created 5 years, 11 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 | « chrome/browser/geolocation/geolocation_permission_context_android.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/geolocation/geolocation_permission_context_unittest.cc
diff --git a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
index 282a808928adc7823d816b2a8a4ac551b22c6589..03bb2ca1dbe11e445d46a29f7f58b15779b01cca 100644
--- a/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
+++ b/chrome/browser/geolocation/geolocation_permission_context_unittest.cc
@@ -40,6 +40,7 @@
#if defined(OS_ANDROID)
#include "base/prefs/pref_service.h"
#include "chrome/browser/android/mock_google_location_settings_helper.h"
+#include "chrome/browser/geolocation/geolocation_permission_context_android.h"
#endif
#if defined(ENABLE_EXTENSIONS)
@@ -245,11 +246,16 @@ void GeolocationPermissionContextTests::SetUp() {
#endif
InfoBarService::CreateForWebContents(web_contents());
TabSpecificContentSettings::CreateForWebContents(web_contents());
+ geolocation_permission_context_ =
+ GeolocationPermissionContextFactory::GetForProfile(profile());
#if defined(OS_ANDROID)
+ scoped_ptr<GoogleLocationSettingsHelper> helper(
+ new MockGoogleLocationSettingsHelper());
+ static_cast<GeolocationPermissionContextAndroid*>(
+ geolocation_permission_context_)->
+ SetGoogleLocationSettingsHelperForTesting(helper.Pass());
MockGoogleLocationSettingsHelper::SetLocationStatus(true, true);
#endif
- geolocation_permission_context_ =
- GeolocationPermissionContextFactory::GetForProfile(profile());
}
void GeolocationPermissionContextTests::TearDown() {
« no previous file with comments | « chrome/browser/geolocation/geolocation_permission_context_android.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698