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 "cc/scheduler/compositor_timing_history.h" | 5 #include "cc/scheduler/compositor_timing_history.h" |
6 | 6 |
7 #include "base/macros.h" | 7 #include "base/macros.h" |
8 #include "cc/debug/rendering_stats_instrumentation.h" | 8 #include "cc/debug/rendering_stats_instrumentation.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 timing_history_(this, rendering_stats_.get()) { | 36 timing_history_(this, rendering_stats_.get()) { |
37 AdvanceNowBy(base::TimeDelta::FromMilliseconds(1)); | 37 AdvanceNowBy(base::TimeDelta::FromMilliseconds(1)); |
38 timing_history_.SetRecordingEnabled(true); | 38 timing_history_.SetRecordingEnabled(true); |
39 } | 39 } |
40 | 40 |
41 void AdvanceNowBy(base::TimeDelta delta) { now_ += delta; } | 41 void AdvanceNowBy(base::TimeDelta delta) { now_ += delta; } |
42 | 42 |
43 base::TimeTicks Now() { return now_; } | 43 base::TimeTicks Now() { return now_; } |
44 | 44 |
45 protected: | 45 protected: |
46 scoped_ptr<RenderingStatsInstrumentation> rendering_stats_; | 46 std::unique_ptr<RenderingStatsInstrumentation> rendering_stats_; |
47 TestCompositorTimingHistory timing_history_; | 47 TestCompositorTimingHistory timing_history_; |
48 base::TimeTicks now_; | 48 base::TimeTicks now_; |
49 }; | 49 }; |
50 | 50 |
51 base::TimeTicks TestCompositorTimingHistory::Now() const { | 51 base::TimeTicks TestCompositorTimingHistory::Now() const { |
52 return test_->Now(); | 52 return test_->Now(); |
53 } | 53 } |
54 | 54 |
55 TEST_F(CompositorTimingHistoryTest, AllSequential_Commit) { | 55 TEST_F(CompositorTimingHistoryTest, AllSequential_Commit) { |
56 base::TimeDelta one_second = base::TimeDelta::FromSeconds(1); | 56 base::TimeDelta one_second = base::TimeDelta::FromSeconds(1); |
(...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 | 293 |
294 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = | 294 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = |
295 begin_main_frame_queue_duration_critical + | 295 begin_main_frame_queue_duration_critical + |
296 begin_main_frame_start_to_commit_duration; | 296 begin_main_frame_start_to_commit_duration; |
297 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_, | 297 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_, |
298 timing_history_.BeginMainFrameToCommitDurationEstimate()); | 298 timing_history_.BeginMainFrameToCommitDurationEstimate()); |
299 } | 299 } |
300 | 300 |
301 } // namespace | 301 } // namespace |
302 } // namespace cc | 302 } // namespace cc |
OLD | NEW |