Index: trunk/src/chrome/browser/profiles/profile_loader_unittest.cc |
=================================================================== |
--- trunk/src/chrome/browser/profiles/profile_loader_unittest.cc (revision 219785) |
+++ trunk/src/chrome/browser/profiles/profile_loader_unittest.cc (working copy) |
@@ -12,19 +12,10 @@ |
#include "chrome/browser/lifetime/application_lifetime.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/browser/profiles/profile_loader.h" |
-#include "chrome/test/base/testing_browser_process.h" |
#include "chrome/test/base/testing_profile.h" |
-#include "chrome/test/base/testing_profile_manager.h" |
-#include "content/public/test/test_browser_thread_bundle.h" |
#include "testing/gmock/include/gmock/gmock.h" |
#include "testing/gtest/include/gtest/gtest.h" |
-#include "ui/message_center/message_center.h" |
-#if defined(OS_CHROMEOS) |
-#include "base/command_line.h" |
-#include "chrome/common/chrome_switches.h" |
-#endif // defined(OS_CHROMEOS) |
- |
namespace { |
using ::testing::_; |
@@ -78,30 +69,8 @@ |
MockCallback::MockCallback() {} |
MockCallback::~MockCallback() {} |
-class ProfileLoaderTest : public testing::Test { |
- protected: |
- static void SetUpTestCase() { |
-#if defined(OS_CHROMEOS) |
- // Needed to handle http://crbug.com/119175. |
- CommandLine::ForCurrentProcess()->AppendSwitch( |
- switches::kDisableZeroBrowsersOpenForTests); |
-#endif // defined(OS_CHROMEOS) |
- message_center::MessageCenter::Initialize(); |
- } |
- |
- static void TearDownTestCase() { |
- message_center::MessageCenter::Shutdown(); |
- } |
- |
- private: |
- content::TestBrowserThreadBundle thread_bundle_; |
-}; |
- |
-TEST_F(ProfileLoaderTest, LoadProfileInvalidatingOtherLoads) { |
- TestingProfileManager profile_manager(TestingBrowserProcess::GetGlobal()); |
- ASSERT_TRUE(profile_manager.SetUp()); |
- TestingProfile* profile = |
- profile_manager.CreateTestingProfile("TestProfile"); |
+TEST(ProfileLoaderTest, LoadProfileInvalidatingOtherLoads) { |
+ TestingProfile profile; |
base::FilePath fake_profile_path_1 = |
base::FilePath::FromUTF8Unsafe("fake/profile 1"); |
base::FilePath fake_profile_path_2 = |
@@ -121,7 +90,7 @@ |
// path_2 loads after the first request. |
EXPECT_CALL(loader, GetProfileByPath(fake_profile_path_2)) |
.WillOnce(Return(static_cast<Profile*>(NULL))) |
- .WillRepeatedly(Return(profile)); |
+ .WillRepeatedly(Return(&profile)); |
EXPECT_CALL(loader, |
CreateProfileAsync(fake_profile_path_2, _, _, _, std::string())) |
.WillRepeatedly(WithArgs<0, 1>( |
@@ -133,7 +102,7 @@ |
// path_2_load is called both times. |
StrictMock<MockCallback>* path_1_load = new StrictMock<MockCallback>(); |
StrictMock<MockCallback>* path_2_load = new StrictMock<MockCallback>(); |
- EXPECT_CALL(*path_2_load, Run(profile)) |
+ EXPECT_CALL(*path_2_load, Run(&profile)) |
.Times(2); |
// Try to load path_1. |
@@ -146,9 +115,9 @@ |
fake_profile_path_2, base::Bind(&MockCallback::Run, path_2_load)); |
// Finish the load request for path_1, then for path_2. |
- loader.RunCreateCallback(fake_profile_path_1, profile, |
+ loader.RunCreateCallback(fake_profile_path_1, &profile, |
Profile::CREATE_STATUS_INITIALIZED); |
- loader.RunCreateCallback(fake_profile_path_2, profile, |
+ loader.RunCreateCallback(fake_profile_path_2, &profile, |
Profile::CREATE_STATUS_INITIALIZED); |
EXPECT_FALSE(loader.IsAnyProfileLoading()); |