OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include <algorithm> |
| 6 |
| 7 #include "components/download/internal/test/entry_utils.h" |
| 8 |
| 9 namespace download { |
| 10 namespace test { |
| 11 |
| 12 bool SuperficialEntryCompare(const Entry* const& expected, |
| 13 const Entry* const& actual) { |
| 14 if (expected == nullptr || actual == nullptr) |
| 15 return expected == actual; |
| 16 |
| 17 return expected->client == actual->client && expected->guid == actual->guid && |
| 18 expected->state == actual->state; |
| 19 } |
| 20 |
| 21 bool SuperficialEntryListCompare(const std::vector<Entry*>& expected, |
| 22 const std::vector<Entry*>& actual) { |
| 23 return std::is_permutation(actual.cbegin(), actual.cend(), expected.cbegin(), |
| 24 SuperficialEntryCompare); |
| 25 } |
| 26 |
| 27 Entry BuildEntry(DownloadClient client, const std::string& guid) { |
| 28 Entry entry; |
| 29 entry.client = client; |
| 30 entry.guid = guid; |
| 31 return entry; |
| 32 } |
| 33 |
| 34 } // namespace test |
| 35 } // namespace download |
OLD | NEW |