Index: chrome/browser/profiles/profile_manager_browsertest.cc |
diff --git a/chrome/browser/profiles/profile_manager_browsertest.cc b/chrome/browser/profiles/profile_manager_browsertest.cc |
index 3953fa215aae9614fae37f8ceb7925d4bf16af0b..50bff3202fe4dffff4f0d02a793b74c9b0e6faff 100644 |
--- a/chrome/browser/profiles/profile_manager_browsertest.cc |
+++ b/chrome/browser/profiles/profile_manager_browsertest.cc |
@@ -8,6 +8,18 @@ |
#include "chrome/test/base/testing_browser_process.h" |
#include "chrome/test/base/ui_test_utils.h" |
+namespace { |
+ |
+// An observer that returns back to test code after a new profile is |
+// initialized. |
+void OnUnblockOnProfileCreation(Profile* profile, |
+ Profile::CreateStatus status) { |
+ if (status == Profile::CREATE_STATUS_INITIALIZED) |
+ MessageLoop::current()->Quit(); |
+} |
+ |
+} // namespace |
+ |
// This file contains tests for the ProfileManager that require a heavyweight |
// InProcessBrowserTest. These include tests involving profile deletion. |
@@ -15,17 +27,6 @@ |
// platforms. |
#if defined(OS_MACOSX) |
class ProfileManagerBrowserTest : public InProcessBrowserTest { |
- protected: |
- // An observer that returns back to test code after a new profile |
- // is initialized. |
- class BlockOnProfileInitObserver : public ProfileManagerObserver { |
- public: |
- void OnProfileCreated(Profile* profile, Status status) { |
- if (status == ProfileManagerObserver::STATUS_INITIALIZED) { |
- MessageLoop::current()->Quit(); |
- } |
- } |
- }; |
}; |
// Delete single profile and make sure a new one is created. |
@@ -69,12 +70,12 @@ IN_PROC_BROWSER_TEST_F(ProfileManagerBrowserTest, MAYBE_DeleteAllProfiles) { |
ProfileInfoCache& cache = profile_manager->GetProfileInfoCache(); |
// Create an additional profile. |
- BlockOnProfileInitObserver observer; |
FilePath new_path = profile_manager->GenerateNextProfileDirectoryPath(); |
- profile_manager->CreateProfileAsync(new_path, &observer); |
+ profile_manager->CreateProfileAsync(new_path, |
+ base::Bind(&OnUnblockOnProfileCreation)); |
// Spin to allow profile creation to take place, loop is terminated |
- // by BlockOnProfileInitObserver when the profile is created. |
+ // by OnUnblockOnProfileCreation when the profile is created. |
ui_test_utils::RunMessageLoop(); |
ASSERT_EQ(cache.GetNumberOfProfiles(), 2U); |