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

Unified Diff: chrome/browser/safe_browsing/incident_reporting_service_unittest.cc

Issue 442043002: ProfileManager doesn't depend on "--login-profile" switch. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More tests fixed. Created 6 years, 4 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
Index: chrome/browser/safe_browsing/incident_reporting_service_unittest.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting_service_unittest.cc b/chrome/browser/safe_browsing/incident_reporting_service_unittest.cc
index 903002a05bcdf43d75e7589dd1e99ab2d980d353..22f72cd4f396cc5336efb428d713f31d7c0966a0 100644
--- a/chrome/browser/safe_browsing/incident_reporting_service_unittest.cc
+++ b/chrome/browser/safe_browsing/incident_reporting_service_unittest.cc
@@ -362,21 +362,13 @@ class IncidentReportingServiceTest : public testing::Test {
OnProfileAdditionAction on_addition_action;
};
- // Returns the name of a profile as provided to CreateProfile.
- static std::string GetProfileName(Profile* profile) {
- // Cannot reliably use profile->GetProfileName() since the test needs the
- // name before the profile manager sets it (which happens after profile
- // addition).
- return profile->GetPath().BaseName().AsUTF8Unsafe();
- }
-
// Posts a task to delete the profile.
void DelayedDeleteProfile(Profile* profile) {
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::Bind(&TestingProfileManager::DeleteTestingProfile,
base::Unretained(&profile_manager_),
- GetProfileName(profile)));
+ profile->GetProfileName()));
}
// A callback run by the test fixture when a profile is added. An incident
@@ -385,7 +377,7 @@ class IncidentReportingServiceTest : public testing::Test {
// The instance must have already been created.
ASSERT_TRUE(instance_);
// Add a test incident to the service if requested.
- switch (profile_properties_[GetProfileName(profile)].on_addition_action) {
+ switch (profile_properties_[profile->GetProfileName()].on_addition_action) {
case ON_PROFILE_ADDITION_ADD_INCIDENT:
AddTestIncident(profile);
break;
@@ -396,7 +388,7 @@ class IncidentReportingServiceTest : public testing::Test {
default:
ASSERT_EQ(
ON_PROFILE_ADDITION_NO_ACTION,
- profile_properties_[GetProfileName(profile)].on_addition_action);
+ profile_properties_[profile->GetProfileName()].on_addition_action);
break;
}
}

Powered by Google App Engine
This is Rietveld 408576698