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/common/sandbox_mac_unittest_helper.h" | 5 #include "chrome/common/sandbox_mac_unittest_helper.h" |
6 | 6 |
7 extern "C" { | 7 extern "C" { |
8 #include <sandbox.h> | 8 #include <sandbox.h> |
9 } | 9 } |
10 | 10 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
43 SandboxTestMap& test_map = GetSandboxTestMap(); | 43 SandboxTestMap& test_map = GetSandboxTestMap(); |
44 if (test_map.find(test_name) != test_map.end()) { | 44 if (test_map.find(test_name) != test_map.end()) { |
45 LOG(ERROR) << "Trying to register duplicate test" << test_name; | 45 LOG(ERROR) << "Trying to register duplicate test" << test_name; |
46 NOTREACHED(); | 46 NOTREACHED(); |
47 } | 47 } |
48 test_map[test_name] = test_class; | 48 test_map[test_name] = test_class; |
49 } | 49 } |
50 | 50 |
51 } // namespace internal | 51 } // namespace internal |
52 | 52 |
53 bool MacSandboxTest:: RunTestInAllSandboxTypes(const char* test_name, | 53 bool MacSandboxTest::RunTestInAllSandboxTypes(const char* test_name, |
54 const char* test_data) { | 54 const char* test_data) { |
55 // Go through all the sandbox types, and run the test case in each of them | 55 // Go through all the sandbox types, and run the test case in each of them |
56 // if one fails, abort. | 56 // if one fails, abort. |
57 for(int i = static_cast<int>(Sandbox::SANDBOX_TYPE_FIRST_TYPE); | 57 for(int i = static_cast<int>(Sandbox::SANDBOX_TYPE_FIRST_TYPE); |
58 i < Sandbox::SANDBOX_AFTER_TYPE_LAST_TYPE; | 58 i < Sandbox::SANDBOX_AFTER_TYPE_LAST_TYPE; |
59 ++i) { | 59 ++i) { |
60 | |
61 if (i == Sandbox::SANDBOX_TYPE_GPU) { | |
62 // TODO(thakis): Remove this once the gpu sandbox is more restricted. | |
63 // http://crbug.com/48607 | |
jeremy
2010/12/02 08:33:56
Could you please add a note to the bug to remove t
| |
64 continue; | |
65 } | |
66 | |
60 if (!RunTestInSandbox(static_cast<Sandbox::SandboxProcessType>(i), | 67 if (!RunTestInSandbox(static_cast<Sandbox::SandboxProcessType>(i), |
61 test_name, test_data)) { | 68 test_name, test_data)) { |
62 LOG(ERROR) << "Sandboxed test (" << test_name << ")" << | 69 LOG(ERROR) << "Sandboxed test (" << test_name << ")" << |
63 "Failed in sandbox type " << i << | 70 "Failed in sandbox type " << i << |
64 "user data: (" << test_data << ")"; | 71 "user data: (" << test_data << ")"; |
65 return false; | 72 return false; |
66 } | 73 } |
67 } | 74 } |
68 return true; | 75 return true; |
69 } | 76 } |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
152 | 159 |
153 if (!test_case->SandboxedTest()) { | 160 if (!test_case->SandboxedTest()) { |
154 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; | 161 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; |
155 return -1; | 162 return -1; |
156 } | 163 } |
157 | 164 |
158 return 0; | 165 return 0; |
159 } | 166 } |
160 | 167 |
161 } // namespace | 168 } // namespace |
OLD | NEW |