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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/message_loop/message_loop.h" | 7 #include "base/message_loop/message_loop.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/bookmarks/bookmark_model.h" | 9 #include "chrome/browser/bookmarks/bookmark_model.h" |
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
187 | 187 |
188 profile_writer->AddBookmarks(bookmarks_, | 188 profile_writer->AddBookmarks(bookmarks_, |
189 ASCIIToUTF16("Imported from Firefox")); | 189 ASCIIToUTF16("Imported from Firefox")); |
190 // Verify that duplicate bookmarks exist. | 190 // Verify that duplicate bookmarks exist. |
191 VerifyBookmarksCount(bookmarks_record, bookmark_model, 2); | 191 VerifyBookmarksCount(bookmarks_record, bookmark_model, 2); |
192 } | 192 } |
193 | 193 |
194 // Verify that history entires are not duplicated when added twice. | 194 // Verify that history entires are not duplicated when added twice. |
195 TEST_F(ProfileWriterTest, CheckHistoryAfterWritingDataTwice) { | 195 TEST_F(ProfileWriterTest, CheckHistoryAfterWritingDataTwice) { |
196 TestingProfile profile; | 196 TestingProfile profile; |
197 ASSERT_TRUE(profile.CreateHistoryService(true, false)); | 197 profile.CreateHistoryService(true, false); |
198 profile.BlockUntilHistoryProcessesPendingRequests(); | 198 profile.BlockUntilHistoryProcessesPendingRequests(); |
199 | 199 |
200 CreateHistoryPageEntries(); | 200 CreateHistoryPageEntries(); |
201 scoped_refptr<TestProfileWriter> profile_writer( | 201 scoped_refptr<TestProfileWriter> profile_writer( |
202 new TestProfileWriter(&profile)); | 202 new TestProfileWriter(&profile)); |
203 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 203 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
204 VerifyHistoryCount(&profile); | 204 VerifyHistoryCount(&profile); |
205 size_t original_history_count = history_count_; | 205 size_t original_history_count = history_count_; |
206 history_count_ = 0; | 206 history_count_ = 0; |
207 | 207 |
208 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); | 208 profile_writer->AddHistoryPage(pages_, history::SOURCE_FIREFOX_IMPORTED); |
209 VerifyHistoryCount(&profile); | 209 VerifyHistoryCount(&profile); |
210 EXPECT_EQ(original_history_count, history_count_); | 210 EXPECT_EQ(original_history_count, history_count_); |
211 } | 211 } |
OLD | NEW |