OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H
_ | 5 #ifndef THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H
_ |
6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H
_ | 6 #define THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNER_H
_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 class FakeWebTaskRunner : public WebTaskRunner { | 21 class FakeWebTaskRunner : public WebTaskRunner { |
22 public: | 22 public: |
23 FakeWebTaskRunner(); | 23 FakeWebTaskRunner(); |
24 | 24 |
25 void SetTime(double new_time); | 25 void SetTime(double new_time); |
26 | 26 |
27 // WebTaskRunner implementation: | 27 // WebTaskRunner implementation: |
28 void PostDelayedTask(const WebTraceLocation&, | 28 void PostDelayedTask(const WebTraceLocation&, |
29 base::OnceClosure, | 29 base::OnceClosure, |
30 double) override; | 30 double) override; |
31 bool RunsTasksOnCurrentThread() override; | 31 bool RunsTasksInCurrentSequence() override; |
32 double VirtualTimeSeconds() const override; | 32 double VirtualTimeSeconds() const override; |
33 double MonotonicallyIncreasingVirtualTimeSeconds() const override; | 33 double MonotonicallyIncreasingVirtualTimeSeconds() const override; |
34 SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; | 34 SingleThreadTaskRunner* ToSingleThreadTaskRunner() override; |
35 | 35 |
36 void RunUntilIdle(); | 36 void RunUntilIdle(); |
37 void AdvanceTimeAndRun(double delta_seconds); | 37 void AdvanceTimeAndRun(double delta_seconds); |
38 std::deque<std::pair<base::OnceClosure, double>> TakePendingTasksForTesting(); | 38 std::deque<std::pair<base::OnceClosure, double>> TakePendingTasksForTesting(); |
39 | 39 |
40 private: | 40 private: |
41 ~FakeWebTaskRunner() override; | 41 ~FakeWebTaskRunner() override; |
42 | 42 |
43 class Data; | 43 class Data; |
44 class BaseTaskRunner; | 44 class BaseTaskRunner; |
45 RefPtr<Data> data_; | 45 RefPtr<Data> data_; |
46 scoped_refptr<BaseTaskRunner> base_task_runner_; | 46 scoped_refptr<BaseTaskRunner> base_task_runner_; |
47 | 47 |
48 FakeWebTaskRunner(PassRefPtr<Data> data, | 48 FakeWebTaskRunner(PassRefPtr<Data> data, |
49 scoped_refptr<BaseTaskRunner> base_task_runner); | 49 scoped_refptr<BaseTaskRunner> base_task_runner); |
50 | 50 |
51 DISALLOW_COPY_AND_ASSIGN(FakeWebTaskRunner); | 51 DISALLOW_COPY_AND_ASSIGN(FakeWebTaskRunner); |
52 }; | 52 }; |
53 | 53 |
54 } // namespace scheduler | 54 } // namespace scheduler |
55 } // namespace blink | 55 } // namespace blink |
56 | 56 |
57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNE
R_H_ | 57 #endif // THIRD_PARTY_WEBKIT_SOURCE_PLATFORM_SCHEDULER_TEST_FAKE_WEB_TASK_RUNNE
R_H_ |
OLD | NEW |