| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |