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 2985 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2996 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval); | 2996 scheduler_->SetAuthoritativeVSyncInterval(authoritative_interval); |
2997 | 2997 |
2998 EXPECT_SCOPED(AdvanceFrame()); | 2998 EXPECT_SCOPED(AdvanceFrame()); |
2999 | 2999 |
3000 // At the next BeginFrame, authoritative interval is used instead of previous | 3000 // At the next BeginFrame, authoritative interval is used instead of previous |
3001 // interval. | 3001 // interval. |
3002 EXPECT_NE(initial_interval, scheduler_->BeginImplFrameInterval()); | 3002 EXPECT_NE(initial_interval, scheduler_->BeginImplFrameInterval()); |
3003 EXPECT_EQ(authoritative_interval, scheduler_->BeginImplFrameInterval()); | 3003 EXPECT_EQ(authoritative_interval, scheduler_->BeginImplFrameInterval()); |
3004 } | 3004 } |
3005 | 3005 |
| 3006 TEST_F(SchedulerTest, ImplLatencyTakesPriority) { |
| 3007 SetUpScheduler(true); |
| 3008 scheduler_->SetImplLatencyTakesPriority(true); |
| 3009 EXPECT_TRUE(scheduler_->ImplLatencyTakesPriority()); |
| 3010 |
| 3011 scheduler_->SetImplLatencyTakesPriority(false); |
| 3012 EXPECT_FALSE(scheduler_->ImplLatencyTakesPriority()); |
| 3013 } |
| 3014 |
| 3015 TEST_F(SchedulerTest, BeginFrameArgs_OnCriticalPath) { |
| 3016 scheduler_settings_.use_external_begin_frame_source = true; |
| 3017 SetUpScheduler(true); |
| 3018 |
| 3019 scheduler_->SetImplLatencyTakesPriority(false); |
| 3020 scheduler_->SetChildrenNeedBeginFrames(true); |
| 3021 |
| 3022 EXPECT_SCOPED(AdvanceFrame()); |
| 3023 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); |
| 3024 EXPECT_TRUE(client_->begin_frame_args_sent_to_children().on_critical_path); |
| 3025 } |
| 3026 |
| 3027 TEST_F(SchedulerTest, BeginFrameArgs_NotOnCriticalPath) { |
| 3028 scheduler_settings_.use_external_begin_frame_source = true; |
| 3029 SetUpScheduler(true); |
| 3030 |
| 3031 scheduler_->SetImplLatencyTakesPriority(true); |
| 3032 scheduler_->SetChildrenNeedBeginFrames(true); |
| 3033 |
| 3034 EXPECT_SCOPED(AdvanceFrame()); |
| 3035 EXPECT_TRUE(client_->begin_frame_is_sent_to_children()); |
| 3036 EXPECT_FALSE(client_->begin_frame_args_sent_to_children().on_critical_path); |
| 3037 } |
| 3038 |
3006 } // namespace | 3039 } // namespace |
3007 } // namespace cc | 3040 } // namespace cc |
OLD | NEW |