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

Unified Diff: sandbox/mac/bootstrap_sandbox_unittest.mm

Issue 1346923006: Refactor the bootstrap sandbox process launching integration. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: RevokeToken Created 5 years, 3 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sandbox/mac/bootstrap_sandbox.cc ('k') | sandbox/mac/pre_exec_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sandbox/mac/bootstrap_sandbox_unittest.mm
diff --git a/sandbox/mac/bootstrap_sandbox_unittest.mm b/sandbox/mac/bootstrap_sandbox_unittest.mm
index 1eaf4c99fff6a7e10769982bd6e6a4050751783a..467189e134fa9fd74b9f8dc6756bda4ff3f34451 100644
--- a/sandbox/mac/bootstrap_sandbox_unittest.mm
+++ b/sandbox/mac/bootstrap_sandbox_unittest.mm
@@ -18,6 +18,7 @@
#include "base/strings/stringprintf.h"
#include "base/test/multiprocess_test.h"
#include "base/test/test_timeouts.h"
+#include "sandbox/mac/pre_exec_delegate.h"
#include "sandbox/mac/xpc.h"
#import "testing/gtest_mac.h"
#include "testing/multiprocess_func_list.h"
@@ -104,12 +105,14 @@ class BootstrapSandboxTest : public base::MultiProcessTest {
void RunChildWithPolicy(int policy_id,
const char* child_name,
base::ProcessHandle* out_pid) {
- sandbox_->PrepareToForkWithPolicy(policy_id);
+ scoped_ptr<PreExecDelegate> pre_exec_delegate(
+ sandbox_->NewClient(policy_id));
+
base::LaunchOptions options;
- options.replacement_bootstrap_name = sandbox_->server_bootstrap_name();
+ options.pre_exec_delegate = pre_exec_delegate.get();
+
base::Process process = SpawnChildWithOptions(child_name, options);
ASSERT_TRUE(process.IsValid());
- sandbox_->FinishedFork(process.Handle());
int code = 0;
EXPECT_TRUE(process.WaitForExit(&code));
EXPECT_EQ(0, code);
@@ -453,12 +456,12 @@ TEST_F(BootstrapSandboxTest, ChildOutliveSandbox) {
sandbox_->RegisterSandboxPolicy(kTestPolicyId, policy);
// Launch the child.
- sandbox_->PrepareToForkWithPolicy(kTestPolicyId);
+ scoped_ptr<PreExecDelegate> pre_exec_delegate(
+ sandbox_->NewClient(kTestPolicyId));
base::LaunchOptions options;
- options.replacement_bootstrap_name = sandbox_->server_bootstrap_name();
+ options.pre_exec_delegate = pre_exec_delegate.get();
base::Process process = SpawnChildWithOptions("ChildOutliveSandbox", options);
ASSERT_TRUE(process.IsValid());
- sandbox_->FinishedFork(process.Handle());
// Synchronize with the child.
mach_msg_empty_rcv_t rcv_msg;
« no previous file with comments | « sandbox/mac/bootstrap_sandbox.cc ('k') | sandbox/mac/pre_exec_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698