Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(269)

Side by Side Diff: cc/scheduler/compositor_timing_history_unittest.cc

Issue 1460923002: cc: CompositorTimingHistory throughput UMAs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@didDraw
Patch Set: Remove debug TRACE_EVENTS Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « cc/scheduler/compositor_timing_history.cc ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "cc/debug/rendering_stats_instrumentation.h" 7 #include "cc/debug/rendering_stats_instrumentation.h"
8 #include "testing/gtest/include/gtest/gtest.h" 8 #include "testing/gtest/include/gtest/gtest.h"
9 9
10 namespace cc { 10 namespace cc {
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 timing_history_.ReadyToActivate(); 77 timing_history_.ReadyToActivate();
78 // Do not count idle time between notification and actual activation. 78 // Do not count idle time between notification and actual activation.
79 AdvanceNowBy(one_second); 79 AdvanceNowBy(one_second);
80 timing_history_.WillActivate(); 80 timing_history_.WillActivate();
81 AdvanceNowBy(activate_duration); 81 AdvanceNowBy(activate_duration);
82 timing_history_.DidActivate(); 82 timing_history_.DidActivate();
83 // Do not count idle time between activate and draw. 83 // Do not count idle time between activate and draw.
84 AdvanceNowBy(one_second); 84 AdvanceNowBy(one_second);
85 timing_history_.WillDraw(); 85 timing_history_.WillDraw();
86 AdvanceNowBy(draw_duration); 86 AdvanceNowBy(draw_duration);
87 timing_history_.DidDraw(); 87 timing_history_.DidDraw(true);
88 88
89 EXPECT_EQ(begin_main_frame_queue_duration, 89 EXPECT_EQ(begin_main_frame_queue_duration,
90 timing_history_.BeginMainFrameQueueDurationCriticalEstimate()); 90 timing_history_.BeginMainFrameQueueDurationCriticalEstimate());
91 EXPECT_EQ(base::TimeDelta(), 91 EXPECT_EQ(base::TimeDelta(),
92 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate()); 92 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate());
93 EXPECT_EQ(begin_main_frame_start_to_commit_duration, 93 EXPECT_EQ(begin_main_frame_start_to_commit_duration,
94 timing_history_.BeginMainFrameStartToCommitDurationEstimate()); 94 timing_history_.BeginMainFrameStartToCommitDurationEstimate());
95 95
96 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = 96 base::TimeDelta begin_main_frame_to_commit_duration_expected_ =
97 begin_main_frame_queue_duration + 97 begin_main_frame_queue_duration +
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 timing_history_.ReadyToActivate(); 136 timing_history_.ReadyToActivate();
137 // Do not count idle time between notification and actual activation. 137 // Do not count idle time between notification and actual activation.
138 AdvanceNowBy(one_second); 138 AdvanceNowBy(one_second);
139 timing_history_.WillActivate(); 139 timing_history_.WillActivate();
140 AdvanceNowBy(activate_duration); 140 AdvanceNowBy(activate_duration);
141 timing_history_.DidActivate(); 141 timing_history_.DidActivate();
142 // Do not count idle time between activate and draw. 142 // Do not count idle time between activate and draw.
143 AdvanceNowBy(one_second); 143 AdvanceNowBy(one_second);
144 timing_history_.WillDraw(); 144 timing_history_.WillDraw();
145 AdvanceNowBy(draw_duration); 145 AdvanceNowBy(draw_duration);
146 timing_history_.DidDraw(); 146 timing_history_.DidDraw(true);
147 147
148 EXPECT_EQ(base::TimeDelta(), 148 EXPECT_EQ(base::TimeDelta(),
149 timing_history_.BeginMainFrameQueueDurationCriticalEstimate()); 149 timing_history_.BeginMainFrameQueueDurationCriticalEstimate());
150 EXPECT_EQ(begin_main_frame_queue_duration, 150 EXPECT_EQ(begin_main_frame_queue_duration,
151 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate()); 151 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate());
152 EXPECT_EQ(begin_main_frame_start_to_commit_duration, 152 EXPECT_EQ(begin_main_frame_start_to_commit_duration,
153 timing_history_.BeginMainFrameStartToCommitDurationEstimate()); 153 timing_history_.BeginMainFrameStartToCommitDurationEstimate());
154 154
155 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = 155 base::TimeDelta begin_main_frame_to_commit_duration_expected_ =
156 begin_main_frame_queue_duration + 156 begin_main_frame_queue_duration +
157 begin_main_frame_start_to_commit_duration; 157 begin_main_frame_start_to_commit_duration;
158 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_, 158 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_,
159 timing_history_.BeginMainFrameToCommitDurationEstimate()); 159 timing_history_.BeginMainFrameToCommitDurationEstimate());
160 160
161 EXPECT_EQ(commit_to_ready_to_activate_duration, 161 EXPECT_EQ(commit_to_ready_to_activate_duration,
162 timing_history_.CommitToReadyToActivateDurationEstimate()); 162 timing_history_.CommitToReadyToActivateDurationEstimate());
163 EXPECT_EQ(prepare_tiles_duration, 163 EXPECT_EQ(prepare_tiles_duration,
164 timing_history_.PrepareTilesDurationEstimate()); 164 timing_history_.PrepareTilesDurationEstimate());
165 EXPECT_EQ(activate_duration, timing_history_.ActivateDurationEstimate()); 165 EXPECT_EQ(activate_duration, timing_history_.ActivateDurationEstimate());
166 EXPECT_EQ(draw_duration, timing_history_.DrawDurationEstimate()); 166 EXPECT_EQ(draw_duration, timing_history_.DrawDurationEstimate());
167 } 167 }
168 168
169 } // namespace 169 } // namespace
170 } // namespace cc 170 } // namespace cc
OLDNEW
« no previous file with comments | « cc/scheduler/compositor_timing_history.cc ('k') | cc/scheduler/scheduler.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698