| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ | 5 #ifndef CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ |
| 6 #define CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ | 6 #define CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ |
| 7 | 7 |
| 8 #include "base/test/multiprocess_test.h" | 8 #include "base/test/multiprocess_test.h" |
| 9 #include "content/common/sandbox_mac.h" | 9 #include "content/common/sandbox_mac.h" |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 const char* test_name, | 53 const char* test_name, |
| 54 const char* test_data); | 54 const char* test_data); |
| 55 | 55 |
| 56 // Runs the test specified by |test_name| in all the different sandbox types | 56 // Runs the test specified by |test_name| in all the different sandbox types |
| 57 // known to content, one by one. | 57 // known to content, one by one. |
| 58 // Returns true if the test passes, false if either of the functions in | 58 // Returns true if the test passes, false if either of the functions in |
| 59 // the corresponding MacSandboxTestCase return false in any of the spawned | 59 // the corresponding MacSandboxTestCase return false in any of the spawned |
| 60 // processes. | 60 // processes. |
| 61 // | 61 // |
| 62 // DANGER DANGER DANGER: | 62 // DANGER DANGER DANGER: |
| 63 // Additional sandbox types defined by the embedder (e.g. the NaCL sandbox) | 63 // Additional sandbox types defined by the embedder (e.g. the NaCl sandbox) |
| 64 // won't be covered by these tests. | 64 // won't be covered by these tests. |
| 65 bool RunTestInAllSandboxTypes(const char* test_name, | 65 bool RunTestInAllSandboxTypes(const char* test_name, |
| 66 const char* test_data); | 66 const char* test_data); |
| 67 }; | 67 }; |
| 68 | 68 |
| 69 // Class to ease writing test cases that run inside the OS X sandbox. | 69 // Class to ease writing test cases that run inside the OS X sandbox. |
| 70 // This class is instantiated in a subprocess, and allows you to run test code | 70 // This class is instantiated in a subprocess, and allows you to run test code |
| 71 // at various stages of execution. | 71 // at various stages of execution. |
| 72 // Note that you must register the subclass you create with the | 72 // Note that you must register the subclass you create with the |
| 73 // REGISTER_SANDBOX_TEST_CASE so it's visible to the test driver. | 73 // REGISTER_SANDBOX_TEST_CASE so it's visible to the test driver. |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 namespace { \ | 111 namespace { \ |
| 112 content::internal::RegisterSandboxTest<class_name> \ | 112 content::internal::RegisterSandboxTest<class_name> \ |
| 113 register_test##class_name(#class_name); \ | 113 register_test##class_name(#class_name); \ |
| 114 } // namespace | 114 } // namespace |
| 115 | 115 |
| 116 } // namespace internal | 116 } // namespace internal |
| 117 | 117 |
| 118 } // namespace content | 118 } // namespace content |
| 119 | 119 |
| 120 #endif // CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ | 120 #endif // CONTENT_COMMON_SANDBOX_MAC_UNITTEST_HELPER_H_ |
| OLD | NEW |