| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include <utility> | 6 #include <utility> |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 } | 126 } |
| 127 | 127 |
| 128 MOCK_METHOD0(Shutdown, void()); | 128 MOCK_METHOD0(Shutdown, void()); |
| 129 | 129 |
| 130 void ShutdownBaseService() { | 130 void ShutdownBaseService() { |
| 131 HistoryService::Shutdown(); | 131 HistoryService::Shutdown(); |
| 132 } | 132 } |
| 133 | 133 |
| 134 void set_task_runner( | 134 void set_task_runner( |
| 135 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { | 135 scoped_refptr<base::SingleThreadTaskRunner> task_runner) { |
| 136 DCHECK(task_runner); | 136 DCHECK(task_runner.get()); |
| 137 task_runner_ = task_runner; | 137 task_runner_ = task_runner; |
| 138 } | 138 } |
| 139 | 139 |
| 140 void set_backend(scoped_refptr<history::HistoryBackend> backend) { | 140 void set_backend(scoped_refptr<history::HistoryBackend> backend) { |
| 141 backend_ = backend; | 141 backend_ = backend; |
| 142 } | 142 } |
| 143 | 143 |
| 144 private: | 144 private: |
| 145 virtual ~HistoryServiceMock() {} | 145 virtual ~HistoryServiceMock() {} |
| 146 | 146 |
| 147 void RunTaskOnDBThread(history::HistoryDBTask* task) { | 147 void RunTaskOnDBThread(history::HistoryDBTask* task) { |
| 148 EXPECT_TRUE(task->RunOnDBThread(backend_, NULL)); | 148 EXPECT_TRUE(task->RunOnDBThread(backend_.get(), NULL)); |
| 149 } | 149 } |
| 150 | 150 |
| 151 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; | 151 scoped_refptr<base::SingleThreadTaskRunner> task_runner_; |
| 152 scoped_refptr<history::HistoryBackend> backend_; | 152 scoped_refptr<history::HistoryBackend> backend_; |
| 153 }; | 153 }; |
| 154 | 154 |
| 155 KeyedService* BuildFakeProfileInvalidationProvider( | 155 KeyedService* BuildFakeProfileInvalidationProvider( |
| 156 content::BrowserContext* context) { | 156 content::BrowserContext* context) { |
| 157 return new invalidation::ProfileInvalidationProvider( | 157 return new invalidation::ProfileInvalidationProvider( |
| 158 scoped_ptr<invalidation::InvalidationService>( | 158 scoped_ptr<invalidation::InvalidationService>( |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1138 notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, | 1138 notifier->Notify(chrome::NOTIFICATION_HISTORY_URLS_MODIFIED, |
| 1139 content::Source<Profile>(profile_), | 1139 content::Source<Profile>(profile_), |
| 1140 content::Details<history::URLsModifiedDetails>(&details)); | 1140 content::Details<history::URLsModifiedDetails>(&details)); |
| 1141 | 1141 |
| 1142 history::URLRows new_sync_entries; | 1142 history::URLRows new_sync_entries; |
| 1143 GetTypedUrlsFromSyncDB(&new_sync_entries); | 1143 GetTypedUrlsFromSyncDB(&new_sync_entries); |
| 1144 | 1144 |
| 1145 // The change should be ignored. | 1145 // The change should be ignored. |
| 1146 ASSERT_EQ(0U, new_sync_entries.size()); | 1146 ASSERT_EQ(0U, new_sync_entries.size()); |
| 1147 } | 1147 } |
| OLD | NEW |