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 CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_ | |
6 #define CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_ | |
7 | |
8 #include "base/memory/weak_ptr.h" | |
9 #include "base/timer/mock_timer.h" | |
10 | |
11 namespace page_load_metrics { | |
Charlie Harrison
2017/05/30 14:49:08
We didn't talk about this before but it is also no
Bryan McQuade
2017/05/30 15:30:23
Ah, I grepped around until chrome/common and didn'
| |
12 | |
13 // WeakMockTimer is a MockTimer that allows clients to keep WeakPtr<>s to it. | |
14 class WeakMockTimer : public base::MockTimer, | |
15 public base::SupportsWeakPtr<WeakMockTimer> { | |
16 public: | |
17 WeakMockTimer(); | |
18 }; | |
Charlie Harrison
2017/05/30 14:49:08
Do we want to DISALLOW_COPY_AND_ASSIGN to these ti
Bryan McQuade
2017/05/30 15:30:23
done
| |
19 | |
20 // WeakMockTimerProvider is a testing helper class that test classes can inherit | |
21 // from to provide basic MockTimer tracking capabilities. | |
22 class WeakMockTimerProvider { | |
23 public: | |
24 WeakMockTimerProvider(); | |
25 virtual ~WeakMockTimerProvider(); | |
26 | |
27 base::MockTimer* GetMockTimer() const; | |
28 void SetMockTimer(base::WeakPtr<WeakMockTimer> timer); | |
29 | |
30 private: | |
31 base::WeakPtr<WeakMockTimer> timer_; | |
32 }; | |
33 | |
34 } // namespace page_load_metrics | |
35 | |
36 #endif // CHROME_COMMON_PAGE_LOAD_METRICS_TEST_WEAK_MOCK_TIMER_H_ | |
OLD | NEW |