Chromium Code Reviews| 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 #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); | |
|
Roger McFarlane (Chromium)
2017/01/31 19:05:54
nit: wonky indentation for the rest of the file
sebsg
2017/01/31 21:55:56
Done.
| |
| 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_ | |
| OLD | NEW |