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 #import <Cocoa/Cocoa.h> | 5 #import <Cocoa/Cocoa.h> |
6 | 6 |
7 #include "base/files/file_util.h" | 7 #include "base/files/file_util.h" |
8 #include "base/files/scoped_file.h" | 8 #include "base/files/scoped_file.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
149 TEST_F(MacSandboxTest, OpenSSLAccess) { | 149 TEST_F(MacSandboxTest, OpenSSLAccess) { |
150 EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedOpenSSLTestCase", NULL)); | 150 EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedOpenSSLTestCase", NULL)); |
151 } | 151 } |
152 | 152 |
153 #else // !defined(USE_OPENSSL) | 153 #else // !defined(USE_OPENSSL) |
154 | 154 |
155 //--------------------- NSS Sandboxing ---------------------- | 155 //--------------------- NSS Sandboxing ---------------------- |
156 // Test case for checking sandboxing of NSS initialization. | 156 // Test case for checking sandboxing of NSS initialization. |
157 class MacSandboxedNSSTestCase : public MacSandboxTestCase { | 157 class MacSandboxedNSSTestCase : public MacSandboxTestCase { |
158 public: | 158 public: |
159 virtual bool SandboxedTest() override; | 159 bool SandboxedTest() override; |
160 }; | 160 }; |
161 | 161 |
162 REGISTER_SANDBOX_TEST_CASE(MacSandboxedNSSTestCase); | 162 REGISTER_SANDBOX_TEST_CASE(MacSandboxedNSSTestCase); |
163 | 163 |
164 bool MacSandboxedNSSTestCase::SandboxedTest() { | 164 bool MacSandboxedNSSTestCase::SandboxedTest() { |
165 // If NSS cannot read from /dev/urandom, NSS initialization will call abort(), | 165 // If NSS cannot read from /dev/urandom, NSS initialization will call abort(), |
166 // which will cause this test case to fail. | 166 // which will cause this test case to fail. |
167 crypto::ForceNSSNoDBInit(); | 167 crypto::ForceNSSNoDBInit(); |
168 crypto::EnsureNSSInit(); | 168 crypto::EnsureNSSInit(); |
169 return true; | 169 return true; |
170 } | 170 } |
171 | 171 |
172 TEST_F(MacSandboxTest, NSSAccess) { | 172 TEST_F(MacSandboxTest, NSSAccess) { |
173 EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedNSSTestCase", NULL)); | 173 EXPECT_TRUE(RunTestInAllSandboxTypes("MacSandboxedNSSTestCase", NULL)); |
174 } | 174 } |
175 | 175 |
176 #endif // defined(USE_OPENSSL) | 176 #endif // defined(USE_OPENSSL) |
177 | 177 |
178 } // namespace content | 178 } // namespace content |
OLD | NEW |