Commit a1e66183 authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update OffTheRecord profile test in SearchPermissionsService.

Profile API is being updated (issue 1033903) and the usage of
GetOffTheRecordProfile and HasOffTheRecordProfile without argument is
getting deprecated.

The use of the function in SearchPermissionsServiceTest is updated and
a new test is added for non-primary off-the-record profiles.

Bug: 1060940
Change-Id: I39d1451c386d93fb47cbf2576d3b4280e634cb34
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213563
Commit-Queue: Balazs Engedy <engedy@chromium.org>
Reviewed-by: default avatarBalazs Engedy <engedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771479}
parent 4ac39264
...@@ -247,9 +247,19 @@ TEST_F(SearchPermissionsServiceTest, InitializationInconsistent) { ...@@ -247,9 +247,19 @@ TEST_F(SearchPermissionsServiceTest, InitializationInconsistent) {
GetContentSetting(kGoogleAusURL, ContentSettingsType::NOTIFICATIONS)); GetContentSetting(kGoogleAusURL, ContentSettingsType::NOTIFICATIONS));
} }
TEST_F(SearchPermissionsServiceTest, OffTheRecord) { TEST_F(SearchPermissionsServiceTest, Incognito) {
// Service isn't constructed for an OTR profile. // Service isn't constructed for Incognito profile.
Profile* otr_profile = profile()->GetOffTheRecordProfile(); Profile* incognito_profile = profile()->GetPrimaryOTRProfile();
SearchPermissionsService* service =
SearchPermissionsService::Factory::GetForBrowserContext(
incognito_profile);
EXPECT_EQ(nullptr, service);
}
TEST_F(SearchPermissionsServiceTest, NonPrimaryOffTheRecord) {
// Service isn't constructed for non-primary OTR profiles.
Profile* otr_profile = profile()->GetOffTheRecordProfile(
Profile::OTRProfileID("Test::SearchPermissions"));
SearchPermissionsService* service = SearchPermissionsService* service =
SearchPermissionsService::Factory::GetForBrowserContext(otr_profile); SearchPermissionsService::Factory::GetForBrowserContext(otr_profile);
EXPECT_EQ(nullptr, service); EXPECT_EQ(nullptr, service);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment