OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "platform/scheduler/renderer/web_view_scheduler_impl.h" | 5 #include "platform/scheduler/renderer/web_view_scheduler_impl.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
11 #include "base/metrics/field_trial.h" | 11 #include "base/metrics/field_trial.h" |
12 #include "base/metrics/field_trial_param_associator.h" | 12 #include "base/metrics/field_trial_param_associator.h" |
13 #include "base/metrics/field_trial_params.h" | 13 #include "base/metrics/field_trial_params.h" |
14 #include "base/test/simple_test_tick_clock.h" | 14 #include "base/test/simple_test_tick_clock.h" |
15 #include "cc/test/ordered_simple_task_runner.h" | 15 #include "cc/test/ordered_simple_task_runner.h" |
16 #include "platform/WebTaskRunner.h" | 16 #include "platform/WebTaskRunner.h" |
17 #include "platform/scheduler/base/test_time_source.h" | 17 #include "platform/scheduler/base/test_time_source.h" |
18 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h" | 18 #include "platform/scheduler/child/scheduler_tqm_delegate_for_test.h" |
19 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" | 19 #include "platform/scheduler/renderer/renderer_scheduler_impl.h" |
20 #include "platform/scheduler/renderer/web_frame_scheduler_impl.h" | 20 #include "platform/scheduler/renderer/web_frame_scheduler_impl.h" |
21 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" | 21 #include "platform/testing/RuntimeEnabledFeaturesTestHelpers.h" |
22 #include "public/platform/WebTraceLocation.h" | 22 #include "public/platform/WebTraceLocation.h" |
23 #include "testing/gmock/include/gmock/gmock.h" | 23 #include "testing/gmock/include/gmock/gmock.h" |
24 #include "testing/gtest/include/gtest/gtest.h" | 24 #include "testing/gtest/include/gtest/gtest.h" |
25 | 25 |
26 using testing::ElementsAre; | 26 using ::testing::ElementsAre; |
27 using VirtualTimePolicy = blink::WebViewScheduler::VirtualTimePolicy; | 27 using VirtualTimePolicy = blink::WebViewScheduler::VirtualTimePolicy; |
28 | 28 |
29 namespace blink { | 29 namespace blink { |
30 namespace scheduler { | 30 namespace scheduler { |
31 | 31 |
32 class WebViewSchedulerImplTest : public testing::Test { | 32 class WebViewSchedulerImplTest : public ::testing::Test { |
33 public: | 33 public: |
34 WebViewSchedulerImplTest() {} | 34 WebViewSchedulerImplTest() {} |
35 ~WebViewSchedulerImplTest() override {} | 35 ~WebViewSchedulerImplTest() override {} |
36 | 36 |
37 void SetUp() override { | 37 void SetUp() override { |
38 clock_.reset(new base::SimpleTestTickClock()); | 38 clock_.reset(new base::SimpleTestTickClock()); |
39 clock_->Advance(base::TimeDelta::FromMicroseconds(5000)); | 39 clock_->Advance(base::TimeDelta::FromMicroseconds(5000)); |
40 mock_task_runner_ = | 40 mock_task_runner_ = |
41 make_scoped_refptr(new cc::OrderedSimpleTaskRunner(clock_.get(), true)); | 41 make_scoped_refptr(new cc::OrderedSimpleTaskRunner(clock_.get(), true)); |
42 delegate_ = SchedulerTqmDelegateForTest::Create( | 42 delegate_ = SchedulerTqmDelegateForTest::Create( |
(...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
897 run_times, | 897 run_times, |
898 ElementsAre(base::TimeTicks() + base::TimeDelta::FromSeconds(84), | 898 ElementsAre(base::TimeTicks() + base::TimeDelta::FromSeconds(84), |
899 base::TimeTicks() + base::TimeDelta::FromSeconds(109), | 899 base::TimeTicks() + base::TimeDelta::FromSeconds(109), |
900 base::TimeTicks() + base::TimeDelta::FromSeconds(134))); | 900 base::TimeTicks() + base::TimeDelta::FromSeconds(134))); |
901 | 901 |
902 base::FieldTrialParamAssociator::GetInstance()->ClearAllParamsForTesting(); | 902 base::FieldTrialParamAssociator::GetInstance()->ClearAllParamsForTesting(); |
903 } | 903 } |
904 | 904 |
905 } // namespace scheduler | 905 } // namespace scheduler |
906 } // namespace blink | 906 } // namespace blink |
OLD | NEW |