| 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 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 }; | 135 }; |
| 136 | 136 |
| 137 // Add bookmarks via ProfileWriter to profile1 when profile2 also exists. | 137 // Add bookmarks via ProfileWriter to profile1 when profile2 also exists. |
| 138 TEST_F(ProfileWriterTest, CheckBookmarksWithMultiProfile) { | 138 TEST_F(ProfileWriterTest, CheckBookmarksWithMultiProfile) { |
| 139 TestingProfile profile2; | 139 TestingProfile profile2; |
| 140 profile2.CreateBookmarkModel(true); | 140 profile2.CreateBookmarkModel(true); |
| 141 | 141 |
| 142 BookmarkModel* bookmark_model2 = | 142 BookmarkModel* bookmark_model2 = |
| 143 BookmarkModelFactory::GetForProfile(&profile2); | 143 BookmarkModelFactory::GetForProfile(&profile2); |
| 144 test::WaitForBookmarkModelToLoad(bookmark_model2); | 144 test::WaitForBookmarkModelToLoad(bookmark_model2); |
| 145 bookmark_utils::AddIfNotBookmarked(bookmark_model2, | 145 bookmarks::AddIfNotBookmarked( |
| 146 GURL("http://www.bing.com"), | 146 bookmark_model2, GURL("http://www.bing.com"), base::ASCIIToUTF16("Bing")); |
| 147 base::ASCIIToUTF16("Bing")); | |
| 148 TestingProfile profile1; | 147 TestingProfile profile1; |
| 149 profile1.CreateBookmarkModel(true); | 148 profile1.CreateBookmarkModel(true); |
| 150 | 149 |
| 151 CreateImportedBookmarksEntries(); | 150 CreateImportedBookmarksEntries(); |
| 152 BookmarkModel* bookmark_model1 = | 151 BookmarkModel* bookmark_model1 = |
| 153 BookmarkModelFactory::GetForProfile(&profile1); | 152 BookmarkModelFactory::GetForProfile(&profile1); |
| 154 test::WaitForBookmarkModelToLoad(bookmark_model1); | 153 test::WaitForBookmarkModelToLoad(bookmark_model1); |
| 155 | 154 |
| 156 scoped_refptr<TestProfileWriter> profile_writer( | 155 scoped_refptr<TestProfileWriter> profile_writer( |
| 157 new TestProfileWriter(&profile1)); | 156 new TestProfileWriter(&profile1)); |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 new TestProfileWriter(&profile)); | 203 new TestProfileWriter(&profile)); |
| 205 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 204 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
| 206 VerifyHistoryCount(&profile); | 205 VerifyHistoryCount(&profile); |
| 207 size_t original_history_count = history_count_; | 206 size_t original_history_count = history_count_; |
| 208 history_count_ = 0; | 207 history_count_ = 0; |
| 209 | 208 |
| 210 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 209 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
| 211 VerifyHistoryCount(&profile); | 210 VerifyHistoryCount(&profile); |
| 212 EXPECT_EQ(original_history_count, history_count_); | 211 EXPECT_EQ(original_history_count, history_count_); |
| 213 } | 212 } |
| OLD | NEW |