| Index: third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| diff --git a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| index 48cc8add36c83cb531d2af04ec604a54b8c2c510..ad4910c278035c1e2be780eb117ad12b75ded3ee 100644
|
| --- a/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| +++ b/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
|
| @@ -455,29 +455,25 @@
|
| FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
|
|
| scheduler_->DidHandleInputEventOnCompositorThread(
|
| FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
|
|
| scheduler_->DidHandleInputEventOnCompositorThread(
|
| FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| }
|
| if (gesture_type != blink::WebInputEvent::Undefined) {
|
| scheduler_->DidHandleInputEventOnCompositorThread(
|
| FakeInputEvent(gesture_type),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| - scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(gesture_type), WebInputEventResult::HandledSystem);
|
| + scheduler_->DidHandleInputEventOnMainThread(FakeInputEvent(gesture_type));
|
| }
|
| }
|
|
|
| @@ -488,8 +484,7 @@
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| clock_->Advance(begin_main_frame_duration);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledApplication);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| scheduler_->DidCommitFrameToCompositor();
|
| }
|
|
|
| @@ -955,8 +950,7 @@
|
| EXPECT_EQ(RendererSchedulerImpl::UseCase::MAIN_THREAD_CUSTOM_INPUT_HANDLING,
|
| CurrentUseCase());
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureFlingStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureFlingStart));
|
| }
|
|
|
| TEST_F(RendererSchedulerImplTest,
|
| @@ -975,56 +969,7 @@
|
| EXPECT_EQ(RendererSchedulerImpl::UseCase::MAIN_THREAD_CUSTOM_INPUT_HANDLING,
|
| CurrentUseCase());
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureFlingStart),
|
| - WebInputEventResult::HandledSystem);
|
| -}
|
| -
|
| -TEST_F(RendererSchedulerImplTest,
|
| - TestCompositorPolicy_MainThreadHandlesInput_SingleEvent_PreventDefault) {
|
| - std::vector<std::string> run_order;
|
| - PostTestTasks(&run_order, "L1 I1 D1 C1 D2 C2");
|
| -
|
| - scheduler_->SetHasVisibleRenderWidgetWithTouchHandler(true);
|
| - EnableIdleTasks();
|
| - scheduler_->DidHandleInputEventOnCompositorThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| - scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledApplication);
|
| - RunUntilIdle();
|
| - // Because the main thread is performing custom input handling, we let all
|
| - // tasks run. However compositing tasks are still given priority.
|
| - EXPECT_THAT(run_order,
|
| - testing::ElementsAre(std::string("C1"), std::string("C2"),
|
| - std::string("L1"), std::string("D1"),
|
| - std::string("D2"), std::string("I1")));
|
| - EXPECT_EQ(RendererSchedulerImpl::UseCase::MAIN_THREAD_CUSTOM_INPUT_HANDLING,
|
| - CurrentUseCase());
|
| -}
|
| -
|
| -TEST_F(
|
| - RendererSchedulerImplTest,
|
| - TestCompositorPolicy_MainThreadHandlesInput_SingleEvent_NoPreventDefault) {
|
| - std::vector<std::string> run_order;
|
| - PostTestTasks(&run_order, "L1 I1 D1 C1 D2 C2");
|
| -
|
| - scheduler_->SetHasVisibleRenderWidgetWithTouchHandler(true);
|
| - EnableIdleTasks();
|
| - scheduler_->DidHandleInputEventOnCompositorThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| - scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| - RunUntilIdle();
|
| - // Because we are still waiting for the touchstart to be processed,
|
| - // non-essential tasks like loading tasks are blocked.
|
| - EXPECT_THAT(run_order,
|
| - testing::ElementsAre(std::string("C1"), std::string("C2"),
|
| - std::string("D1"), std::string("D2"),
|
| - std::string("I1")));
|
| - EXPECT_EQ(RendererSchedulerImpl::UseCase::TOUCHSTART, CurrentUseCase());
|
| + FakeInputEvent(blink::WebInputEvent::GestureFlingStart));
|
| }
|
|
|
| TEST_F(RendererSchedulerImplTest, TestCompositorPolicy_DidAnimateForInput) {
|
| @@ -1176,8 +1121,7 @@
|
| FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
| EnableIdleTasks();
|
| RunUntilIdle();
|
| EXPECT_THAT(run_order,
|
| @@ -1190,14 +1134,12 @@
|
| FakeInputEvent(blink::WebInputEvent::GestureFlingCancel),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureFlingCancel),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureFlingCancel));
|
| scheduler_->DidHandleInputEventOnCompositorThread(
|
| FakeInputEvent(blink::WebInputEvent::GestureTapDown),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureTapDown),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureTapDown));
|
| RunUntilIdle();
|
| EXPECT_TRUE(run_order.empty());
|
|
|
| @@ -1208,8 +1150,7 @@
|
| FakeInputEvent(blink::WebInputEvent::GestureScrollBegin),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureScrollBegin),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureScrollBegin));
|
| RunUntilIdle();
|
|
|
| EXPECT_THAT(run_order,
|
| @@ -1325,10 +1266,8 @@
|
| testing::ElementsAre(std::string("C1"), std::string("C2"),
|
| std::string("D1"), std::string("D2"),
|
| std::string("I1")));
|
| - scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::MouseMove,
|
| - blink::WebInputEvent::LeftButtonDown),
|
| - WebInputEventResult::HandledSystem);
|
| + scheduler_->DidHandleInputEventOnMainThread(FakeInputEvent(
|
| + blink::WebInputEvent::MouseMove, blink::WebInputEvent::LeftButtonDown));
|
| }
|
|
|
| TEST_F(RendererSchedulerImplTest,
|
| @@ -1525,8 +1464,7 @@
|
| EXPECT_EQ(RendererSchedulerImpl::UseCase::NONE, CurrentUseCase());
|
| // Note compositor tasks are not prioritized.
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::KeyDown),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::KeyDown));
|
| }
|
|
|
| TEST_F(RendererSchedulerImplTest,
|
| @@ -1755,8 +1693,7 @@
|
| // task we post here represents the enqueued input task.
|
| clock_->Advance(priority_escalation_after_input_duration() * 2);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureFlingStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureFlingStart));
|
| RunUntilIdle();
|
|
|
| // Even though we exceeded the input priority escalation period, we should
|
| @@ -1837,8 +1774,7 @@
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| clock_->Advance(base::TimeDelta::FromMilliseconds(1000));
|
| @@ -1860,8 +1796,7 @@
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| // The second call to DidHandleInputEventOnCompositorThread should not post a
|
| @@ -1874,8 +1809,7 @@
|
|
|
| // We expect DidHandleInputEvent to trigger a policy update.
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| // The third call to DidHandleInputEventOnCompositorThread should post a
|
| @@ -1889,8 +1823,7 @@
|
|
|
| // We expect DidHandleInputEvent to trigger a policy update.
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| EXPECT_EQ(2, mock_scheduler_->update_policy_count_);
|
|
|
| clock_->Advance(base::TimeDelta::FromMilliseconds(1000));
|
| @@ -1912,8 +1845,7 @@
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
| EXPECT_EQ(1, mock_scheduler_->update_policy_count_);
|
|
|
| clock_->Advance(base::TimeDelta::FromMilliseconds(1000));
|
| @@ -1931,8 +1863,7 @@
|
| EXPECT_EQ(3, mock_scheduler_->update_policy_count_);
|
|
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| EXPECT_EQ(3, mock_scheduler_->update_policy_count_);
|
|
|
| clock_->Advance(base::TimeDelta::FromMilliseconds(1000));
|
| @@ -1975,17 +1906,13 @@
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
|
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchStart));
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchMove),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchMove));
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchEnd),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchEnd));
|
|
|
| EXPECT_EQ(2, mock_scheduler_->update_policy_count_);
|
|
|
| @@ -2444,8 +2371,7 @@
|
| // INPUT_EVENT_ACK_STATE_NOT_CONSUMED. There are legitimate reasons for the
|
| // compositor to not be there and we don't want to make debugging impossible.
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::GestureFlingStart),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::GestureFlingStart));
|
| }
|
|
|
| TEST_F(RendererSchedulerImplTest, BeginMainFrameOnCriticalPath) {
|
| @@ -2614,8 +2540,7 @@
|
| FakeInputEvent(blink::WebInputEvent::TouchEnd),
|
| RendererScheduler::InputEventState::EVENT_FORWARDED_TO_MAIN_THREAD);
|
| scheduler_->DidHandleInputEventOnMainThread(
|
| - FakeInputEvent(blink::WebInputEvent::TouchEnd),
|
| - WebInputEventResult::HandledSystem);
|
| + FakeInputEvent(blink::WebInputEvent::TouchEnd));
|
|
|
| clock_->Advance(priority_escalation_after_input_duration() * 2);
|
| EXPECT_EQ(UseCase::NONE, ForceUpdatePolicyAndGetCurrentUseCase());
|
|
|