| 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 1458315d9a2d189055568942a5fcdceece3d0a7f..f1a2005bfb057e942e21b1ca40609a62f2c1a0be 100644
|
| --- a/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| +++ b/chrome/browser/android/search_geolocation/search_geolocation_service_unittest.cc
|
| @@ -13,6 +13,8 @@
|
| #include "base/test/scoped_feature_list.h"
|
| #include "chrome/browser/android/search_geolocation/search_geolocation_disclosure_tab_helper.h"
|
| #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
|
| +#include "chrome/browser/permissions/permission_decision_auto_blocker.h"
|
| +#include "chrome/browser/permissions/permission_result.h"
|
| #include "chrome/common/chrome_features.h"
|
| #include "chrome/common/pref_names.h"
|
| #include "chrome/test/base/testing_profile.h"
|
| @@ -374,3 +376,29 @@ TEST_F(SearchGeolocationServiceTest, DSEChangesAndDisclosure) {
|
| EXPECT_TRUE(SearchGeolocationDisclosureTabHelper::IsDisclosureResetForTests(
|
| profile()));
|
| }
|
| +
|
| +TEST_F(SearchGeolocationServiceTest, Embargo) {
|
| + test_delegate()->SetDSEOrigin(kGoogleURL);
|
| +
|
| + // Place another origin under embargo.
|
| + GURL google_aus_url(kGoogleAusURL);
|
| + PermissionDecisionAutoBlocker* auto_blocker =
|
| + PermissionDecisionAutoBlocker::GetForProfile(profile());
|
| + auto_blocker->RecordDismissAndEmbargo(google_aus_url,
|
| + CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| + auto_blocker->RecordDismissAndEmbargo(google_aus_url,
|
| + CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| + auto_blocker->RecordDismissAndEmbargo(google_aus_url,
|
| + CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| + PermissionResult result = auto_blocker->GetEmbargoResult(
|
| + GURL(kGoogleAusURL), CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| + EXPECT_EQ(result.source, PermissionStatusSource::MULTIPLE_DISMISSALS);
|
| + EXPECT_EQ(result.content_setting, CONTENT_SETTING_BLOCK);
|
| +
|
| + // Now change the DSE to this origin and make sure the embargo is cleared.
|
| + test_delegate()->SetDSEOrigin(kGoogleAusURL);
|
| + result = auto_blocker->GetEmbargoResult(GURL(kGoogleAusURL),
|
| + CONTENT_SETTINGS_TYPE_GEOLOCATION);
|
| + EXPECT_EQ(result.source, PermissionStatusSource::UNSPECIFIED);
|
| + EXPECT_EQ(result.content_setting, CONTENT_SETTING_ASK);
|
| +}
|
|
|