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

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

Issue 8089002: Input event filtering and compositor thread setup. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 2 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 | Annotate | Revision Log
« no previous file with comments | « content/browser/renderer_host/render_widget_host.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "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/shared_memory.h" 7 #include "base/shared_memory.h"
8 #include "base/timer.h" 8 #include "base/timer.h"
9 #include "content/browser/browser_thread.h" 9 #include "content/browser/browser_thread.h"
10 #include "content/browser/renderer_host/backing_store.h" 10 #include "content/browser/renderer_host/backing_store.h"
(...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 host_.reset(); 261 host_.reset();
262 process_ = NULL; 262 process_ = NULL;
263 browser_context_.reset(); 263 browser_context_.reset();
264 264
265 // Process all pending tasks to avoid leaks. 265 // Process all pending tasks to avoid leaks.
266 MessageLoop::current()->RunAllPending(); 266 MessageLoop::current()->RunAllPending();
267 } 267 }
268 268
269 void SendInputEventACK(WebInputEvent::Type type, bool processed) { 269 void SendInputEventACK(WebInputEvent::Type type, bool processed) {
270 scoped_ptr<IPC::Message> response( 270 scoped_ptr<IPC::Message> response(
271 new ViewHostMsg_HandleInputEvent_ACK(0)); 271 new ViewHostMsg_HandleInputEvent_ACK(0, type, processed));
272 response->WriteInt(type);
273 response->WriteBool(processed);
274 host_->OnMessageReceived(*response); 272 host_->OnMessageReceived(*response);
275 } 273 }
276 274
277 void SimulateKeyboardEvent(WebInputEvent::Type type) { 275 void SimulateKeyboardEvent(WebInputEvent::Type type) {
278 NativeWebKeyboardEvent key_event; 276 NativeWebKeyboardEvent key_event;
279 key_event.type = type; 277 key_event.type = type;
280 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value. 278 key_event.windowsKeyCode = ui::VKEY_L; // non-null made up value.
281 host_->ForwardKeyboardEvent(key_event); 279 host_->ForwardKeyboardEvent(key_event);
282 } 280 }
283 281
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after
722 // Start it again to ensure it still works. 720 // Start it again to ensure it still works.
723 EXPECT_FALSE(host_->unresponsive_timer_fired()); 721 EXPECT_FALSE(host_->unresponsive_timer_fired());
724 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10)); 722 host_->StartHangMonitorTimeout(TimeDelta::FromMilliseconds(10));
725 723
726 // Wait long enough for first timeout and see if it fired. 724 // Wait long enough for first timeout and see if it fired.
727 MessageLoop::current()->PostDelayedTask(FROM_HERE, 725 MessageLoop::current()->PostDelayedTask(FROM_HERE,
728 new MessageLoop::QuitTask(), 10); 726 new MessageLoop::QuitTask(), 10);
729 MessageLoop::current()->Run(); 727 MessageLoop::current()->Run();
730 EXPECT_TRUE(host_->unresponsive_timer_fired()); 728 EXPECT_TRUE(host_->unresponsive_timer_fired());
731 } 729 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host.cc ('k') | content/common/view_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698