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 934 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
945 EXPECT_FALSE(client->HasAction("ScheduledActionPrepareTiles")); | 945 EXPECT_FALSE(client->HasAction("ScheduledActionPrepareTiles")); |
946 EXPECT_FALSE(client->HasAction("ScheduledActionDrawAndSwapIfPossible")); | 946 EXPECT_FALSE(client->HasAction("ScheduledActionDrawAndSwapIfPossible")); |
947 | 947 |
948 // We have no immediate actions to perform, so the BeginImplFrame should post | 948 // We have no immediate actions to perform, so the BeginImplFrame should post |
949 // the deadline task. | 949 // the deadline task. |
950 client->Reset(); | 950 client->Reset(); |
951 EXPECT_SCOPED(AdvanceFrame()); | 951 EXPECT_SCOPED(AdvanceFrame()); |
952 EXPECT_ACTION("WillBeginImplFrame", client, 0, 1); | 952 EXPECT_ACTION("WillBeginImplFrame", client, 0, 1); |
953 EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending()); | 953 EXPECT_TRUE(scheduler_->BeginImplFrameDeadlinePending()); |
954 | 954 |
955 // On the deadline, he actions should have occured in the right order. | 955 // On the deadline, the actions should have occured in the right order. |
956 client->Reset(); | 956 client->Reset(); |
957 task_runner().RunPendingTasks(); // Run posted deadline. | 957 task_runner().RunPendingTasks(); // Run posted deadline. |
958 EXPECT_EQ(1, client->num_draws()); | 958 EXPECT_EQ(1, client->num_draws()); |
959 EXPECT_TRUE(client->HasAction("ScheduledActionDrawAndSwapIfPossible")); | 959 EXPECT_TRUE(client->HasAction("ScheduledActionDrawAndSwapIfPossible")); |
960 EXPECT_TRUE(client->HasAction("ScheduledActionPrepareTiles")); | 960 EXPECT_TRUE(client->HasAction("ScheduledActionPrepareTiles")); |
961 EXPECT_LT(client->ActionIndex("ScheduledActionDrawAndSwapIfPossible"), | 961 EXPECT_LT(client->ActionIndex("ScheduledActionDrawAndSwapIfPossible"), |
962 client->ActionIndex("ScheduledActionPrepareTiles")); | 962 client->ActionIndex("ScheduledActionPrepareTiles")); |
963 EXPECT_FALSE(scheduler_->RedrawPending()); | 963 EXPECT_FALSE(scheduler_->RedrawPending()); |
964 EXPECT_FALSE(scheduler_->PrepareTilesPending()); | 964 EXPECT_FALSE(scheduler_->PrepareTilesPending()); |
965 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending()); | 965 EXPECT_FALSE(scheduler_->BeginImplFrameDeadlinePending()); |
(...skipping 2715 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3681 } | 3681 } |
3682 | 3682 |
3683 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) { | 3683 TEST_F(SchedulerTest, BeginMainFrameOnCriticalPath_AHS) { |
3684 EXPECT_FALSE(BeginMainFrameOnCriticalPath( | 3684 EXPECT_FALSE(BeginMainFrameOnCriticalPath( |
3685 SMOOTHNESS_TAKES_PRIORITY, | 3685 SMOOTHNESS_TAKES_PRIORITY, |
3686 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration)); | 3686 ScrollHandlerState::SCROLL_AFFECTS_SCROLL_HANDLER, kSlowDuration)); |
3687 } | 3687 } |
3688 | 3688 |
3689 } // namespace | 3689 } // namespace |
3690 } // namespace cc | 3690 } // namespace cc |
OLD | NEW |