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