Commit 1d8fb9db authored by Ramin Halavati's avatar Ramin Halavati Committed by Commit Bot

Update OffTheRecord profile API in profile tests.

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 c/b/profiles tests is updated.

Bug: 1060940
Change-Id: I168e48fac82eec6dc968a15818412c5eceaeb352
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2213564Reviewed-by: default avatarMihai Sardarescu <msarda@chromium.org>
Commit-Queue: Ramin Halavati <rhalavati@chromium.org>
Cr-Commit-Position: refs/heads/master@{#771515}
parent 283791cc
...@@ -332,7 +332,7 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, ...@@ -332,7 +332,7 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest,
Profile* parent_profile = browser()->profile(); Profile* parent_profile = browser()->profile();
Profile* child_profile = Profile* child_profile =
static_cast<ProfileImpl*>(parent_profile)->GetOffTheRecordProfile(); static_cast<ProfileImpl*>(parent_profile)->GetPrimaryOTRProfile();
HostZoomMap* parent_zoom_map = HostZoomMap* parent_zoom_map =
HostZoomMap::GetDefaultForBrowserContext(parent_profile); HostZoomMap::GetDefaultForBrowserContext(parent_profile);
ASSERT_TRUE(parent_zoom_map); ASSERT_TRUE(parent_zoom_map);
...@@ -377,7 +377,7 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest, ...@@ -377,7 +377,7 @@ IN_PROC_BROWSER_TEST_F(HostZoomMapBrowserTest,
ParentDefaultZoomPropagatesToIncognitoChild) { ParentDefaultZoomPropagatesToIncognitoChild) {
Profile* parent_profile = browser()->profile(); Profile* parent_profile = browser()->profile();
Profile* child_profile = Profile* child_profile =
static_cast<ProfileImpl*>(parent_profile)->GetOffTheRecordProfile(); static_cast<ProfileImpl*>(parent_profile)->GetPrimaryOTRProfile();
double new_default_zoom_level = double new_default_zoom_level =
parent_profile->GetZoomLevelPrefs()->GetDefaultZoomLevelPref() + 1.f; parent_profile->GetZoomLevelPrefs()->GetDefaultZoomLevelPref() + 1.f;
......
...@@ -65,7 +65,7 @@ class ProfileActivityMetricsRecorderTest : public testing::Test { ...@@ -65,7 +65,7 @@ class ProfileActivityMetricsRecorderTest : public testing::Test {
} }
void ActivateIncognitoBrowser(Profile* profile) { void ActivateIncognitoBrowser(Profile* profile) {
ActivateBrowser(profile->GetOffTheRecordProfile()); ActivateBrowser(profile->GetPrimaryOTRProfile());
} }
void SimulateUserEvent() { void SimulateUserEvent() {
......
...@@ -665,12 +665,12 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) { ...@@ -665,12 +665,12 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) {
chrome::NOTIFICATION_PROFILE_CREATED, chrome::NOTIFICATION_PROFILE_CREATED,
content::NotificationService::AllSources()); content::NotificationService::AllSources());
otr_profile = profile->GetOffTheRecordProfile(); otr_profile = profile->GetPrimaryOTRProfile();
profile_created_observer.Wait(); profile_created_observer.Wait();
EXPECT_EQ(profile_created_observer.source(), EXPECT_EQ(profile_created_observer.source(),
content::Source<Profile>(otr_profile)); content::Source<Profile>(otr_profile));
EXPECT_TRUE(profile->HasOffTheRecordProfile()); EXPECT_TRUE(profile->HasPrimaryOTRProfile());
EXPECT_TRUE(otr_profile->IsOffTheRecord()); EXPECT_TRUE(otr_profile->IsOffTheRecord());
EXPECT_TRUE(otr_profile->IsPrimaryOTRProfile()); EXPECT_TRUE(otr_profile->IsPrimaryOTRProfile());
EXPECT_TRUE(otr_profile->IsIncognitoProfile()); EXPECT_TRUE(otr_profile->IsIncognitoProfile());
...@@ -698,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) { ...@@ -698,7 +698,7 @@ IN_PROC_BROWSER_TEST_F(ProfileBrowserTest, Notifications) {
profile_destroyed_observer.Wait(); profile_destroyed_observer.Wait();
} }
EXPECT_FALSE(profile->HasOffTheRecordProfile()); EXPECT_FALSE(profile->HasPrimaryOTRProfile());
} }
// Destroy the regular profile. // Destroy the regular profile.
......
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