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