OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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 "components/offline_pages/core/prefetch/test_prefetch_dispatcher.h" | 5 #include "components/offline_pages/core/prefetch/test_prefetch_dispatcher.h" |
6 | 6 |
7 #include "base/memory/ptr_util.h" | 7 #include "base/memory/ptr_util.h" |
8 #include "components/offline_pages/core/offline_page_item.h" | 8 #include "components/offline_pages/core/offline_page_item.h" |
9 | 9 |
10 namespace offline_pages { | 10 namespace offline_pages { |
11 | 11 |
12 TestPrefetchDispatcher::TestPrefetchDispatcher() = default; | 12 TestPrefetchDispatcher::TestPrefetchDispatcher() = default; |
13 TestPrefetchDispatcher::~TestPrefetchDispatcher() = default; | 13 TestPrefetchDispatcher::~TestPrefetchDispatcher() = default; |
14 | 14 |
15 void TestPrefetchDispatcher::AddCandidatePrefetchURLs( | 15 void TestPrefetchDispatcher::AddCandidatePrefetchURLs( |
16 const std::vector<PrefetchURL>& suggested_urls) { | 16 const std::string& name_space, |
17 latest_prefetch_urls = suggested_urls; | 17 const std::vector<PrefetchURL>& prefetch_urls) { |
| 18 latest_name_space = name_space; |
| 19 latest_prefetch_urls = prefetch_urls; |
18 new_suggestions_count++; | 20 new_suggestions_count++; |
19 } | 21 } |
20 | 22 |
21 void TestPrefetchDispatcher::RemoveAllUnprocessedPrefetchURLs( | 23 void TestPrefetchDispatcher::RemoveAllUnprocessedPrefetchURLs( |
22 const std::string& name_space) { | 24 const std::string& name_space) { |
23 latest_prefetch_urls.clear(); | 25 latest_prefetch_urls.clear(); |
24 remove_all_suggestions_count++; | 26 remove_all_suggestions_count++; |
25 } | 27 } |
26 | 28 |
27 void TestPrefetchDispatcher::RemovePrefetchURLsByClientId( | 29 void TestPrefetchDispatcher::RemovePrefetchURLsByClientId( |
28 const ClientId& client_id) { | 30 const ClientId& client_id) { |
29 remove_by_client_id_count++; | 31 remove_by_client_id_count++; |
30 last_removed_client_id = base::MakeUnique<ClientId>(client_id); | 32 last_removed_client_id = base::MakeUnique<ClientId>(client_id); |
31 } | 33 } |
32 | 34 |
33 void TestPrefetchDispatcher::BeginBackgroundTask( | 35 void TestPrefetchDispatcher::BeginBackgroundTask( |
34 std::unique_ptr<ScopedBackgroundTask> task) {} | 36 std::unique_ptr<ScopedBackgroundTask> task) {} |
35 | 37 |
36 void TestPrefetchDispatcher::StopBackgroundTask() {} | 38 void TestPrefetchDispatcher::StopBackgroundTask() {} |
37 | 39 |
38 void TestPrefetchDispatcher::SetService(PrefetchService* service) {} | 40 void TestPrefetchDispatcher::SetService(PrefetchService* service) {} |
39 | 41 |
40 void TestPrefetchDispatcher::GCMOperationCompletedMessageReceived( | 42 void TestPrefetchDispatcher::GCMOperationCompletedMessageReceived( |
41 const std::string& operation_name) { | 43 const std::string& operation_name) { |
42 operation_list.push_back(operation_name); | 44 operation_list.push_back(operation_name); |
43 } | 45 } |
44 | 46 |
45 void TestPrefetchDispatcher::RequestFinishBackgroundTaskForTest() {} | 47 void TestPrefetchDispatcher::RequestFinishBackgroundTaskForTest() {} |
46 } // namespace offline_pages | 48 } // namespace offline_pages |
OLD | NEW |