| 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 <deque> | 5 #include <deque> |
| 6 #include <string> | 6 #include <string> |
| 7 | 7 |
| 8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
| 9 #include "base/gtest_prod_util.h" | 9 #include "base/gtest_prod_util.h" |
| 10 #include "base/test/test_simple_task_runner.h" | 10 #include "base/test/test_simple_task_runner.h" |
| (...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 523 void TearDown() override { obs_.reset(); } | 523 void TearDown() override { obs_.reset(); } |
| 524 }; | 524 }; |
| 525 | 525 |
| 526 TEST_F(SyntheticBeginFrameSourceTest, | 526 TEST_F(SyntheticBeginFrameSourceTest, |
| 527 SetNeedsBeginFramesCallsOnBeginFrameWithMissedTick) { | 527 SetNeedsBeginFramesCallsOnBeginFrameWithMissedTick) { |
| 528 now_src_->Advance(base::TimeDelta::FromMicroseconds(9010)); | 528 now_src_->Advance(base::TimeDelta::FromMicroseconds(9010)); |
| 529 EXPECT_CALL((*obs_), OnBeginFrame(CreateBeginFrameArgsForTesting( | 529 EXPECT_CALL((*obs_), OnBeginFrame(CreateBeginFrameArgsForTesting( |
| 530 BEGINFRAME_FROM_HERE, 10000, 20000, 10000, | 530 BEGINFRAME_FROM_HERE, 10000, 20000, 10000, |
| 531 BeginFrameArgs::MISSED))); | 531 BeginFrameArgs::MISSED))); |
| 532 source_->SetNeedsBeginFrames(true); // Should cause the last tick to be sent | 532 source_->SetNeedsBeginFrames(true); // Should cause the last tick to be sent |
| 533 // No tasks should need to be run for this to occur. | 533 task_runner_->RunPendingTasks(); |
| 534 } | 534 } |
| 535 | 535 |
| 536 TEST_F(SyntheticBeginFrameSourceTest, | 536 TEST_F(SyntheticBeginFrameSourceTest, |
| 537 SetNeedsBeginFramesCallsCausesOnBeginFrame) { | 537 SetNeedsBeginFramesCallsCausesOnBeginFrame) { |
| 538 source_->SetNeedsBeginFrames(true); | 538 source_->SetNeedsBeginFrames(true); |
| 539 EXPECT_EQ(10000, task_runner_->NextTaskTime().ToInternalValue()); | 539 EXPECT_EQ(10000, task_runner_->NextTaskTime().ToInternalValue()); |
| 540 | 540 |
| 541 EXPECT_BEGIN_FRAME_USED(*obs_, 10000, 20000, 10000); | 541 EXPECT_BEGIN_FRAME_USED(*obs_, 10000, 20000, 10000); |
| 542 now_src_->Advance(base::TimeDelta::FromMicroseconds(9010)); | 542 now_src_->Advance(base::TimeDelta::FromMicroseconds(9010)); |
| 543 task_runner_->RunPendingTasks(); | 543 task_runner_->RunPendingTasks(); |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 770 mux_->SetActiveSource(source2_); | 770 mux_->SetActiveSource(source2_); |
| 771 SEND_BEGIN_FRAME_DROP(*source2_, 750, 1050, 300); | 771 SEND_BEGIN_FRAME_DROP(*source2_, 750, 1050, 300); |
| 772 SEND_BEGIN_FRAME_USED(*source2_, 1050, 1250, 300); | 772 SEND_BEGIN_FRAME_USED(*source2_, 1050, 1250, 300); |
| 773 | 773 |
| 774 mux_->SetActiveSource(source1_); | 774 mux_->SetActiveSource(source1_); |
| 775 SEND_BEGIN_FRAME_DROP(*source2_, 1100, 1400, 300); | 775 SEND_BEGIN_FRAME_DROP(*source2_, 1100, 1400, 300); |
| 776 } | 776 } |
| 777 | 777 |
| 778 } // namespace | 778 } // namespace |
| 779 } // namespace cc | 779 } // namespace cc |
| OLD | NEW |