| 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/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 | 314 |
| 315 void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { | 315 void PPAPINaClTest::SetUpCommandLine(CommandLine* command_line) { |
| 316 PPAPITestBase::SetUpCommandLine(command_line); | 316 PPAPITestBase::SetUpCommandLine(command_line); |
| 317 | 317 |
| 318 base::FilePath plugin_lib; | 318 base::FilePath plugin_lib; |
| 319 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 319 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
| 320 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 320 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 321 | 321 |
| 322 // Enable running NaCl outside of the store. | 322 // Enable running NaCl outside of the store. |
| 323 command_line->AppendSwitch(switches::kEnableNaCl); | 323 command_line->AppendSwitch(switches::kEnableNaCl); |
| 324 command_line->AppendSwitch(switches::kEnablePnacl); |
| 324 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); | 325 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); |
| 325 } | 326 } |
| 326 | 327 |
| 327 // Append the correct mode and testcase string | 328 // Append the correct mode and testcase string |
| 328 std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base, | 329 std::string PPAPINaClNewlibTest::BuildQuery(const std::string& base, |
| 329 const std::string& test_case) { | 330 const std::string& test_case) { |
| 330 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 331 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
| 331 test_case.c_str()); | 332 test_case.c_str()); |
| 332 } | 333 } |
| 333 | 334 |
| 334 // Append the correct mode and testcase string | 335 // Append the correct mode and testcase string |
| 335 std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base, | 336 std::string PPAPINaClGLibcTest::BuildQuery(const std::string& base, |
| 336 const std::string& test_case) { | 337 const std::string& test_case) { |
| 337 return StringPrintf("%smode=nacl_glibc&testcase=%s", base.c_str(), | 338 return StringPrintf("%smode=nacl_glibc&testcase=%s", base.c_str(), |
| 338 test_case.c_str()); | 339 test_case.c_str()); |
| 339 } | 340 } |
| 340 | 341 |
| 342 // Append the correct mode and testcase string |
| 343 std::string PPAPINaClPNaClTest::BuildQuery(const std::string& base, |
| 344 const std::string& test_case) { |
| 345 return StringPrintf("%smode=nacl_pnacl&testcase=%s", base.c_str(), |
| 346 test_case.c_str()); |
| 347 } |
| 348 |
| 341 void PPAPINaClTestDisallowedSockets::SetUpCommandLine( | 349 void PPAPINaClTestDisallowedSockets::SetUpCommandLine( |
| 342 CommandLine* command_line) { | 350 CommandLine* command_line) { |
| 343 PPAPITestBase::SetUpCommandLine(command_line); | 351 PPAPITestBase::SetUpCommandLine(command_line); |
| 344 | 352 |
| 345 base::FilePath plugin_lib; | 353 base::FilePath plugin_lib; |
| 346 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 354 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
| 347 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 355 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 348 | 356 |
| 349 // Enable running NaCl outside of the store. | 357 // Enable running NaCl outside of the store. |
| 350 command_line->AppendSwitch(switches::kEnableNaCl); | 358 command_line->AppendSwitch(switches::kEnableNaCl); |
| 359 command_line->AppendSwitch(switches::kEnablePnacl); |
| 351 } | 360 } |
| 352 | 361 |
| 353 // Append the correct mode and testcase string | 362 // Append the correct mode and testcase string |
| 354 std::string PPAPINaClTestDisallowedSockets::BuildQuery( | 363 std::string PPAPINaClTestDisallowedSockets::BuildQuery( |
| 355 const std::string& base, | 364 const std::string& base, |
| 356 const std::string& test_case) { | 365 const std::string& test_case) { |
| 357 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 366 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
| 358 test_case.c_str()); | 367 test_case.c_str()); |
| 359 } | 368 } |
| 360 | 369 |
| 361 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 370 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
| 362 // The default content setting for the PPAPI broker is ASK. We purposefully | 371 // The default content setting for the PPAPI broker is ASK. We purposefully |
| 363 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 372 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
| 364 } | 373 } |
| OLD | NEW |