Commit 372db79b authored by jochen@chromium.org's avatar jochen@chromium.org

Check for NULL pointer before assigning the test data

BUG=none
TEST=MacSandboxTest.FileAccess works when run alone


Review URL: http://codereview.chromium.org/8608005

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@111197 0039d316-1c4b-4281-b951-d872f2087c98
parent 2f7381f1
......@@ -47,7 +47,8 @@ class MacSandboxTest : public base::MultiProcessTest {
public:
// Runs a test specified by |test_name| in a sandbox of the type specified
// by |sandbox_type|. |test_data| is a custom string that a test can pass
// to the child process runing in the sandbox.
// to the child process runing in the sandbox, or NULL if additional data is
// required.
// Returns true if the test passes, false if either of the functions in
// the corresponding MacSandboxTestCase return false.
bool RunTestInSandbox(sandbox::Sandbox::SandboxProcessType sandbox_type,
......
......@@ -148,7 +148,8 @@ MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) {
LOG(ERROR) << "Invalid sandbox test name (" << sandbox_test_name << ")";
return -1;
}
test_case->SetTestData(test_data);
if (test_data)
test_case->SetTestData(test_data);
// Run Test.
if (!test_case->BeforeSandboxInit()) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment