| Index: chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| diff --git a/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc b/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| index a74026eba5ce0d6d8f16bbc0c53479b6cbf791e2..d46864eb03f2dcab61b1ba563770ff6e490573f2 100644
|
| --- a/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| +++ b/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| @@ -10,6 +10,7 @@
|
| #include "base/callback.h"
|
| #include "base/memory/ptr_util.h"
|
| #include "base/test/scoped_feature_list.h"
|
| +#include "chrome/browser/android/mock_location_settings.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
| #include "chrome/common/chrome_features.h"
|
| #include "chrome/common/pref_names.h"
|
| @@ -76,6 +77,12 @@ class SearchGeolocationServiceTest : public testing::Test {
|
| auto test_delegate = base::MakeUnique<TestSearchEngineDelegate>();
|
| test_delegate_ = test_delegate.get();
|
| GetService()->SetSearchEngineDelegateForTest(std::move(test_delegate));
|
| +
|
| + auto mock_settings = base::MakeUnique<MockLocationSettings>();
|
| + mock_settings->SetLocationStatus(
|
| + true /* has_android_location_permission */,
|
| + true /* is_system_location_setting_enabled */);
|
| + GetService()->SetLocationSettingsForTest(std::move(mock_settings));
|
| }
|
|
|
| void TearDown() override {
|
| @@ -148,7 +155,8 @@ TEST_F(SearchGeolocationServiceTest, Initialization) {
|
| EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL)));
|
| EXPECT_FALSE(GetService()->GetDSEGeolocationSetting());
|
|
|
| - // Nothing happens if the pref is already set when the service is initialized.
|
| + // Nothing happens if the pref is already set when the service is
|
| + // initialized.
|
| SetContentSetting(kGoogleURL, CONTENT_SETTING_ASK);
|
| ReinitializeService(false /* clear_pref */);
|
| EXPECT_TRUE(GetService()->UseDSEGeolocationSetting(ToOrigin(kGoogleURL)));
|
|
|