| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 5 #include <vector> |
| 6 | 6 |
| 7 #include "testing/gtest/include/gtest/gtest.h" | 7 #include "testing/gtest/include/gtest/gtest.h" |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "base/string16.h" | 10 #include "base/string16.h" |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 151 history_thread_.Stop(); | 151 history_thread_.Stop(); |
| 152 profile_.ResetRequestContext(); | 152 profile_.ResetRequestContext(); |
| 153 MessageLoop::current()->RunAllPending(); | 153 MessageLoop::current()->RunAllPending(); |
| 154 } | 154 } |
| 155 | 155 |
| 156 void StartSyncService(Task* task) { | 156 void StartSyncService(Task* task) { |
| 157 if (!service_.get()) { | 157 if (!service_.get()) { |
| 158 service_.reset( | 158 service_.reset( |
| 159 new TestProfileSyncService(&factory_, &profile_, "test", false, | 159 new TestProfileSyncService(&factory_, &profile_, "test", false, |
| 160 task)); | 160 task)); |
| 161 EXPECT_CALL(profile_, GetProfileSyncService()).WillRepeatedly( |
| 162 Return(service_.get())); |
| 161 TypedUrlDataTypeController* data_type_controller = | 163 TypedUrlDataTypeController* data_type_controller = |
| 162 new TypedUrlDataTypeController(&factory_, | 164 new TypedUrlDataTypeController(&factory_, |
| 163 &profile_, | 165 &profile_); |
| 164 service_.get()); | |
| 165 | 166 |
| 166 EXPECT_CALL(factory_, CreateTypedUrlSyncComponents(_, _, _)). | 167 EXPECT_CALL(factory_, CreateTypedUrlSyncComponents(_, _, _)). |
| 167 WillOnce(MakeTypedUrlSyncComponents(service_.get(), | 168 WillOnce(MakeTypedUrlSyncComponents(service_.get(), |
| 168 history_backend_.get(), | 169 history_backend_.get(), |
| 169 data_type_controller)); | 170 data_type_controller)); |
| 170 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). | 171 EXPECT_CALL(factory_, CreateDataTypeManager(_, _)). |
| 171 WillOnce(ReturnNewDataTypeManager()); | 172 WillOnce(ReturnNewDataTypeManager()); |
| 172 | 173 |
| 173 EXPECT_CALL(profile_, GetHistoryServiceWithoutCreating()). | 174 EXPECT_CALL(profile_, GetHistoryServiceWithoutCreating()). |
| 174 WillRepeatedly(Return(history_service_.get())); | 175 WillRepeatedly(Return(history_service_.get())); |
| (...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 531 history::URLsDeletedDetails changes; | 532 history::URLsDeletedDetails changes; |
| 532 changes.all_history = true; | 533 changes.all_history = true; |
| 533 scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); | 534 scoped_refptr<ThreadNotifier> notifier(new ThreadNotifier(&history_thread_)); |
| 534 notifier->Notify(NotificationType::HISTORY_URLS_DELETED, | 535 notifier->Notify(NotificationType::HISTORY_URLS_DELETED, |
| 535 Details<history::URLsDeletedDetails>(&changes)); | 536 Details<history::URLsDeletedDetails>(&changes)); |
| 536 | 537 |
| 537 std::vector<history::URLRow> new_sync_entries; | 538 std::vector<history::URLRow> new_sync_entries; |
| 538 GetTypedUrlsFromSyncDB(&new_sync_entries); | 539 GetTypedUrlsFromSyncDB(&new_sync_entries); |
| 539 ASSERT_EQ(0U, new_sync_entries.size()); | 540 ASSERT_EQ(0U, new_sync_entries.size()); |
| 540 } | 541 } |
| OLD | NEW |