summaryrefslogtreecommitdiffstats
path: root/sandbox/tests/common/controller.h
diff options
context:
space:
mode:
Diffstat (limited to 'sandbox/tests/common/controller.h')
-rw-r--r--sandbox/tests/common/controller.h15
1 files changed, 14 insertions, 1 deletions
diff --git a/sandbox/tests/common/controller.h b/sandbox/tests/common/controller.h
index 3f1d0c2..0a78a0e 100644
--- a/sandbox/tests/common/controller.h
+++ b/sandbox/tests/common/controller.h
@@ -1,4 +1,4 @@
-// Copyright (c) 2006-2010 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,6 +8,7 @@
#include <windows.h>
#include <string>
+#include "base/win/scoped_handle.h"
#include "sandbox/src/sandbox.h"
namespace sandbox {
@@ -91,6 +92,9 @@ class TestRunner {
// Sets the timeout value for the child to run the command and return.
void SetTimeout(DWORD timeout_ms);
+ // Sets TestRunner to return without waiting for the process to exit.
+ void SetAsynchronous(bool is_async) { is_async_ = is_async; }
+
// Sets the desired state for the test to run.
void SetTestState(SboxTestsState desired_state);
@@ -98,6 +102,12 @@ class TestRunner {
// the policy manually.
TargetPolicy* GetPolicy();
+ // Return the process handle for an asynchronous test.
+ HANDLE process() { return target_process_; }
+
+ // Return the process ID for an asynchronous test.
+ DWORD process_id() { return target_process_id_; }
+
private:
// Initializes the data in the object. Sets is_init_ to tree if the
// function succeeds. This is meant to be called from the constructor.
@@ -112,6 +122,9 @@ class TestRunner {
DWORD timeout_;
SboxTestsState state_;
bool is_init_;
+ bool is_async_;
+ base::win::ScopedHandle target_process_;
+ DWORD target_process_id_;
};
// Returns the broker services.