| 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 #include "chrome/test/ppapi/ppapi_test.h" | 5 #include "chrome/test/ppapi/ppapi_test.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/files/file_util.h" | 8 #include "base/files/file_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 327 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); | 327 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); |
| 328 } | 328 } |
| 329 | 329 |
| 330 void OutOfProcessPPAPIPrivateTest::SetUpCommandLine( | 330 void OutOfProcessPPAPIPrivateTest::SetUpCommandLine( |
| 331 base::CommandLine* command_line) { | 331 base::CommandLine* command_line) { |
| 332 OutOfProcessPPAPITest::SetUpCommandLine(command_line); | 332 OutOfProcessPPAPITest::SetUpCommandLine(command_line); |
| 333 AddPrivateSwitches(command_line); | 333 AddPrivateSwitches(command_line); |
| 334 } | 334 } |
| 335 | 335 |
| 336 void PPAPINaClTest::SetUpCommandLine(base::CommandLine* command_line) { | 336 void PPAPINaClTest::SetUpCommandLine(base::CommandLine* command_line) { |
| 337 PPAPITestBase::SetUpCommandLine(command_line); |
| 337 #if !defined(DISABLE_NACL) | 338 #if !defined(DISABLE_NACL) |
| 338 PPAPITestBase::SetUpCommandLine(command_line); | |
| 339 | |
| 340 // Enable running (non-portable) NaCl outside of the Chrome web store. | 339 // Enable running (non-portable) NaCl outside of the Chrome web store. |
| 341 command_line->AppendSwitch(switches::kEnableNaCl); | 340 command_line->AppendSwitch(switches::kEnableNaCl); |
| 342 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); | 341 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); |
| 343 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); | 342 command_line->AppendSwitch(switches::kUseFakeDeviceForMediaStream); |
| 344 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); | 343 command_line->AppendSwitch(switches::kUseFakeUIForMediaStream); |
| 345 #endif | 344 #endif |
| 346 } | 345 } |
| 347 | 346 |
| 348 void PPAPINaClTest::SetUpOnMainThread() { | 347 void PPAPINaClTest::SetUpOnMainThread() { |
| 349 } | 348 } |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 } | 419 } |
| 421 | 420 |
| 422 void PPAPIPrivateNaClPNaClTest::SetUpCommandLine( | 421 void PPAPIPrivateNaClPNaClTest::SetUpCommandLine( |
| 423 base::CommandLine* command_line) { | 422 base::CommandLine* command_line) { |
| 424 PPAPINaClPNaClTest::SetUpCommandLine(command_line); | 423 PPAPINaClPNaClTest::SetUpCommandLine(command_line); |
| 425 AddPrivateSwitches(command_line); | 424 AddPrivateSwitches(command_line); |
| 426 } | 425 } |
| 427 | 426 |
| 428 void PPAPINaClPNaClNonSfiTest::SetUpCommandLine( | 427 void PPAPINaClPNaClNonSfiTest::SetUpCommandLine( |
| 429 base::CommandLine* command_line) { | 428 base::CommandLine* command_line) { |
| 429 PPAPINaClTest::SetUpCommandLine(command_line); |
| 430 #if !defined(DISABLE_NACL) | 430 #if !defined(DISABLE_NACL) |
| 431 PPAPINaClTest::SetUpCommandLine(command_line); | |
| 432 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); | 431 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode); |
| 433 #endif | 432 #endif |
| 434 } | 433 } |
| 435 | 434 |
| 436 std::string PPAPINaClPNaClNonSfiTest::BuildQuery( | 435 std::string PPAPINaClPNaClNonSfiTest::BuildQuery( |
| 437 const std::string& base, | 436 const std::string& base, |
| 438 const std::string& test_case) { | 437 const std::string& test_case) { |
| 439 return base::StringPrintf("%smode=nacl_pnacl_nonsfi&testcase=%s", | 438 return base::StringPrintf("%smode=nacl_pnacl_nonsfi&testcase=%s", |
| 440 base.c_str(), test_case.c_str()); | 439 base.c_str(), test_case.c_str()); |
| 441 } | 440 } |
| 442 | 441 |
| 442 void PPAPINaClPNaClNaClHelperNonSfiTest::SetUpCommandLine( |
| 443 base::CommandLine* command_line) { |
| 444 PPAPINaClPNaClNonSfiTest::SetUpCommandLine(command_line); |
| 445 #if !defined(DISABLE_NACL) |
| 446 command_line->AppendSwitch(switches::kUseNaClHelperNonSfi); |
| 447 #endif |
| 448 } |
| 449 |
| 443 void PPAPIPrivateNaClPNaClNonSfiTest::SetUpCommandLine( | 450 void PPAPIPrivateNaClPNaClNonSfiTest::SetUpCommandLine( |
| 444 base::CommandLine* command_line) { | 451 base::CommandLine* command_line) { |
| 445 PPAPINaClPNaClNonSfiTest::SetUpCommandLine(command_line); | 452 PPAPINaClPNaClNonSfiTest::SetUpCommandLine(command_line); |
| 446 AddPrivateSwitches(command_line); | 453 AddPrivateSwitches(command_line); |
| 447 } | 454 } |
| 448 | 455 |
| 456 void PPAPIPrivateNaClPNaClNaClHelperNonSfiTest::SetUpCommandLine( |
| 457 base::CommandLine* command_line) { |
| 458 PPAPIPrivateNaClPNaClNonSfiTest::SetUpCommandLine(command_line); |
| 459 #if !defined(DISABLE_NACL) |
| 460 command_line->AppendSwitch(switches::kUseNaClHelperNonSfi); |
| 461 #endif |
| 462 } |
| 463 |
| 449 void PPAPINaClTestDisallowedSockets::SetUpCommandLine( | 464 void PPAPINaClTestDisallowedSockets::SetUpCommandLine( |
| 450 base::CommandLine* command_line) { | 465 base::CommandLine* command_line) { |
| 451 PPAPITestBase::SetUpCommandLine(command_line); | 466 PPAPITestBase::SetUpCommandLine(command_line); |
| 452 | 467 |
| 453 // Enable running (non-portable) NaCl outside of the Chrome web store. | 468 // Enable running (non-portable) NaCl outside of the Chrome web store. |
| 454 command_line->AppendSwitch(switches::kEnableNaCl); | 469 command_line->AppendSwitch(switches::kEnableNaCl); |
| 455 } | 470 } |
| 456 | 471 |
| 457 // Append the correct mode and testcase string | 472 // Append the correct mode and testcase string |
| 458 std::string PPAPINaClTestDisallowedSockets::BuildQuery( | 473 std::string PPAPINaClTestDisallowedSockets::BuildQuery( |
| 459 const std::string& base, | 474 const std::string& base, |
| 460 const std::string& test_case) { | 475 const std::string& test_case) { |
| 461 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 476 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
| 462 test_case.c_str()); | 477 test_case.c_str()); |
| 463 } | 478 } |
| 464 | 479 |
| 465 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 480 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
| 466 // The default content setting for the PPAPI broker is ASK. We purposefully | 481 // The default content setting for the PPAPI broker is ASK. We purposefully |
| 467 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 482 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
| 468 } | 483 } |
| OLD | NEW |