Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(175)

Side by Side Diff: components/download/internal/test/entry_utils.cc

Issue 2870753003: Add a Model to the download component. (Closed)
Patch Set: Renamed test base class Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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
OLDNEW
« no previous file with comments | « components/download/internal/test/entry_utils.h ('k') | components/download/internal/test/mock_model_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698