OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/test/nacl/nacl_sandbox_test.h" | 5 #include "chrome/test/nacl/nacl_sandbox_test.h" |
6 | 6 |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
9 #include "chrome/common/chrome_switches.h" | 9 #include "chrome/common/chrome_switches.h" |
10 | 10 |
11 namespace { | 11 namespace { |
12 | 12 |
13 // Base url is specified in nacl_test. | 13 // Base url is specified in nacl_test. |
14 const FilePath::CharType kSrpcHwHtmlFileName[] = | 14 const FilePath::CharType kSrpcHwHtmlFileName[] = |
15 FILE_PATH_LITERAL("srpc_hw.html"); | 15 FILE_PATH_LITERAL("srpc_hw.html"); |
16 | 16 |
17 } // anonymous namespace | 17 } // anonymous namespace |
18 | 18 |
19 NaClSandboxTest::NaClSandboxTest() : NaClTest() { | 19 NaClSandboxTest::NaClSandboxTest() : NaClTest() { |
20 // Append the --test-nacl-sandbox=$TESTDLL flag before launching. | 20 // Append the --test-nacl-sandbox=$TESTDLL flag before launching. |
21 FilePath dylibDir; | 21 FilePath dylib_dir; |
22 PathService::Get(base::DIR_EXE, &dylibDir); | 22 PathService::Get(base::DIR_EXE, &dylib_dir); |
23 #if defined(OS_MACOSX) | 23 #if defined(OS_MACOSX) |
24 dylibDir = dylibDir.AppendASCII("libnacl_security_tests.dylib"); | 24 dylib_dir = dylib_dir.AppendASCII("libnacl_security_tests.dylib"); |
25 launch_arguments_.AppendSwitchWithValue(switches::kTestNaClSandbox, | 25 launch_arguments_.AppendSwitchPath(switches::kTestNaClSandbox, dylib_dir); |
26 dylibDir.value()); | |
27 #elif defined(OS_WIN) | 26 #elif defined(OS_WIN) |
28 // Let the NaCl process detect if it is 64-bit or not and hack on | 27 // Let the NaCl process detect if it is 64-bit or not and hack on |
29 // the appropriate suffix to this dll. | 28 // the appropriate suffix to this dll. |
30 dylibDir = dylibDir.AppendASCII("nacl_security_tests"); | 29 dylib_dir = dylib_dir.AppendASCII("nacl_security_tests"); |
31 launch_arguments_.AppendSwitchWithValue(switches::kTestNaClSandbox, | 30 launch_arguments_.AppendSwitchPath(switches::kTestNaClSandbox, dylib_dir); |
32 dylibDir.value()); | |
33 #elif defined(OS_LINUX) | 31 #elif defined(OS_LINUX) |
34 // We currently do not test the Chrome Linux SUID or seccomp sandboxes. | 32 // We currently do not test the Chrome Linux SUID or seccomp sandboxes. |
35 #endif | 33 #endif |
36 } | 34 } |
37 | 35 |
38 NaClSandboxTest::~NaClSandboxTest() {} | 36 NaClSandboxTest::~NaClSandboxTest() {} |
39 | 37 |
40 // http://crbug.com/50121 | 38 // http://crbug.com/50121 |
41 TEST_F(NaClSandboxTest, FLAKY_NaClOuterSBTest) { | 39 TEST_F(NaClSandboxTest, FLAKY_NaClOuterSBTest) { |
42 // Load a helloworld .nexe to trigger the nacl loader test. | 40 // Load a helloworld .nexe to trigger the nacl loader test. |
43 FilePath test_file(kSrpcHwHtmlFileName); | 41 FilePath test_file(kSrpcHwHtmlFileName); |
44 RunTest(test_file, action_max_timeout_ms()); | 42 RunTest(test_file, action_max_timeout_ms()); |
45 } | 43 } |
OLD | NEW |