OLD | NEW |
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 "sandbox/mac/bootstrap_sandbox.h" | 5 #include "sandbox/mac/bootstrap_sandbox.h" |
6 | 6 |
7 #include <CoreFoundation/CoreFoundation.h> | 7 #include <CoreFoundation/CoreFoundation.h> |
8 #import <Foundation/Foundation.h> | 8 #import <Foundation/Foundation.h> |
9 #include <mach/mach.h> | 9 #include <mach/mach.h> |
10 #include <servers/bootstrap.h> | 10 #include <servers/bootstrap.h> |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 CFRunLoopStop(CFRunLoopGetCurrent()); | 73 CFRunLoopStop(CFRunLoopGetCurrent()); |
74 } | 74 } |
75 @end | 75 @end |
76 | 76 |
77 //////////////////////////////////////////////////////////////////////////////// | 77 //////////////////////////////////////////////////////////////////////////////// |
78 | 78 |
79 namespace sandbox { | 79 namespace sandbox { |
80 | 80 |
81 class BootstrapSandboxTest : public base::MultiProcessTest { | 81 class BootstrapSandboxTest : public base::MultiProcessTest { |
82 public: | 82 public: |
83 virtual void SetUp() OVERRIDE { | 83 virtual void SetUp() override { |
84 base::MultiProcessTest::SetUp(); | 84 base::MultiProcessTest::SetUp(); |
85 | 85 |
86 sandbox_ = BootstrapSandbox::Create(); | 86 sandbox_ = BootstrapSandbox::Create(); |
87 ASSERT_TRUE(sandbox_.get()); | 87 ASSERT_TRUE(sandbox_.get()); |
88 } | 88 } |
89 | 89 |
90 BootstrapSandboxPolicy BaselinePolicy() { | 90 BootstrapSandboxPolicy BaselinePolicy() { |
91 BootstrapSandboxPolicy policy; | 91 BootstrapSandboxPolicy policy; |
92 if (base::mac::IsOSSnowLeopard()) | 92 if (base::mac::IsOSSnowLeopard()) |
93 policy.rules["com.apple.SecurityServer"] = Rule(POLICY_ALLOW); | 93 policy.rules["com.apple.SecurityServer"] = Rule(POLICY_ALLOW); |
(...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 kr = mach_msg_receive(&rcv_msg.header); | 510 kr = mach_msg_receive(&rcv_msg.header); |
511 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg_receive"; | 511 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg_receive"; |
512 | 512 |
513 // Try to message the sandbox. | 513 // Try to message the sandbox. |
514 bootstrap_look_up(bootstrap_port, "test", &port); | 514 bootstrap_look_up(bootstrap_port, "test", &port); |
515 | 515 |
516 return 0; | 516 return 0; |
517 } | 517 } |
518 | 518 |
519 } // namespace sandbox | 519 } // namespace sandbox |
OLD | NEW |