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

Side by Side Diff: chrome/browser/browsing_data/browsing_data_remover_mock.h

Issue 2720723002: Extract MockBrowsingDataRemover to separate file to make it possible to use it (Closed)
Patch Set: Created 3 years, 9 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
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/browsing_data/browsing_data_remover_mock.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #ifndef CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_MOCK_H_
msramek 2017/02/27 14:22:41 The file should be called the same way as the clas
dullweber 2017/02/27 16:04:11 Done.
6 #define CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_MOCK_H_
7
8 #include "chrome/browser/browsing_data/browsing_data_remover_impl.h"
9 #include "testing/gtest/include/gtest/gtest.h"
10
11 // A BrowsingDataRemover that only records calls.
12 // TODO(msramek): Once BrowsingDataRemoverImpl moves to content/ (non-public),
13 // it will not be possible to inherit from it here. However, at that time
14 // this functionality will become redundant, as it will no longer be necessary
15 // to call to chrome/ to perform deletion. Remove it then.
16 class MockBrowsingDataRemover : public BrowsingDataRemoverImpl {
msramek 2017/02/27 14:22:41 We should inherit from BrowsingDataRemover (the pu
dullweber 2017/02/27 16:04:11 I changed this class to inherit from the interface
17 public:
18 explicit MockBrowsingDataRemover(content::BrowserContext* context);
19
20 ~MockBrowsingDataRemover() override;
21
22 void RemoveInternal(
23 const base::Time& delete_begin,
24 const base::Time& delete_end,
25 int remove_mask,
26 int origin_type_mask,
27 std::unique_ptr<content::BrowsingDataFilterBuilder> filter_builder,
28 BrowsingDataRemover::Observer* observer) override;
29
30 void ExpectCall(
31 const base::Time& delete_begin,
32 const base::Time& delete_end,
33 int remove_mask,
34 int origin_type_mask,
35 std::unique_ptr<content::BrowsingDataFilterBuilder> filter_builder);
36
37 void ExpectCallDontCareAboutFilterBuilder(const base::Time& delete_begin,
38 const base::Time& delete_end,
39 int remove_mask,
40 int origin_type_mask);
41
42 void VerifyAndClearExpectations();
43
44 private:
45 class CallParameters {
46 public:
47 CallParameters(
48 const base::Time& delete_begin,
49 const base::Time& delete_end,
50 int remove_mask,
51 int origin_type_mask,
52 std::unique_ptr<content::BrowsingDataFilterBuilder> filter_builder,
53 bool should_compare_filter);
54 ~CallParameters();
55
56 bool operator==(const CallParameters& other) const;
57
58 private:
59 base::Time delete_begin_;
60 base::Time delete_end_;
61 int remove_mask_;
62 int origin_type_mask_;
63 std::unique_ptr<content::BrowsingDataFilterBuilder> filter_builder_;
64 bool should_compare_filter_;
65 };
66
67 std::list<CallParameters> actual_calls_;
68 std::list<CallParameters> expected_calls_;
69 };
70
71 #endif // CHROME_BROWSER_BROWSING_DATA_BROWSING_DATA_REMOVER_MOCK_H_
OLDNEW
« no previous file with comments | « chrome/browser/BUILD.gn ('k') | chrome/browser/browsing_data/browsing_data_remover_mock.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698