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

Unified Diff: ipc/ipc_fuzzing_tests.cc

Issue 57783006: Revert https://src.chromium.org/viewvc/chrome?view=rev&revision=231330 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix compile (cc perftest). Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ipc/ipc_fuzzing_tests.cc
diff --git a/ipc/ipc_fuzzing_tests.cc b/ipc/ipc_fuzzing_tests.cc
index 07ff8d9f886dd4cb15e4ace5c72f4b3d67bf3f2c..3d2d497c5f89cb99b814598f0d968cbf66eba724 100644
--- a/ipc/ipc_fuzzing_tests.cc
+++ b/ipc/ipc_fuzzing_tests.cc
@@ -38,7 +38,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferStr) {
//This was BUG 984408.
uint32 v1 = kuint32max - 1;
int v2 = 666;
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(v1));
EXPECT_TRUE(m.WriteInt(v2));
@@ -51,7 +51,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferWStr) {
//This was BUG 984408.
uint32 v1 = kuint32max - 1;
int v2 = 777;
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(v1));
EXPECT_TRUE(m.WriteInt(v2));
@@ -62,7 +62,7 @@ TEST(IPCMessageIntegrity, ReadBeyondBufferWStr) {
TEST(IPCMessageIntegrity, ReadBytesBadIterator) {
// This was BUG 1035467.
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(1));
EXPECT_TRUE(m.WriteInt(2));
@@ -75,7 +75,7 @@ TEST(IPCMessageIntegrity, ReadVectorNegativeSize) {
// A slight variation of BUG 984408. Note that the pickling of vector<char>
// has a specialized template which is not vulnerable to this bug. So here
// try to hit the non-specialized case vector<P>.
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(-1)); // This is the count of elements.
EXPECT_TRUE(m.WriteInt(1));
EXPECT_TRUE(m.WriteInt(2));
@@ -89,7 +89,7 @@ TEST(IPCMessageIntegrity, ReadVectorNegativeSize) {
TEST(IPCMessageIntegrity, ReadVectorTooLarge1) {
// This was BUG 1006367. This is the large but positive length case. Again
// we try to hit the non-specialized case vector<P>.
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(0x21000003)); // This is the count of elements.
EXPECT_TRUE(m.WriteInt64(1));
EXPECT_TRUE(m.WriteInt64(2));
@@ -103,7 +103,7 @@ TEST(IPCMessageIntegrity, ReadVectorTooLarge2) {
// This was BUG 1006367. This is the large but positive with an additional
// integer overflow when computing the actual byte size. Again we try to hit
// the non-specialized case vector<P>.
- IPC::Message m(0, 1);
+ IPC::Message m(0, 1, IPC::Message::PRIORITY_NORMAL);
EXPECT_TRUE(m.WriteInt(0x71000000)); // This is the count of elements.
EXPECT_TRUE(m.WriteInt64(1));
EXPECT_TRUE(m.WriteInt64(2));
@@ -164,7 +164,8 @@ class FuzzerServerListener : public SimpleListener {
}
bool RoundtripAckReply(int routing, uint32 type_id, int reply) {
- IPC::Message* message = new IPC::Message(routing, type_id);
+ IPC::Message* message = new IPC::Message(routing, type_id,
+ IPC::Message::PRIORITY_NORMAL);
message->WriteInt(reply + 1);
message->WriteInt(reply);
return other_->Send(message);
@@ -297,7 +298,8 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadShort) {
ASSERT_TRUE(ConnectChannel());
ASSERT_TRUE(StartClient());
- IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID);
+ IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID,
+ IPC::Message::PRIORITY_NORMAL);
msg->WriteInt(666);
sender()->Send(msg);
EXPECT_TRUE(listener.ExpectMsgNotHandled(MsgClassIS::ID));
@@ -324,7 +326,8 @@ TEST_F(IPCFuzzingTest, MsgBadPayloadArgs) {
ASSERT_TRUE(ConnectChannel());
ASSERT_TRUE(StartClient());
- IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID);
+ IPC::Message* msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID,
+ IPC::Message::PRIORITY_NORMAL);
msg->WriteWString(L"d");
msg->WriteInt(0);
msg->WriteInt(0x65); // Extra argument.
@@ -390,12 +393,14 @@ TEST_F(IPCFuzzingTest, MsgMapExMacro) {
#if defined(NDEBUG) && !defined(DCHECK_ALWAYS_ON)
// Test a bad message.
- msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID);
+ msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassSI::ID,
+ IPC::Message::PRIORITY_NORMAL);
msg->WriteInt(2);
EXPECT_FALSE(server.OnMessageReceived(*msg));
delete msg;
- msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID);
+ msg = new IPC::Message(MSG_ROUTING_CONTROL, MsgClassIS::ID,
+ IPC::Message::PRIORITY_NORMAL);
msg->WriteInt(0x64);
msg->WriteInt(0x32);
EXPECT_FALSE(server.OnMessageReceived(*msg));
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_logging.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698