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

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

Issue 19670007: Send input event's LatencyInfo back from renderer to browser when acked (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fix compile error in immediate_input_router_unittest.cc Created 7 years, 4 months 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 "base/basictypes.h" 5 #include "base/basictypes.h"
6 #include "base/memory/scoped_ptr.h" 6 #include "base/memory/scoped_ptr.h"
7 #include "base/memory/shared_memory.h" 7 #include "base/memory/shared_memory.h"
8 #include "base/timer/timer.h" 8 #include "base/timer/timer.h"
9 #include "content/browser/browser_thread_impl.h" 9 #include "content/browser/browser_thread_impl.h"
10 #include "content/browser/renderer_host/backing_store.h" 10 #include "content/browser/renderer_host/backing_store.h"
(...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 screen_.reset(); 661 screen_.reset();
662 #endif 662 #endif
663 663
664 // Process all pending tasks to avoid leaks. 664 // Process all pending tasks to avoid leaks.
665 base::MessageLoop::current()->RunUntilIdle(); 665 base::MessageLoop::current()->RunUntilIdle();
666 } 666 }
667 667
668 void SendInputEventACK(WebInputEvent::Type type, 668 void SendInputEventACK(WebInputEvent::Type type,
669 InputEventAckState ack_result) { 669 InputEventAckState ack_result) {
670 scoped_ptr<IPC::Message> response( 670 scoped_ptr<IPC::Message> response(
671 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result)); 671 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result,
672 ui::LatencyInfo()));
672 host_->OnMessageReceived(*response); 673 host_->OnMessageReceived(*response);
673 } 674 }
674 675
675 void SimulateKeyboardEvent(WebInputEvent::Type type) { 676 void SimulateKeyboardEvent(WebInputEvent::Type type) {
676 NativeWebKeyboardEvent key_event; 677 NativeWebKeyboardEvent key_event;
677 key_event.type = type; 678 key_event.type = type;
678 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value. 679 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value.
679 host_->ForwardKeyboardEvent(key_event); 680 host_->ForwardKeyboardEvent(key_event);
680 } 681 }
681 682
(...skipping 1885 matching lines...) Expand 10 before | Expand all | Expand 10 after
2567 2568
2568 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) { 2569 TEST_F(RenderWidgetHostTest, InputRouterReceivesHasTouchEventHandlers) {
2569 host_->SetupForInputRouterTest(); 2570 host_->SetupForInputRouterTest();
2570 2571
2571 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true)); 2572 host_->OnMessageReceived(ViewHostMsg_HasTouchEventHandlers(0, true));
2572 2573
2573 EXPECT_TRUE(host_->mock_input_router()->message_received_); 2574 EXPECT_TRUE(host_->mock_input_router()->message_received_);
2574 } 2575 }
2575 2576
2576 } // namespace content 2577 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698