| 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 245 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 RunTestURL(url); | 256 RunTestURL(url); |
| 257 } | 257 } |
| 258 | 258 |
| 259 PPAPITest::PPAPITest() { | 259 PPAPITest::PPAPITest() { |
| 260 } | 260 } |
| 261 | 261 |
| 262 void PPAPITest::SetUpCommandLine(CommandLine* command_line) { | 262 void PPAPITest::SetUpCommandLine(CommandLine* command_line) { |
| 263 PPAPITestBase::SetUpCommandLine(command_line); | 263 PPAPITestBase::SetUpCommandLine(command_line); |
| 264 | 264 |
| 265 // Append the switch to register the pepper plugin. | 265 // Append the switch to register the pepper plugin. |
| 266 // library name = <out dir>/<test_name>.<library_extension> | 266 // library path = <out dir>/<test_name>.<library_extension> |
| 267 // MIME type = application/x-ppapi-<test_name> | 267 // library name = "PPAPI Tests" |
| 268 // version = "1.2.3" |
| 269 // MIME type = "application/x-ppapi-tests" |
| 268 FilePath plugin_dir; | 270 FilePath plugin_dir; |
| 269 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); | 271 EXPECT_TRUE(PathService::Get(base::DIR_MODULE, &plugin_dir)); |
| 270 | 272 |
| 271 FilePath plugin_lib = plugin_dir.Append(library_name); | 273 FilePath plugin_lib = plugin_dir.Append(library_name); |
| 272 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 274 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 273 FilePath::StringType pepper_plugin = plugin_lib.value(); | 275 FilePath::StringType pepper_plugin = plugin_lib.value(); |
| 276 pepper_plugin.append(FILE_PATH_LITERAL("#PPAPI Tests")); |
| 277 pepper_plugin.append(FILE_PATH_LITERAL("#")); // No description. |
| 278 pepper_plugin.append(FILE_PATH_LITERAL("#1.2.3")); |
| 274 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | 279 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
| 275 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, | 280 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
| 276 pepper_plugin); | 281 pepper_plugin); |
| 277 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); | 282 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); |
| 278 } | 283 } |
| 279 | 284 |
| 280 std::string PPAPITest::BuildQuery(const std::string& base, | 285 std::string PPAPITest::BuildQuery(const std::string& base, |
| 281 const std::string& test_case){ | 286 const std::string& test_case){ |
| 282 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); | 287 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); |
| 283 } | 288 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 const std::string& base, | 340 const std::string& base, |
| 336 const std::string& test_case) { | 341 const std::string& test_case) { |
| 337 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 342 return StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
| 338 test_case.c_str()); | 343 test_case.c_str()); |
| 339 } | 344 } |
| 340 | 345 |
| 341 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 346 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
| 342 // The default content setting for the PPAPI broker is ASK. We purposefully | 347 // The default content setting for the PPAPI broker is ASK. We purposefully |
| 343 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 348 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
| 344 } | 349 } |
| OLD | NEW |