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

Side by Side Diff: chrome/browser/importer/profile_writer_unittest.cc

Issue 242693003: Introduce BookmarkClient interface to abstract embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressing reviewer comments Created 6 years, 8 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 unified diff | Download patch
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/importer/profile_writer.h" 5 #include "chrome/browser/importer/profile_writer.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 137
138 // Add bookmarks via ProfileWriter to profile1 when profile2 also exists. 138 // Add bookmarks via ProfileWriter to profile1 when profile2 also exists.
139 TEST_F(ProfileWriterTest, CheckBookmarksWithMultiProfile) { 139 TEST_F(ProfileWriterTest, CheckBookmarksWithMultiProfile) {
140 TestingProfile profile2; 140 TestingProfile profile2;
141 profile2.CreateBookmarkModel(true); 141 profile2.CreateBookmarkModel(true);
142 142
143 BookmarkModel* bookmark_model2 = 143 BookmarkModel* bookmark_model2 =
144 BookmarkModelFactory::GetForProfile(&profile2); 144 BookmarkModelFactory::GetForProfile(&profile2);
145 test::WaitForBookmarkModelToLoad(bookmark_model2); 145 test::WaitForBookmarkModelToLoad(bookmark_model2);
146 bookmark_utils::AddIfNotBookmarked(bookmark_model2, 146 bookmark_utils::AddIfNotBookmarked(bookmark_model2,
147 bookmark_model2,
147 GURL("http://www.bing.com"), 148 GURL("http://www.bing.com"),
148 base::ASCIIToUTF16("Bing")); 149 base::ASCIIToUTF16("Bing"));
149 TestingProfile profile1; 150 TestingProfile profile1;
150 profile1.CreateBookmarkModel(true); 151 profile1.CreateBookmarkModel(true);
151 152
152 CreateImportedBookmarksEntries(); 153 CreateImportedBookmarksEntries();
153 BookmarkModel* bookmark_model1 = 154 BookmarkModel* bookmark_model1 =
154 BookmarkModelFactory::GetForProfile(&profile1); 155 BookmarkModelFactory::GetForProfile(&profile1);
155 test::WaitForBookmarkModelToLoad(bookmark_model1); 156 test::WaitForBookmarkModelToLoad(bookmark_model1);
156 157
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 new TestProfileWriter(&profile)); 206 new TestProfileWriter(&profile));
206 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); 207 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED);
207 VerifyHistoryCount(&profile); 208 VerifyHistoryCount(&profile);
208 size_t original_history_count = history_count_; 209 size_t original_history_count = history_count_;
209 history_count_ = 0; 210 history_count_ = 0;
210 211
211 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); 212 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED);
212 VerifyHistoryCount(&profile); 213 VerifyHistoryCount(&profile);
213 EXPECT_EQ(original_history_count, history_count_); 214 EXPECT_EQ(original_history_count, history_count_);
214 } 215 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698