| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 2292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2303 } | 2303 } |
| 2304 | 2304 |
| 2305 TEST_F(SchedulerTest, UnthrottledBeginFrames) { | 2305 TEST_F(SchedulerTest, UnthrottledBeginFrames) { |
| 2306 BeginFramesNotFromClient(UNTHROTTLED_BFS); | 2306 BeginFramesNotFromClient(UNTHROTTLED_BFS); |
| 2307 } | 2307 } |
| 2308 | 2308 |
| 2309 void SchedulerTest::BeginFramesNotFromClient_SwapThrottled( | 2309 void SchedulerTest::BeginFramesNotFromClient_SwapThrottled( |
| 2310 BeginFrameSourceType bfs_type) { | 2310 BeginFrameSourceType bfs_type) { |
| 2311 SetUpScheduler(bfs_type); | 2311 SetUpScheduler(bfs_type); |
| 2312 | 2312 |
| 2313 scheduler_->SetEstimatedParentDrawTime( | |
| 2314 BeginFrameArgs::DefaultEstimatedParentDrawTime()); | |
| 2315 | |
| 2316 // Set the draw duration estimate to zero so that deadlines are accurate. | 2313 // Set the draw duration estimate to zero so that deadlines are accurate. |
| 2317 fake_compositor_timing_history_->SetDrawDurationEstimate(base::TimeDelta()); | 2314 fake_compositor_timing_history_->SetDrawDurationEstimate(base::TimeDelta()); |
| 2318 | 2315 |
| 2319 // To test swap ack throttling, this test disables automatic swap acks. | 2316 // To test swap ack throttling, this test disables automatic swap acks. |
| 2320 client_->SetAutomaticSwapAck(false); | 2317 client_->SetAutomaticSwapAck(false); |
| 2321 | 2318 |
| 2322 // SetNeedsBeginMainFrame should begin the frame on the next BeginImplFrame. | 2319 // SetNeedsBeginMainFrame should begin the frame on the next BeginImplFrame. |
| 2323 client_->Reset(); | 2320 client_->Reset(); |
| 2324 scheduler_->SetNeedsBeginMainFrame(); | 2321 scheduler_->SetNeedsBeginMainFrame(); |
| 2325 EXPECT_NO_ACTION(client_); | 2322 EXPECT_NO_ACTION(client_); |
| (...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3608 } | 3605 } |
| 3609 | 3606 |
| 3610 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) { | 3607 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) { |
| 3611 EXPECT_FALSE(BeginMainFrameOnCriticalPath( | 3608 EXPECT_FALSE(BeginMainFrameOnCriticalPath( |
| 3612 SMOOTHNESS_TAKES_PRIORITY, | 3609 SMOOTHNESS_TAKES_PRIORITY, |
| 3613 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration)); | 3610 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration)); |
| 3614 } | 3611 } |
| 3615 | 3612 |
| 3616 } // namespace | 3613 } // namespace |
| 3617 } // namespace cc | 3614 } // namespace cc |
| OLD | NEW |