Skip to content
Snippets Groups Projects
Commit 27c89837 authored by nick@chromium.org's avatar nick@chromium.org
Browse files

Fix second-profile dir so that it's a sibling of the first; eliminate a FromWStringHack.

TEST=sync_integration_tests fail less.
BUG=42642

Review URL: http://codereview.chromium.org/1803001

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@45839 0039d316-1c4b-4281-b951-d872f2087c98
parent 57cacdcb
No related merge requests found
......@@ -29,7 +29,8 @@ void BookmarkModelVerifier::ExpectBookmarkInfoMatch(
}
BookmarkModelVerifier::BookmarkModelVerifier() {
verifier_profile_.reset(LiveSyncTest::MakeProfile(L"verifier"));
verifier_profile_.reset(LiveSyncTest::MakeProfile(
FILE_PATH_LITERAL("verifier")));
verifier_ = verifier_profile_->GetBookmarkModel();
}
......
......@@ -80,11 +80,11 @@ const BookmarkNode* LiveSyncTest::GetByUniqueURL(BookmarkModel* m,
}
// static
Profile* LiveSyncTest::MakeProfile(const std::wstring& name) {
Profile* LiveSyncTest::MakeProfile(const FilePath::CharType* name) {
FilePath path;
PathService::Get(chrome::DIR_USER_DATA, &path);
path.Append(FilePath::FromWStringHack(name));
return ProfileManager::CreateProfile(path);
return ProfileManager::CreateProfile(path.Append(name));
}
void LiveSyncTest::SetUpInProcessBrowserTestFixture() {
......
......@@ -58,7 +58,7 @@ class LiveSyncTest : public InProcessBrowserTest {
static const BookmarkNode* GetByUniqueURL(BookmarkModel* m, const GURL& url);
// Helper to ProfileManager::CreateProfile that handles path creation.
static Profile* MakeProfile(const std::wstring& name);
static Profile* MakeProfile(const FilePath::CharType* name);
// Utility to block (by running the current MessageLoop) until the model has
// loaded. Note this is required instead of using m->BlockTillLoaded, as that
......
......@@ -42,7 +42,8 @@ class SingleClientLivePreferencesSyncTest : public LiveSyncTest {
IN_PROC_BROWSER_TEST_F(SingleClientLivePreferencesSyncTest, Sanity) {
SetupSync();
PrefService* expected = LiveSyncTest::MakeProfile(L"verifier")->GetPrefs();
PrefService* expected = LiveSyncTest::MakeProfile(
FILE_PATH_LITERAL("verifier"))->GetPrefs();
expected->SetBoolean(prefs::kHomePageIsNewTabPage, true);
prefs()->SetBoolean(prefs::kHomePageIsNewTabPage, true);
......
......@@ -36,7 +36,7 @@ class TwoClientLiveBookmarksSyncTest : public LiveSyncTest {
}
virtual ~TwoClientLiveBookmarksSyncTest() {}
bool SetupSync() {
profile2_.reset(MakeProfile(L"client2"));
profile2_.reset(MakeProfile(FILE_PATH_LITERAL("client2")));
client1_.reset(new ProfileSyncServiceTestHarness(
browser()->profile(), username_, password_));
client2_.reset(new ProfileSyncServiceTestHarness(
......@@ -2361,7 +2361,7 @@ IN_PROC_BROWSER_TEST_F(LiveSyncTestBasicHierarchy50BMBothClients,
// Test Scribe ID - 373508.
IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
MC_SimpleMergeOfDifferentBMModels) {
set_profile2(MakeProfile(L"client2"));
set_profile2(MakeProfile(FILE_PATH_LITERAL("client2")));
BookmarkModel* model_one = browser()->profile()->GetBookmarkModel();
BookmarkModel* model_two = profile2()->GetBookmarkModel();
LiveSyncTest::BlockUntilLoaded(model_two);
......@@ -2430,7 +2430,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
// Test Scribe ID - 386586.
IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
MC_MergeSimpleBMHierarchyUnderBMBar) {
set_profile2(MakeProfile(L"client2"));
set_profile2(MakeProfile(FILE_PATH_LITERAL("client2")));
BookmarkModel* model_one = browser()->profile()->GetBookmarkModel();
BookmarkModel* model_two = profile2()->GetBookmarkModel();
LiveSyncTest::BlockUntilLoaded(model_two);
......@@ -2487,7 +2487,7 @@ IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
// Test Scribe ID - 386589.
IN_PROC_BROWSER_TEST_F(TwoClientLiveBookmarksSyncTest,
MC_MergeSimpleBMHierarchyEqualSetsUnderBMBar) {
set_profile2(MakeProfile(L"client2"));
set_profile2(MakeProfile(FILE_PATH_LITERAL("client2")));
BookmarkModel* model_one = browser()->profile()->GetBookmarkModel();
BookmarkModel* model_two = profile2()->GetBookmarkModel();
LiveSyncTest::BlockUntilLoaded(model_two);
......
......@@ -24,7 +24,7 @@ class TwoClientLivePreferencesSyncTest : public LiveSyncTest {
void SetupSync() {
client1_.reset(new ProfileSyncServiceTestHarness(
browser()->profile(), username_, password_));
profile2_.reset(MakeProfile(L"client2"));
profile2_.reset(MakeProfile(FILE_PATH_LITERAL("client2")));
client2_.reset(new ProfileSyncServiceTestHarness(
profile2_.get(), username_, password_));
EXPECT_TRUE(client1_->SetupSync());
......@@ -58,7 +58,8 @@ IN_PROC_BROWSER_TEST_F(TwoClientLivePreferencesSyncTest, Sanity) {
EXPECT_EQ(false, prefs1()->GetBoolean(prefs::kHomePageIsNewTabPage));
EXPECT_EQ(false, prefs2()->GetBoolean(prefs::kHomePageIsNewTabPage));
PrefService* expected = LiveSyncTest::MakeProfile(L"verifier")->GetPrefs();
PrefService* expected = LiveSyncTest::MakeProfile(
FILE_PATH_LITERAL("verifier"))->GetPrefs();
expected->SetBoolean(prefs::kHomePageIsNewTabPage, true);
prefs1()->SetBoolean(prefs::kHomePageIsNewTabPage, true);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment