OLD | NEW |
| (Empty) |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_TEST_NACL_SECURITY_TESTS_COMMANDS_POSIX_H_ | |
6 #define CHROME_TEST_NACL_SECURITY_TESTS_COMMANDS_POSIX_H_ | |
7 #pragma once | |
8 | |
9 // TODO(jvoung): factor out the SboxTestResult from | |
10 // sandbox/tests/common/controller.h | |
11 // to make it OS independent. | |
12 | |
13 namespace sandbox { | |
14 | |
15 #define SEVERITY_INFO_FLAGS 0x40000000 | |
16 #define SEVERITY_ERROR_FLAGS 0xC0000000 | |
17 #define CUSTOMER_CODE 0x20000000 | |
18 #define SBOX_TESTS_FACILITY 0x05B10000 | |
19 | |
20 enum SboxTestResult { | |
21 SBOX_TEST_FIRST_RESULT = 8998, | |
22 SBOX_TEST_SUCCEEDED, | |
23 SBOX_TEST_PING_OK, | |
24 SBOX_TEST_FIRST_INFO = SBOX_TEST_FIRST_RESULT | SEVERITY_INFO_FLAGS, | |
25 SBOX_TEST_DENIED, // Access was denied. | |
26 SBOX_TEST_NOT_FOUND, // The resource was not found. | |
27 SBOX_TEST_FIRST_ERROR = SBOX_TEST_FIRST_RESULT | SEVERITY_ERROR_FLAGS, | |
28 SBOX_TEST_INVALID_PARAMETER, | |
29 SBOX_TEST_FAILED_TO_RUN_TEST, | |
30 SBOX_TEST_FAILED_TO_EXECUTE_COMMAND, | |
31 SBOX_TEST_TIMED_OUT, | |
32 SBOX_TEST_FAILED, | |
33 SBOX_TEST_LAST_RESULT | |
34 }; | |
35 | |
36 // Sandbox access tests for Mac and Linux | |
37 // (mimic'ing "sandbox/tests/validation_tests/commands.h") | |
38 | |
39 SboxTestResult TestOpenReadFile(const char* path); | |
40 | |
41 SboxTestResult TestOpenWriteFile(const char* path); | |
42 | |
43 SboxTestResult TestCreateProcess(const char* path); | |
44 | |
45 SboxTestResult TestConnect(const char* url); | |
46 | |
47 // Dummy test that returns SBOX_TEST_SUCCEEDED | |
48 // (so it fails, because everything should be denied). | |
49 SboxTestResult TestDummyFails(); | |
50 | |
51 } // namespace sandbox | |
52 | |
53 #endif // CHROME_TEST_NACL_SECURITY_TESTS_COMMANDS_POSIX_H_ | |
54 | |
OLD | NEW |