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

Side by Side Diff: ipc/ipc_message_utils_unittest.cc

Issue 2484943004: Remove unused parts of IPC::ChannelHandle. (Closed)
Patch Set: rebase Created 4 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 unified diff | Download patch
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | ppapi/nacl_irt/irt_start.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 "ipc/ipc_message_utils.h" 5 #include "ipc/ipc_message_utils.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <memory> 9 #include <memory>
10 10
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 IPC::Message message; 143 IPC::Message message;
144 IPC::WriteParam(&message, channel_handle); 144 IPC::WriteParam(&message, channel_handle);
145 145
146 base::PickleSizer sizer; 146 base::PickleSizer sizer;
147 IPC::GetParamSize(&sizer, channel_handle); 147 IPC::GetParamSize(&sizer, channel_handle);
148 EXPECT_EQ(sizer.payload_size(), message.payload_size()); 148 EXPECT_EQ(sizer.payload_size(), message.payload_size());
149 149
150 base::PickleIterator iter(message); 150 base::PickleIterator iter(message);
151 IPC::ChannelHandle result_handle; 151 IPC::ChannelHandle result_handle;
152 EXPECT_TRUE(IPC::ReadParam(&message, &iter, &result_handle)); 152 EXPECT_TRUE(IPC::ReadParam(&message, &iter, &result_handle));
153 EXPECT_TRUE(result_handle.name.empty());
154 #if defined(OS_POSIX)
155 EXPECT_EQ(-1, result_handle.socket.fd);
156 #elif defined(OS_WIN)
157 EXPECT_EQ(nullptr, result_handle.pipe.handle);
158 #endif
159 EXPECT_EQ(channel_handle.mojo_handle, result_handle.mojo_handle); 153 EXPECT_EQ(channel_handle.mojo_handle, result_handle.mojo_handle);
160 } 154 }
161 155
162 TEST(IPCMessageUtilsTest, OptionalUnset) { 156 TEST(IPCMessageUtilsTest, OptionalUnset) {
163 base::Optional<int> opt; 157 base::Optional<int> opt;
164 base::Pickle pickle; 158 base::Pickle pickle;
165 IPC::WriteParam(&pickle, opt); 159 IPC::WriteParam(&pickle, opt);
166 160
167 base::PickleSizer sizer; 161 base::PickleSizer sizer;
168 IPC::GetParamSize(&sizer, opt); 162 IPC::GetParamSize(&sizer, opt);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 EXPECT_EQ(token.ToString(), log); 209 EXPECT_EQ(token.ToString(), log);
216 210
217 base::UnguessableToken deserialized_token; 211 base::UnguessableToken deserialized_token;
218 base::PickleIterator iter(pickle); 212 base::PickleIterator iter(pickle);
219 EXPECT_TRUE(IPC::ReadParam(&pickle, &iter, &deserialized_token)); 213 EXPECT_TRUE(IPC::ReadParam(&pickle, &iter, &deserialized_token));
220 EXPECT_EQ(token, deserialized_token); 214 EXPECT_EQ(token, deserialized_token);
221 } 215 }
222 216
223 } // namespace 217 } // namespace
224 } // namespace IPC 218 } // namespace IPC
OLDNEW
« no previous file with comments | « ipc/ipc_message_utils.cc ('k') | ppapi/nacl_irt/irt_start.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698