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/logging.h" | 10 #include "base/logging.h" |
(...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2582 EXPECT_NO_ACTION(client_); | 2582 EXPECT_NO_ACTION(client_); |
2583 | 2583 |
2584 // Allow new commit even though previous commit hasn't been drawn. | 2584 // Allow new commit even though previous commit hasn't been drawn. |
2585 scheduler_->NotifyReadyToCommit(); | 2585 scheduler_->NotifyReadyToCommit(); |
2586 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client_); | 2586 EXPECT_SINGLE_ACTION("ScheduledActionCommit", client_); |
2587 client_->Reset(); | 2587 client_->Reset(); |
2588 } | 2588 } |
2589 | 2589 |
2590 TEST_F(SchedulerTest, AuthoritativeVSyncInterval) { | 2590 TEST_F(SchedulerTest, AuthoritativeVSyncInterval) { |
2591 SetUpScheduler(true); | 2591 SetUpScheduler(true); |
2592 | 2592 base::TimeDelta initial_interval = scheduler_->Interval(); |
brianderson
2015/05/01 02:05:21
scheduler_->Interval() has an ambiguous name. It's
mithro-old
2015/05/01 03:27:56
Fixed.
| |
2593 base::TimeDelta initial_interval = | |
2594 scheduler_->begin_impl_frame_args().interval; | |
2595 base::TimeDelta authoritative_interval = | 2593 base::TimeDelta authoritative_interval = |
2596 base::TimeDelta::FromMilliseconds(33); | 2594 base::TimeDelta::FromMilliseconds(33); |
2597 | 2595 |
2598 scheduler_->SetNeedsCommit(); | 2596 scheduler_->SetNeedsCommit(); |
2599 EXPECT_SCOPED(AdvanceFrame()); | 2597 EXPECT_SCOPED(AdvanceFrame()); |
2600 | 2598 |
2601 EXPECT_EQ(initial_interval, scheduler_->begin_impl_frame_args().interval); | 2599 EXPECT_EQ(initial_interval, scheduler_->Interval()); |
2602 | 2600 |
2603 scheduler_->NotifyBeginMainFrameStarted(); | 2601 scheduler_->NotifyBeginMainFrameStarted(); |
2604 scheduler_->NotifyReadyToCommit(); | 2602 scheduler_->NotifyReadyToCommit(); |
2605 task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true)); | 2603 task_runner().RunTasksWhile(client_->ImplFrameDeadlinePending(true)); |
2606 | 2604 |
2607 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval); | 2605 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval); |
2608 | 2606 |
2609 EXPECT_SCOPED(AdvanceFrame()); | 2607 EXPECT_SCOPED(AdvanceFrame()); |
2610 | 2608 |
2611 // At the next BeginFrame, authoritative interval is used instead of previous | 2609 // At the next BeginFrame, authoritative interval is used instead of previous |
2612 // interval. | 2610 // interval. |
2613 EXPECT_NE(initial_interval, scheduler_->begin_impl_frame_args().interval); | 2611 EXPECT_NE(initial_interval, scheduler_->Interval()); |
2614 EXPECT_EQ(authoritative_interval, | 2612 EXPECT_EQ(authoritative_interval, scheduler_->Interval()); |
2615 scheduler_->begin_impl_frame_args().interval); | |
2616 } | 2613 } |
2617 | 2614 |
2618 } // namespace | 2615 } // namespace |
2619 } // namespace cc | 2616 } // namespace cc |
OLD | NEW |