Index: sandbox/win/tests/common/controller.cc |
diff --git a/sandbox/win/tests/common/controller.cc b/sandbox/win/tests/common/controller.cc |
index 8d3e29dd9600bf643b55cdc46b01d2fe89a70baa..4d877135bb4e4bdd11dd5abd028f2bb9f09fbc37 100644 |
--- a/sandbox/win/tests/common/controller.cc |
+++ b/sandbox/win/tests/common/controller.cc |
@@ -94,17 +94,28 @@ TestRunner::TestRunner(JobLevel job_level, TokenLevel startup_token, |
TokenLevel main_token) |
: is_init_(false), is_async_(false), no_sandbox_(false), |
target_process_id_(0) { |
- Init(job_level, startup_token, main_token); |
+ Init(job_level, startup_token, main_token, false); |
+} |
+ |
+TestRunner::TestRunner(bool enable_create_process) |
+ : is_init_(false), |
+ is_async_(false), |
+ no_sandbox_(false), |
+ target_process_id_(0) { |
+ Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN, |
+ enable_create_process); |
} |
TestRunner::TestRunner() |
: is_init_(false), is_async_(false), no_sandbox_(false), |
target_process_id_(0) { |
- Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN); |
+ Init(JOB_LOCKDOWN, USER_RESTRICTED_SAME_ACCESS, USER_LOCKDOWN, false); |
} |
-void TestRunner::Init(JobLevel job_level, TokenLevel startup_token, |
- TokenLevel main_token) { |
+void TestRunner::Init(JobLevel job_level, |
+ TokenLevel startup_token, |
+ TokenLevel main_token, |
+ bool enable_create_process) { |
broker_ = NULL; |
policy_ = NULL; |
timeout_ = kDefaultTimeout; |
@@ -124,9 +135,11 @@ void TestRunner::Init(JobLevel job_level, TokenLevel startup_token, |
policy_->SetJobLevel(job_level, 0); |
policy_->SetTokenLevel(startup_token, main_token); |
- // Close all ALPC ports. |
- if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
- policy_->AddKernelObjectToClose(L"ALPC Port", NULL); |
+ if (!enable_create_process) { |
Will Harris
2016/01/25 19:32:36
Can this not be moved to InternalRunTest and a new
penny
2016/01/26 22:37:10
Done. Excellent idea. For some reason I didn't c
|
+ // Close all ALPC ports. |
+ if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
+ policy_->AddKernelObjectToClose(L"ALPC Port", NULL); |
+ } |
} |
is_init_ = true; |