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

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: rebase & remove CrackMessage() 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 696 matching lines...) Expand 10 before | Expand all | Expand 10 after
707 screen_.reset(); 707 screen_.reset();
708 #endif 708 #endif
709 709
710 // Process all pending tasks to avoid leaks. 710 // Process all pending tasks to avoid leaks.
711 base::MessageLoop::current()->RunUntilIdle(); 711 base::MessageLoop::current()->RunUntilIdle();
712 } 712 }
713 713
714 void SendInputEventACK(WebInputEvent::Type type, 714 void SendInputEventACK(WebInputEvent::Type type,
715 InputEventAckState ack_result) { 715 InputEventAckState ack_result) {
716 scoped_ptr<IPC::Message> response( 716 scoped_ptr<IPC::Message> response(
717 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result)); 717 new InputHostMsg_HandleInputEvent_ACK(0, type, ack_result,
718 ui::LatencyInfo()));
718 host_->OnMessageReceived(*response); 719 host_->OnMessageReceived(*response);
719 } 720 }
720 721
721 void SimulateKeyboardEvent(WebInputEvent::Type type) { 722 void SimulateKeyboardEvent(WebInputEvent::Type type) {
722 NativeWebKeyboardEvent key_event; 723 NativeWebKeyboardEvent key_event;
723 key_event.type = type; 724 key_event.type = type;
724 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value. 725 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value.
725 host_->ForwardKeyboardEvent(key_event); 726 host_->ForwardKeyboardEvent(key_event);
726 } 727 }
727 728
(...skipping 3524 matching lines...) Expand 10 before | Expand all | Expand 10 after
4252 EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->completed_mode()); 4253 EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->completed_mode());
4253 4254
4254 SimulateGestureEvent(WebInputEvent::GestureScrollEnd, 4255 SimulateGestureEvent(WebInputEvent::GestureScrollEnd,
4255 WebGestureEvent::Touchscreen); 4256 WebGestureEvent::Touchscreen);
4256 EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->current_mode()); 4257 EXPECT_EQ(OVERSCROLL_NONE, host_->overscroll_delegate()->current_mode());
4257 EXPECT_EQ(OVERSCROLL_EAST, host_->overscroll_delegate()->completed_mode()); 4258 EXPECT_EQ(OVERSCROLL_EAST, host_->overscroll_delegate()->completed_mode());
4258 process_->sink().ClearMessages(); 4259 process_->sink().ClearMessages();
4259 } 4260 }
4260 4261
4261 } // namespace content 4262 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698