| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/ntp_snippets/offline_pages/offline_pages_test_utils.h" | 5 #include "components/ntp_snippets/offline_pages/offline_pages_test_utils.h" |
| 6 | 6 |
| 7 #include <iterator> | 7 #include <iterator> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/guid.h" | 10 #include "base/guid.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 } | 52 } |
| 53 | 53 |
| 54 bool FakeOfflinePageModel::is_loaded() const { | 54 bool FakeOfflinePageModel::is_loaded() const { |
| 55 return is_loaded_; | 55 return is_loaded_; |
| 56 } | 56 } |
| 57 | 57 |
| 58 void FakeOfflinePageModel::set_is_loaded(bool value) { | 58 void FakeOfflinePageModel::set_is_loaded(bool value) { |
| 59 is_loaded_ = value; | 59 is_loaded_ = value; |
| 60 } | 60 } |
| 61 | 61 |
| 62 OfflinePageItem CreateDummyOfflinePageItem( |
| 63 int id, |
| 64 const offline_pages::ClientId& client_id) { |
| 65 std::string id_string = base::IntToString(id); |
| 66 return OfflinePageItem( |
| 67 GURL("http://dummy.com/" + id_string), id, client_id, |
| 68 base::FilePath::FromUTF8Unsafe("some/folder/test" + id_string + ".mhtml"), |
| 69 0, base::Time::Now()); |
| 70 } |
| 71 |
| 62 OfflinePageItem CreateDummyOfflinePageItem(int id, | 72 OfflinePageItem CreateDummyOfflinePageItem(int id, |
| 63 const std::string& name_space) { | 73 const std::string& name_space) { |
| 64 std::string id_string = base::IntToString(id); | 74 return CreateDummyOfflinePageItem(id, |
| 65 return OfflinePageItem( | 75 ClientId(name_space, base::GenerateGUID())); |
| 66 GURL("http://dummy.com/" + id_string), id, | |
| 67 ClientId(name_space, base::GenerateGUID()), | |
| 68 base::FilePath::FromUTF8Unsafe("some/folder/test" + id_string + ".mhtml"), | |
| 69 0, base::Time::Now()); | |
| 70 } | 76 } |
| 71 | 77 |
| 72 void CaptureDismissedSuggestions( | 78 void CaptureDismissedSuggestions( |
| 73 std::vector<ContentSuggestion>* captured_suggestions, | 79 std::vector<ContentSuggestion>* captured_suggestions, |
| 74 std::vector<ContentSuggestion> dismissed_suggestions) { | 80 std::vector<ContentSuggestion> dismissed_suggestions) { |
| 75 std::move(dismissed_suggestions.begin(), dismissed_suggestions.end(), | 81 std::move(dismissed_suggestions.begin(), dismissed_suggestions.end(), |
| 76 std::back_inserter(*captured_suggestions)); | 82 std::back_inserter(*captured_suggestions)); |
| 77 } | 83 } |
| 78 | 84 |
| 79 } // namespace test | 85 } // namespace test |
| 80 } // namespace ntp_snippets | 86 } // namespace ntp_snippets |
| OLD | NEW |