Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(95)

Side by Side Diff: content/common/sandbox_mac_unittest_helper.mm

Issue 10387218: Make GlobalDescriptors::MaybeGet return -1 when the key is not found. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Modifying the MULTIPROCESS_TEST_MAIN macro so it can be passed a setup method. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 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 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 "content/common/sandbox_mac_unittest_helper.h" 5 #include "content/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 107 matching lines...) Expand 10 before | Expand all | Expand 10 after
118 118
119 return it->second; 119 return it->second;
120 } 120 }
121 121
122 } // namespace sandboxtest 122 } // namespace sandboxtest
123 123
124 namespace { 124 namespace {
125 125
126 // Main function for driver process that enables the sandbox and runs test 126 // Main function for driver process that enables the sandbox and runs test
127 // code. 127 // code.
128 MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner) { 128 MULTIPROCESS_TEST_MAIN(mac_sandbox_test_runner, NULL) {
129 TestContentClient content_client; 129 TestContentClient content_client;
130 content::SetContentClient(&content_client); 130 content::SetContentClient(&content_client);
131 // Extract parameters. 131 // Extract parameters.
132 char* sandbox_type_str = getenv(kSandboxTypeKey); 132 char* sandbox_type_str = getenv(kSandboxTypeKey);
133 if (!sandbox_type_str) { 133 if (!sandbox_type_str) {
134 LOG(ERROR) << "Sandbox type not specified"; 134 LOG(ERROR) << "Sandbox type not specified";
135 return -1; 135 return -1;
136 } 136 }
137 content::SandboxType sandbox_type = 137 content::SandboxType sandbox_type =
138 static_cast<content::SandboxType>(atoi(sandbox_type_str)); 138 static_cast<content::SandboxType>(atoi(sandbox_type_str));
(...skipping 30 matching lines...) Expand all
169 169
170 if (!test_case->SandboxedTest()) { 170 if (!test_case->SandboxedTest()) {
171 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test"; 171 LOG(ERROR) << sandbox_test_name << "Failed sandboxed test";
172 return -1; 172 return -1;
173 } 173 }
174 174
175 return 0; 175 return 0;
176 } 176 }
177 177
178 } // namespace 178 } // namespace
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698