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

Side by Side Diff: ipc/ipc_message_unittest.cc

Issue 5749001: Add support for sockets that can listen and accept a connection. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix up use of DCHECK which was causing release build failures Created 10 years 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 | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_switches.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "ipc/ipc_message.h"
6
5 #include <string.h> 7 #include <string.h>
6 8
7 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
8 #include "base/values.h" 10 #include "base/values.h"
9 #include "ipc/ipc_message.h"
10 #include "ipc/ipc_message_utils.h" 11 #include "ipc/ipc_message_utils.h"
11 #include "testing/gtest/include/gtest/gtest.h" 12 #include "testing/gtest/include/gtest/gtest.h"
12 13
13 TEST(IPCMessageTest, ListValue) { 14 TEST(IPCMessageTest, ListValue) {
14 ListValue input; 15 ListValue input;
15 input.Set(0, Value::CreateRealValue(42.42)); 16 input.Set(0, Value::CreateRealValue(42.42));
16 input.Set(1, Value::CreateStringValue("forty")); 17 input.Set(1, Value::CreateStringValue("forty"));
17 input.Set(2, Value::CreateNullValue()); 18 input.Set(2, Value::CreateNullValue());
18 19
19 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL); 20 IPC::Message msg(1, 2, IPC::Message::PRIORITY_NORMAL);
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
58 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output)); 59 EXPECT_TRUE(IPC::ReadParam(&msg, &iter, &output));
59 60
60 EXPECT_TRUE(input.Equals(&output)); 61 EXPECT_TRUE(input.Equals(&output));
61 62
62 // Also test the corrupt case. 63 // Also test the corrupt case.
63 IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL); 64 IPC::Message bad_msg(1, 2, IPC::Message::PRIORITY_NORMAL);
64 bad_msg.WriteInt(99); 65 bad_msg.WriteInt(99);
65 iter = NULL; 66 iter = NULL;
66 EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output)); 67 EXPECT_FALSE(IPC::ReadParam(&bad_msg, &iter, &output));
67 } 68 }
OLDNEW
« no previous file with comments | « ipc/ipc_channel_win.cc ('k') | ipc/ipc_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698