OLD | NEW |
1 // Copyright 2011 The Chromium Authors. All rights reserved. | 1 // Copyright 2011 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/scheduler.h" | 5 #include "cc/scheduler/scheduler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 EXPECT_FALSE(needs_begin_frames()); | 185 EXPECT_FALSE(needs_begin_frames()); |
186 | 186 |
187 // Start the initial output surface creation. | 187 // Start the initial output surface creation. |
188 EXPECT_FALSE(scheduler->CanStart()); | 188 EXPECT_FALSE(scheduler->CanStart()); |
189 scheduler->SetCanStart(); | 189 scheduler->SetCanStart(); |
190 scheduler->SetVisible(true); | 190 scheduler->SetVisible(true); |
191 scheduler->SetCanDraw(true); | 191 scheduler->SetCanDraw(true); |
192 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", (*this)); | 192 EXPECT_SINGLE_ACTION("ScheduledActionBeginOutputSurfaceCreation", (*this)); |
193 Reset(); | 193 Reset(); |
194 | 194 |
195 // Finish the initial output surface creation and run the first commit. | 195 // We don't see anything happening until the first impl frame. |
196 scheduler->DidCreateAndInitializeOutputSurface(); | 196 scheduler->DidCreateAndInitializeOutputSurface(); |
197 scheduler->SetNeedsCommit(); | 197 scheduler->SetNeedsCommit(); |
198 scheduler->NotifyBeginMainFrameStarted(); | 198 EXPECT_TRUE(needs_begin_frames()); |
199 scheduler->NotifyReadyToCommitThenActivateIfNeeded(); | 199 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
| 200 Reset(); |
200 | 201 |
201 { | 202 { |
202 SCOPED_TRACE("Go through the motions to draw the commit"); | 203 SCOPED_TRACE("Do first frame to commit after initialize."); |
203 AdvanceFrame(); | 204 AdvanceFrame(); |
204 | 205 |
| 206 scheduler->NotifyBeginMainFrameStarted(); |
| 207 scheduler->NotifyReadyToCommitThenActivateIfNeeded(); |
| 208 |
205 // Run the posted deadline task. | 209 // Run the posted deadline task. |
206 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 210 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
207 task_runner().RunTasksWhile(ImplFrameDeadlinePending(true)); | 211 task_runner().RunTasksWhile(ImplFrameDeadlinePending(true)); |
208 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 212 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
209 | 213 |
210 EXPECT_FALSE(scheduler->CommitPending()); | 214 EXPECT_FALSE(scheduler->CommitPending()); |
211 } | 215 } |
212 | 216 |
213 Reset(); | 217 Reset(); |
214 | 218 |
(...skipping 1976 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2191 | 2195 |
2192 // Deadline task is pending | 2196 // Deadline task is pending |
2193 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); | 2197 EXPECT_TRUE(scheduler->BeginImplFrameDeadlinePending()); |
2194 client.task_runner().RunPendingTasks(); | 2198 client.task_runner().RunPendingTasks(); |
2195 // Deadline task runs immediately | 2199 // Deadline task runs immediately |
2196 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); | 2200 EXPECT_FALSE(scheduler->BeginImplFrameDeadlinePending()); |
2197 } | 2201 } |
2198 | 2202 |
2199 } // namespace | 2203 } // namespace |
2200 } // namespace cc | 2204 } // namespace cc |
OLD | NEW |