summaryrefslogtreecommitdiffstats
path: root/ipc/attachment_broker_privileged_mac_unittest.cc
diff options
context:
space:
mode:
authoramistry <amistry@chromium.org>2016-03-11 20:51:43 -0800
committerCommit bot <commit-bot@chromium.org>2016-03-12 04:53:54 +0000
commite04cef7c43dc8c9562f41e3fc51fef73f48da05a (patch)
tree679a8faa9ee91fd07fd2456e8d9f624682c11b68 /ipc/attachment_broker_privileged_mac_unittest.cc
parent5dbc89896ef3ed45ec4f2d7d761d53e6ba2dc60e (diff)
downloadchromium_src-e04cef7c43dc8c9562f41e3fc51fef73f48da05a.zip
chromium_src-e04cef7c43dc8c9562f41e3fc51fef73f48da05a.tar.gz
chromium_src-e04cef7c43dc8c9562f41e3fc51fef73f48da05a.tar.bz2
Move mach code shared by Chrome IPC and Mojo to //base/mac.
BUG=582468 Review URL: https://codereview.chromium.org/1778203002 Cr-Commit-Position: refs/heads/master@{#380855}
Diffstat (limited to 'ipc/attachment_broker_privileged_mac_unittest.cc')
-rw-r--r--ipc/attachment_broker_privileged_mac_unittest.cc18
1 files changed, 11 insertions, 7 deletions
diff --git a/ipc/attachment_broker_privileged_mac_unittest.cc b/ipc/attachment_broker_privileged_mac_unittest.cc
index 15aecb6..dbecc73 100644
--- a/ipc/attachment_broker_privileged_mac_unittest.cc
+++ b/ipc/attachment_broker_privileged_mac_unittest.cc
@@ -14,6 +14,7 @@
#include "base/command_line.h"
#include "base/mac/mac_util.h"
#include "base/mac/mach_logging.h"
+#include "base/mac/mach_port_util.h"
#include "base/mac/scoped_mach_port.h"
#include "base/macros.h"
#include "base/memory/shared_memory.h"
@@ -198,9 +199,10 @@ TEST_F(AttachmentBrokerPrivilegedMacMultiProcessTest, InsertRight) {
// port.
IncrementMachRefCount(shared_memory->handle().GetMemoryObject(),
MACH_PORT_RIGHT_SEND);
- mach_port_name_t inserted_memory_object = broker.CreateIntermediateMachPort(
- client_task_port_.get(), base::mac::ScopedMachSendRight(
- shared_memory->handle().GetMemoryObject()));
+ mach_port_name_t inserted_memory_object = base::CreateIntermediateMachPort(
+ client_task_port_.get(),
+ base::mac::ScopedMachSendRight(shared_memory->handle().GetMemoryObject()),
+ nullptr);
EXPECT_NE(inserted_memory_object,
static_cast<mach_port_name_t>(MACH_PORT_NULL));
SendUInt32(client_port_.get(), inserted_memory_object);
@@ -266,10 +268,11 @@ TEST_F(AttachmentBrokerPrivilegedMacMultiProcessTest, InsertSameRightTwice) {
for (int i = 0; i < 2; ++i) {
IncrementMachRefCount(shared_memory->handle().GetMemoryObject(),
MACH_PORT_RIGHT_SEND);
- mach_port_name_t inserted_memory_object = broker.CreateIntermediateMachPort(
+ mach_port_name_t inserted_memory_object = base::CreateIntermediateMachPort(
client_task_port_.get(),
base::mac::ScopedMachSendRight(
- shared_memory->handle().GetMemoryObject()));
+ shared_memory->handle().GetMemoryObject()),
+ nullptr);
EXPECT_NE(inserted_memory_object,
static_cast<mach_port_name_t>(MACH_PORT_NULL));
SendUInt32(client_port_.get(), inserted_memory_object);
@@ -362,10 +365,11 @@ TEST_F(AttachmentBrokerPrivilegedMacMultiProcessTest, InsertTwoRights) {
// port.
IncrementMachRefCount(shared_memory->handle().GetMemoryObject(),
MACH_PORT_RIGHT_SEND);
- mach_port_name_t inserted_memory_object = broker.CreateIntermediateMachPort(
+ mach_port_name_t inserted_memory_object = base::CreateIntermediateMachPort(
client_task_port_.get(),
base::mac::ScopedMachSendRight(
- shared_memory->handle().GetMemoryObject()));
+ shared_memory->handle().GetMemoryObject()),
+ nullptr);
EXPECT_NE(inserted_memory_object,
static_cast<mach_port_name_t>(MACH_PORT_NULL));
SendUInt32(client_port_.get(), inserted_memory_object);