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

Side by Side Diff: chrome/test/nacl/nacl_browsertest_util.cc

Issue 724323002: Non-SFI mode: Enable browser_tests for nacl_helper_nonsfi. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
OLDNEW
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 #include "chrome/test/nacl/nacl_browsertest_util.h" 5 #include "chrome/test/nacl/nacl_browsertest_util.h"
6 6
7 #include <stdlib.h> 7 #include <stdlib.h>
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/json/json_reader.h" 9 #include "base/json/json_reader.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 base::FilePath::StringType NaClBrowserTestNonSfiMode::Variant() { 286 base::FilePath::StringType NaClBrowserTestNonSfiMode::Variant() {
287 return FILE_PATH_LITERAL("libc-free"); 287 return FILE_PATH_LITERAL("libc-free");
288 } 288 }
289 289
290 void NaClBrowserTestNonSfiMode::SetUpCommandLine( 290 void NaClBrowserTestNonSfiMode::SetUpCommandLine(
291 base::CommandLine* command_line) { 291 base::CommandLine* command_line) {
292 NaClBrowserTestBase::SetUpCommandLine(command_line); 292 NaClBrowserTestBase::SetUpCommandLine(command_line);
293 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); 293 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode);
294 } 294 }
295 295
296 void NaClBrowserTestTransitionalNonSfi::SetUpCommandLine(
297 base::CommandLine* command_line) {
298 NaClBrowserTestNonSfiMode::SetUpCommandLine(command_line);
299 command_line->AppendSwitch(switches::kUseNaClHelperNonSfi);
300 }
301
296 base::FilePath::StringType NaClBrowserTestStatic::Variant() { 302 base::FilePath::StringType NaClBrowserTestStatic::Variant() {
297 return FILE_PATH_LITERAL("static"); 303 return FILE_PATH_LITERAL("static");
298 } 304 }
299 305
300 bool NaClBrowserTestStatic::GetDocumentRoot(base::FilePath* document_root) { 306 bool NaClBrowserTestStatic::GetDocumentRoot(base::FilePath* document_root) {
301 *document_root = base::FilePath(FILE_PATH_LITERAL("chrome/test/data/nacl")); 307 *document_root = base::FilePath(FILE_PATH_LITERAL("chrome/test/data/nacl"));
302 return true; 308 return true;
303 } 309 }
304 310
305 base::FilePath::StringType NaClBrowserTestPnaclNonSfi::Variant() { 311 base::FilePath::StringType NaClBrowserTestPnaclNonSfi::Variant() {
306 return FILE_PATH_LITERAL("nonsfi"); 312 return FILE_PATH_LITERAL("nonsfi");
307 } 313 }
308 314
309 void NaClBrowserTestPnaclNonSfi::SetUpCommandLine( 315 void NaClBrowserTestPnaclNonSfi::SetUpCommandLine(
310 base::CommandLine* command_line) { 316 base::CommandLine* command_line) {
311 NaClBrowserTestBase::SetUpCommandLine(command_line); 317 NaClBrowserTestBase::SetUpCommandLine(command_line);
312 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); 318 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode);
313 } 319 }
314 320
321 void NaClBrowserTestPnaclTransitionalNonSfi::SetUpCommandLine(
322 base::CommandLine* command_line) {
323 NaClBrowserTestPnaclNonSfi::SetUpCommandLine(command_line);
324 command_line->AppendSwitch(switches::kUseNaClHelperNonSfi);
325 }
326
315 void NaClBrowserTestNewlibExtension::SetUpCommandLine( 327 void NaClBrowserTestNewlibExtension::SetUpCommandLine(
316 CommandLine* command_line) { 328 CommandLine* command_line) {
317 NaClBrowserTestBase::SetUpCommandLine(command_line); 329 NaClBrowserTestBase::SetUpCommandLine(command_line);
318 base::FilePath src_root; 330 base::FilePath src_root;
319 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_root)); 331 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_root));
320 332
321 // Extension-based tests should specialize the GetDocumentRoot() / Variant() 333 // Extension-based tests should specialize the GetDocumentRoot() / Variant()
322 // to point at the isolated the test extension directory. 334 // to point at the isolated the test extension directory.
323 // Otherwise, multiple NaCl extensions tests will end up sharing the 335 // Otherwise, multiple NaCl extensions tests will end up sharing the
324 // same directory when loading the extension files. 336 // same directory when loading the extension files.
(...skipping 15 matching lines...) Expand all
340 // to point at the isolated the test extension directory. 352 // to point at the isolated the test extension directory.
341 // Otherwise, multiple NaCl extensions tests will end up sharing the 353 // Otherwise, multiple NaCl extensions tests will end up sharing the
342 // same directory when loading the extension files. 354 // same directory when loading the extension files.
343 base::FilePath document_root; 355 base::FilePath document_root;
344 ASSERT_TRUE(GetDocumentRoot(&document_root)); 356 ASSERT_TRUE(GetDocumentRoot(&document_root));
345 357
346 // Document root is relative to source root, and source root may not be CWD. 358 // Document root is relative to source root, and source root may not be CWD.
347 command_line->AppendSwitchPath(switches::kLoadExtension, 359 command_line->AppendSwitchPath(switches::kLoadExtension,
348 src_root.Append(document_root)); 360 src_root.Append(document_root));
349 } 361 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698