Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(549)

Side by Side Diff: content/browser/renderer_host/render_widget_host_unittest.cc

Issue 2482453002: Don't restart the hang renderer timeout on messages ack'd from the compositor thread. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stddef.h> 5 #include <stddef.h>
6 #include <stdint.h> 6 #include <stdint.h>
7 7
8 #include <memory> 8 #include <memory>
9 #include <tuple> 9 #include <tuple>
10 10
(...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after
521 } 521 }
522 522
523 virtual void ConfigureView(TestView* view) { 523 virtual void ConfigureView(TestView* view) {
524 } 524 }
525 525
526 int64_t GetLatencyComponentId() { return host_->GetLatencyComponentId(); } 526 int64_t GetLatencyComponentId() { return host_->GetLatencyComponentId(); }
527 527
528 void SendInputEventACK(WebInputEvent::Type type, 528 void SendInputEventACK(WebInputEvent::Type type,
529 InputEventAckState ack_result) { 529 InputEventAckState ack_result) {
530 DCHECK(!WebInputEvent::isTouchEventType(type)); 530 DCHECK(!WebInputEvent::isTouchEventType(type));
531 InputEventAck ack(type, ack_result); 531 InputEventAck ack(
532 InputEventAckLocation::INPUT_EVENT_ACK_LOCATION_COMPOSITOR_THREAD, type,
533 ack_result);
532 host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); 534 host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack));
533 } 535 }
534 536
535 double GetNextSimulatedEventTimeSeconds() { 537 double GetNextSimulatedEventTimeSeconds() {
536 last_simulated_event_time_seconds_ += simulated_event_time_delta_seconds_; 538 last_simulated_event_time_seconds_ += simulated_event_time_delta_seconds_;
537 return last_simulated_event_time_seconds_; 539 return last_simulated_event_time_seconds_;
538 } 540 }
539 541
540 void SimulateKeyboardEvent(WebInputEvent::Type type) { 542 void SimulateKeyboardEvent(WebInputEvent::Type type) {
541 SimulateKeyboardEvent(type, 0); 543 SimulateKeyboardEvent(type, 0);
(...skipping 1079 matching lines...) Expand 10 before | Expand all | Expand 10 after
1621 blink::WebGestureDeviceTouchscreen, 1623 blink::WebGestureDeviceTouchscreen,
1622 ui::LatencyInfo()); 1624 ui::LatencyInfo());
1623 CheckLatencyInfoComponentInMessage( 1625 CheckLatencyInfoComponentInMessage(
1624 process_, GetLatencyComponentId(), WebInputEvent::GestureScrollUpdate); 1626 process_, GetLatencyComponentId(), WebInputEvent::GestureScrollUpdate);
1625 SendInputEventACK(WebInputEvent::GestureScrollUpdate, 1627 SendInputEventACK(WebInputEvent::GestureScrollUpdate,
1626 INPUT_EVENT_ACK_STATE_CONSUMED); 1628 INPUT_EVENT_ACK_STATE_CONSUMED);
1627 1629
1628 // Tests RWHI::ForwardTouchEventWithLatencyInfo(). 1630 // Tests RWHI::ForwardTouchEventWithLatencyInfo().
1629 PressTouchPoint(0, 1); 1631 PressTouchPoint(0, 1);
1630 uint32_t touch_event_id = SendTouchEvent(); 1632 uint32_t touch_event_id = SendTouchEvent();
1631 InputEventAck ack(WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED, 1633 InputEventAck ack(
1632 touch_event_id); 1634 InputEventAckLocation::INPUT_EVENT_ACK_LOCATION_COMPOSITOR_THREAD,
1635 WebInputEvent::TouchStart, INPUT_EVENT_ACK_STATE_CONSUMED,
1636 touch_event_id);
1633 host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack)); 1637 host_->OnMessageReceived(InputHostMsg_HandleInputEvent_ACK(0, ack));
1634 CheckLatencyInfoComponentInMessage( 1638 CheckLatencyInfoComponentInMessage(
1635 process_, GetLatencyComponentId(), WebInputEvent::TouchStart); 1639 process_, GetLatencyComponentId(), WebInputEvent::TouchStart);
1636 } 1640 }
1637 1641
1638 TEST_F(RenderWidgetHostTest, RendererExitedResetsInputRouter) { 1642 TEST_F(RenderWidgetHostTest, RendererExitedResetsInputRouter) {
1639 // RendererExited will delete the view. 1643 // RendererExited will delete the view.
1640 host_->SetView(new TestView(host_.get())); 1644 host_->SetView(new TestView(host_.get()));
1641 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1); 1645 host_->RendererExited(base::TERMINATION_STATUS_PROCESS_CRASHED, -1);
1642 1646
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
1707 ui::LatencyInfo()); 1711 ui::LatencyInfo());
1708 1712
1709 1713
1710 // Tests RWHI::ForwardWheelEventWithLatencyInfo(). 1714 // Tests RWHI::ForwardWheelEventWithLatencyInfo().
1711 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo()); 1715 SimulateWheelEventWithLatencyInfo(-5, 0, 0, true, ui::LatencyInfo());
1712 1716
1713 ASSERT_FALSE(host_->input_router()->HasPendingEvents()); 1717 ASSERT_FALSE(host_->input_router()->HasPendingEvents());
1714 } 1718 }
1715 1719
1716 } // namespace content 1720 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698