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

Unified Diff: trunk/src/chrome/browser/profiles/profile_loader_unittest.cc

Issue 23551005: Revert 219709 "Remove the Extensions URLRequestContext." (Closed) Base URL: svn://svn.chromium.org/chrome/
Patch Set: Created 7 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: 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());
« no previous file with comments | « trunk/src/chrome/browser/profiles/profile_io_data.cc ('k') | trunk/src/chrome/browser/safe_browsing/safe_browsing_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698