| 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 EXPECT_TRUE(base::WaitForExitCode(pid, &code)); | 127 EXPECT_TRUE(base::WaitForExitCode(pid, &code)); |
| 128 EXPECT_EQ(0, code); | 128 EXPECT_EQ(0, code); |
| 129 | 129 |
| 130 [observer waitForNotification]; | 130 [observer waitForNotification]; |
| 131 EXPECT_EQ(1, [observer receivedCount]); | 131 EXPECT_EQ(1, [observer receivedCount]); |
| 132 EXPECT_EQ(pid, [[observer object] intValue]); | 132 EXPECT_EQ(pid, [[observer object] intValue]); |
| 133 } | 133 } |
| 134 | 134 |
| 135 // Run the test with the sandbox enabled without notifications on the policy | 135 // Run the test with the sandbox enabled without notifications on the policy |
| 136 // whitelist. | 136 // whitelist. |
| 137 // Disabled, http://crbug.com/407066 . | 137 TEST_F(BootstrapSandboxTest, DistributedNotifications_SandboxDeny) { |
| 138 TEST_F(BootstrapSandboxTest, DISABLED_DistributedNotifications_SandboxDeny) { | |
| 139 base::scoped_nsobject<DistributedNotificationObserver> observer( | 138 base::scoped_nsobject<DistributedNotificationObserver> observer( |
| 140 [[DistributedNotificationObserver alloc] init]); | 139 [[DistributedNotificationObserver alloc] init]); |
| 141 | 140 |
| 142 sandbox_->RegisterSandboxPolicy(1, BaselinePolicy()); | 141 sandbox_->RegisterSandboxPolicy(1, BaselinePolicy()); |
| 143 RunChildWithPolicy(1, kNotificationTestMain, NULL); | 142 RunChildWithPolicy(1, kNotificationTestMain, NULL); |
| 144 | 143 |
| 145 [observer waitForNotification]; | 144 [observer waitForNotification]; |
| 146 EXPECT_EQ(0, [observer receivedCount]); | 145 EXPECT_EQ(0, [observer receivedCount]); |
| 147 EXPECT_EQ(nil, [observer object]); | 146 EXPECT_EQ(nil, [observer object]); |
| 148 } | 147 } |
| (...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 kr = mach_msg_receive(&rcv_msg.header); | 510 kr = mach_msg_receive(&rcv_msg.header); |
| 512 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg_receive"; | 511 MACH_CHECK(kr == KERN_SUCCESS, kr) << "mach_msg_receive"; |
| 513 | 512 |
| 514 // Try to message the sandbox. | 513 // Try to message the sandbox. |
| 515 bootstrap_look_up(bootstrap_port, "test", &port); | 514 bootstrap_look_up(bootstrap_port, "test", &port); |
| 516 | 515 |
| 517 return 0; | 516 return 0; |
| 518 } | 517 } |
| 519 | 518 |
| 520 } // namespace sandbox | 519 } // namespace sandbox |
| OLD | NEW |