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

Side by Side Diff: ipc/ipc_channel_unittest.cc

Issue 818833004: Remove deprecated methods from Pickle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('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) 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #endif 9 #endif
10 10
(...skipping 21 matching lines...) Expand all
32 EXPECT_TRUE(m.WriteInt(v1)); 32 EXPECT_TRUE(m.WriteInt(v1));
33 EXPECT_TRUE(m.WriteString(v2)); 33 EXPECT_TRUE(m.WriteString(v2));
34 EXPECT_TRUE(m.WriteWString(v3)); 34 EXPECT_TRUE(m.WriteWString(v3));
35 35
36 PickleIterator iter(m); 36 PickleIterator iter(m);
37 37
38 int vi; 38 int vi;
39 std::string vs; 39 std::string vs;
40 std::wstring vw; 40 std::wstring vw;
41 41
42 EXPECT_TRUE(m.ReadInt(&iter, &vi)); 42 EXPECT_TRUE(iter.ReadInt(&vi));
43 EXPECT_EQ(v1, vi); 43 EXPECT_EQ(v1, vi);
44 44
45 EXPECT_TRUE(m.ReadString(&iter, &vs)); 45 EXPECT_TRUE(iter.ReadString(&vs));
46 EXPECT_EQ(v2, vs); 46 EXPECT_EQ(v2, vs);
47 47
48 EXPECT_TRUE(m.ReadWString(&iter, &vw)); 48 EXPECT_TRUE(iter.ReadWString(&vw));
49 EXPECT_EQ(v3, vw); 49 EXPECT_EQ(v3, vw);
50 50
51 // should fail 51 // should fail
52 EXPECT_FALSE(m.ReadInt(&iter, &vi)); 52 EXPECT_FALSE(iter.ReadInt(&vi));
53 EXPECT_FALSE(m.ReadString(&iter, &vs)); 53 EXPECT_FALSE(iter.ReadString(&vs));
54 EXPECT_FALSE(m.ReadWString(&iter, &vw)); 54 EXPECT_FALSE(iter.ReadWString(&vw));
55 } 55 }
56 56
57 TEST_F(IPCChannelTest, ChannelTest) { 57 TEST_F(IPCChannelTest, ChannelTest) {
58 Init("GenericClient"); 58 Init("GenericClient");
59 59
60 // Set up IPC channel and start client. 60 // Set up IPC channel and start client.
61 IPC::TestChannelListener listener; 61 IPC::TestChannelListener listener;
62 CreateChannel(&listener); 62 CreateChannel(&listener);
63 listener.Init(sender()); 63 listener.Init(sender());
64 ASSERT_TRUE(ConnectChannel()); 64 ASSERT_TRUE(ConnectChannel());
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 &listener)); 193 &listener));
194 CHECK(channel->Connect()); 194 CHECK(channel->Connect());
195 listener.Init(channel.get()); 195 listener.Init(channel.get());
196 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child"); 196 IPC::TestChannelListener::SendOneMessage(channel.get(), "hello from child");
197 197
198 base::MessageLoop::current()->Run(); 198 base::MessageLoop::current()->Run();
199 return 0; 199 return 0;
200 } 200 }
201 201
202 } // namespace 202 } // namespace
OLDNEW
« no previous file with comments | « ipc/ipc_channel_posix.cc ('k') | ipc/ipc_fuzzing_tests.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698