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

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

Issue 1681393003: cc: Add MainAndImplFrameTimeDelta UMA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 months 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
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 "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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 timing_history_.ReadyToActivate(); 78 timing_history_.ReadyToActivate();
79 // Do not count idle time between notification and actual activation. 79 // Do not count idle time between notification and actual activation.
80 AdvanceNowBy(one_second); 80 AdvanceNowBy(one_second);
81 timing_history_.WillActivate(); 81 timing_history_.WillActivate();
82 AdvanceNowBy(activate_duration); 82 AdvanceNowBy(activate_duration);
83 timing_history_.DidActivate(); 83 timing_history_.DidActivate();
84 // Do not count idle time between activate and draw. 84 // Do not count idle time between activate and draw.
85 AdvanceNowBy(one_second); 85 AdvanceNowBy(one_second);
86 timing_history_.WillDraw(); 86 timing_history_.WillDraw();
87 AdvanceNowBy(draw_duration); 87 AdvanceNowBy(draw_duration);
88 timing_history_.DidDraw(true); 88 timing_history_.DidDraw(true, true);
89 89
90 EXPECT_EQ(begin_main_frame_queue_duration, 90 EXPECT_EQ(begin_main_frame_queue_duration,
91 timing_history_.BeginMainFrameQueueDurationCriticalEstimate()); 91 timing_history_.BeginMainFrameQueueDurationCriticalEstimate());
92 EXPECT_EQ(base::TimeDelta(), 92 EXPECT_EQ(base::TimeDelta(),
93 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate()); 93 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate());
94 EXPECT_EQ(begin_main_frame_start_to_commit_duration, 94 EXPECT_EQ(begin_main_frame_start_to_commit_duration,
95 timing_history_.BeginMainFrameStartToCommitDurationEstimate()); 95 timing_history_.BeginMainFrameStartToCommitDurationEstimate());
96 96
97 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = 97 base::TimeDelta begin_main_frame_to_commit_duration_expected_ =
98 begin_main_frame_queue_duration + 98 begin_main_frame_queue_duration +
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 timing_history_.ReadyToActivate(); 137 timing_history_.ReadyToActivate();
138 // Do not count idle time between notification and actual activation. 138 // Do not count idle time between notification and actual activation.
139 AdvanceNowBy(one_second); 139 AdvanceNowBy(one_second);
140 timing_history_.WillActivate(); 140 timing_history_.WillActivate();
141 AdvanceNowBy(activate_duration); 141 AdvanceNowBy(activate_duration);
142 timing_history_.DidActivate(); 142 timing_history_.DidActivate();
143 // Do not count idle time between activate and draw. 143 // Do not count idle time between activate and draw.
144 AdvanceNowBy(one_second); 144 AdvanceNowBy(one_second);
145 timing_history_.WillDraw(); 145 timing_history_.WillDraw();
146 AdvanceNowBy(draw_duration); 146 AdvanceNowBy(draw_duration);
147 timing_history_.DidDraw(true); 147 timing_history_.DidDraw(true, true);
148 148
149 EXPECT_EQ(base::TimeDelta(), 149 EXPECT_EQ(base::TimeDelta(),
150 timing_history_.BeginMainFrameQueueDurationCriticalEstimate()); 150 timing_history_.BeginMainFrameQueueDurationCriticalEstimate());
151 EXPECT_EQ(begin_main_frame_queue_duration, 151 EXPECT_EQ(begin_main_frame_queue_duration,
152 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate()); 152 timing_history_.BeginMainFrameQueueDurationNotCriticalEstimate());
153 EXPECT_EQ(begin_main_frame_start_to_commit_duration, 153 EXPECT_EQ(begin_main_frame_start_to_commit_duration,
154 timing_history_.BeginMainFrameStartToCommitDurationEstimate()); 154 timing_history_.BeginMainFrameStartToCommitDurationEstimate());
155 155
156 base::TimeDelta begin_main_frame_to_commit_duration_expected_ = 156 base::TimeDelta begin_main_frame_to_commit_duration_expected_ =
157 begin_main_frame_queue_duration + 157 begin_main_frame_queue_duration +
158 begin_main_frame_start_to_commit_duration; 158 begin_main_frame_start_to_commit_duration;
159 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_, 159 EXPECT_EQ(begin_main_frame_to_commit_duration_expected_,
160 timing_history_.BeginMainFrameToCommitDurationEstimate()); 160 timing_history_.BeginMainFrameToCommitDurationEstimate());
161 161
162 EXPECT_EQ(commit_to_ready_to_activate_duration, 162 EXPECT_EQ(commit_to_ready_to_activate_duration,
163 timing_history_.CommitToReadyToActivateDurationEstimate()); 163 timing_history_.CommitToReadyToActivateDurationEstimate());
164 EXPECT_EQ(prepare_tiles_duration, 164 EXPECT_EQ(prepare_tiles_duration,
165 timing_history_.PrepareTilesDurationEstimate()); 165 timing_history_.PrepareTilesDurationEstimate());
166 EXPECT_EQ(activate_duration, timing_history_.ActivateDurationEstimate()); 166 EXPECT_EQ(activate_duration, timing_history_.ActivateDurationEstimate());
167 EXPECT_EQ(draw_duration, timing_history_.DrawDurationEstimate()); 167 EXPECT_EQ(draw_duration, timing_history_.DrawDurationEstimate());
168 } 168 }
169 169
170 } // namespace 170 } // namespace
171 } // namespace cc 171 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698