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

Side by Side Diff: ipc/mojo/ipc_channel_mojo_unittest.cc

Issue 1659003003: IPC::Message -> base::Pickle (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: one more mac fix Created 4 years, 10 months 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/mach_port_mac.cc ('k') | ipc/mojo/ipc_mojo_message_helper.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/mojo/ipc_channel_mojo.h" 5 #include "ipc/mojo/ipc_channel_mojo.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 360 matching lines...) Expand 10 before | Expand all | Expand 10 after
371 IPC::Message* message = 371 IPC::Message* message =
372 new IPC::Message(0, 2, IPC::Message::PRIORITY_NORMAL); 372 new IPC::Message(0, 2, IPC::Message::PRIORITY_NORMAL);
373 WriteFile(message, file); 373 WriteFile(message, file);
374 WritePipe(message, pipe); 374 WritePipe(message, pipe);
375 ASSERT_TRUE(sender->Send(message)); 375 ASSERT_TRUE(sender->Send(message));
376 } 376 }
377 377
378 static void ReadReceivedFile(const IPC::Message& message, 378 static void ReadReceivedFile(const IPC::Message& message,
379 base::PickleIterator* iter) { 379 base::PickleIterator* iter) {
380 base::ScopedFD fd; 380 base::ScopedFD fd;
381 scoped_refptr<IPC::MessageAttachment> attachment; 381 scoped_refptr<base::Pickle::Attachment> attachment;
382 EXPECT_TRUE(message.ReadAttachment(iter, &attachment)); 382 EXPECT_TRUE(message.ReadAttachment(iter, &attachment));
383 base::File file(attachment->TakePlatformFile()); 383 base::File file(static_cast<IPC::MessageAttachment*>(attachment.get())
384 ->TakePlatformFile());
384 std::string content(GetSendingFileContent().size(), ' '); 385 std::string content(GetSendingFileContent().size(), ' ');
385 file.Read(0, &content[0], content.size()); 386 file.Read(0, &content[0], content.size());
386 EXPECT_EQ(content, GetSendingFileContent()); 387 EXPECT_EQ(content, GetSendingFileContent());
387 } 388 }
388 #endif 389 #endif
389 }; 390 };
390 391
391 class ListenerThatExpectsMessagePipe : public IPC::Listener { 392 class ListenerThatExpectsMessagePipe : public IPC::Listener {
392 public: 393 public:
393 ListenerThatExpectsMessagePipe() : sender_(NULL) {} 394 ListenerThatExpectsMessagePipe() : sender_(NULL) {}
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after
853 base::MessageLoop::current()->Run(); 854 base::MessageLoop::current()->Run();
854 855
855 client.Close(); 856 client.Close();
856 857
857 return 0; 858 return 0;
858 } 859 }
859 860
860 #endif // OS_LINUX 861 #endif // OS_LINUX
861 862
862 } // namespace 863 } // namespace
OLDNEW
« no previous file with comments | « ipc/mach_port_mac.cc ('k') | ipc/mojo/ipc_mojo_message_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698