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

Side by Side Diff: components/autofill/core/browser/test_autofill_clock.h

Issue 2639403002: [Autofill] Remove direct use of base::Time::Now() in Autofill (Closed)
Patch Set: Added DCHECK Created 3 years, 10 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 #ifndef COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLOCK_H_
6 #define COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLOCK_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11
12 namespace base {
13 class SimpleTestClock;
14 class Time;
15 } // namespace base
16
17 namespace autofill {
18
19 // Handles the customization of the time in tests. Replaces the clock in
20 // AutofillClock with a test version that can be manipulated from this class.
21 // Automatically resets a normal clock to AutofillClock when this gets
22 // destroyed,
23 class TestAutofillClock {
24 public:
25 TestAutofillClock();
26 ~TestAutofillClock();
27
28 // Set the time to be returned from AutofillClock::Now() calls.
29 void SetNow(base::Time now);
30
31 private:
32 base::SimpleTestClock* test_clock_;
33
34 DISALLOW_COPY_AND_ASSIGN(TestAutofillClock);
35 };
36
37 } // namespace autofill
38
39 #endif // COMPONENTS_AUTOFILL_CORE_BROWSER_TEST_AUTOFILL_CLOCK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698