diff options
author | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 17:17:43 +0000 |
---|---|---|
committer | cpu@google.com <cpu@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-07-17 17:17:43 +0000 |
commit | 8faa5a1c0c37564198f3cfd1b65c6635c3062fb6 (patch) | |
tree | 68d53e1c6228109cbd915b0ce1143ee7fe77e225 /chrome/browser/renderer_host/test | |
parent | e0f289391c66c1888b6cd5d3f2c05f298a0dd3a0 (diff) | |
download | chromium_src-8faa5a1c0c37564198f3cfd1b65c6635c3062fb6.zip chromium_src-8faa5a1c0c37564198f3cfd1b65c6635c3062fb6.tar.gz chromium_src-8faa5a1c0c37564198f3cfd1b65c6635c3062fb6.tar.bz2 |
More bad ipc message handling for RenderWidgetHost
- For input handling so far
BUG=16673
TEST=unit test included
Review URL: http://codereview.chromium.org/155613
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20962 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/renderer_host/test')
-rw-r--r-- | chrome/browser/renderer_host/test/render_view_host_unittest.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/browser/renderer_host/test/render_view_host_unittest.cc b/chrome/browser/renderer_host/test/render_view_host_unittest.cc index f07f270..259634f 100644 --- a/chrome/browser/renderer_host/test/render_view_host_unittest.cc +++ b/chrome/browser/renderer_host/test/render_view_host_unittest.cc @@ -44,4 +44,17 @@ TEST_F(RenderViewHostTest, BadMessageHandlerRenderWidgetHost) { EXPECT_EQ(1, process()->bad_msg_count()); } +// Test that OnMsgInputEventAck() detects bad messages. +TEST_F(RenderViewHostTest, BadMessageHandlerInputEventAck) { + EXPECT_EQ(0, process()->bad_msg_count()); + // ViewHostMsg_HandleInputEvent_ACK is defined taking 0 params but + // the code actually expects it to have at least one int para, this this + // bogus message will not fail at de-serialization but should fail in + // OnMsgInputEventAck() processing. + IPC::Message message(0, ViewHostMsg_HandleInputEvent_ACK::ID, + IPC::Message::PRIORITY_NORMAL); + rvh()->TestOnMessageReceived(message); + EXPECT_EQ(1, process()->bad_msg_count()); +} + #endif // NDEBUG |