| OLD | NEW |
| 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 "base/file_util.h" | 5 #include "base/file_util.h" |
| 6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
| 7 #include "base/test/test_timeouts.h" | 7 #include "base/test/test_timeouts.h" |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 #include "content/browser/plugin_service.h" | 9 #include "content/browser/plugin_service.h" |
| 10 #include "content/public/common/content_switches.h" | 10 #include "content/public/common/content_switches.h" |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 163 // MIME type = application/x-ppapi-<test_name> | 163 // MIME type = application/x-ppapi-<test_name> |
| 164 FilePath plugin_dir; | 164 FilePath plugin_dir; |
| 165 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &plugin_dir)); | 165 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &plugin_dir)); |
| 166 | 166 |
| 167 FilePath plugin_lib = plugin_dir.Append(library_name); | 167 FilePath plugin_lib = plugin_dir.Append(library_name); |
| 168 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 168 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 169 FilePath::StringType pepper_plugin = plugin_lib.value(); | 169 FilePath::StringType pepper_plugin = plugin_lib.value(); |
| 170 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | 170 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
| 171 launch_arguments_.AppendSwitchNative(switches::kRegisterPepperPlugins, | 171 launch_arguments_.AppendSwitchNative(switches::kRegisterPepperPlugins, |
| 172 pepper_plugin); | 172 pepper_plugin); |
| 173 launch_arguments_.AppendSwitchASCII(switches::kAllowNaClSocketAPI, | |
| 174 "127.0.0.1"); | |
| 175 } | 173 } |
| 176 | 174 |
| 177 std::string BuildQuery(const std::string& base, | 175 std::string BuildQuery(const std::string& base, |
| 178 const std::string& test_case){ | 176 const std::string& test_case){ |
| 179 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); | 177 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); |
| 180 } | 178 } |
| 181 | 179 |
| 182 }; | 180 }; |
| 183 | 181 |
| 184 // Variant of PPAPITest that runs plugins out-of-process to test proxy | 182 // Variant of PPAPITest that runs plugins out-of-process to test proxy |
| 185 // codepaths. | 183 // codepaths. |
| 186 class OutOfProcessPPAPITest : public PPAPITest { | 184 class OutOfProcessPPAPITest : public PPAPITest { |
| 187 public: | 185 public: |
| 188 OutOfProcessPPAPITest() { | 186 OutOfProcessPPAPITest() { |
| 189 // Run PPAPI out-of-process to exercise proxy implementations. | 187 // Run PPAPI out-of-process to exercise proxy implementations. |
| 190 launch_arguments_.AppendSwitch(switches::kPpapiOutOfProcess); | 188 launch_arguments_.AppendSwitch(switches::kPpapiOutOfProcess); |
| 191 } | 189 } |
| 192 }; | 190 }; |
| 193 | 191 |
| 194 // NaCl plugin test runner. | 192 // NaCl plugin test runner. |
| 195 class PPAPINaClTest : public PPAPITestBase { | 193 class PPAPINaClTest : public PPAPITestBase { |
| 196 public: | 194 public: |
| 197 PPAPINaClTest() { | 195 PPAPINaClTest() { |
| 198 FilePath plugin_lib; | 196 FilePath plugin_lib; |
| 199 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 197 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
| 200 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 198 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 201 | 199 |
| 202 // Enable running NaCl outside of the store. | 200 // Enable running NaCl outside of the store. |
| 203 launch_arguments_.AppendSwitch(switches::kEnableNaCl); | 201 launch_arguments_.AppendSwitch(switches::kEnableNaCl); |
| 204 launch_arguments_.AppendSwitchASCII(switches::kAllowNaClSocketAPI, | |
| 205 "127.0.0.1"); | |
| 206 } | 202 } |
| 207 | 203 |
| 208 // Append the correct mode and testcase string | 204 // Append the correct mode and testcase string |
| 209 std::string BuildQuery(const std::string& base, | 205 std::string BuildQuery(const std::string& base, |
| 210 const std::string& test_case) { | 206 const std::string& test_case) { |
| 211 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), | 207 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), |
| 212 test_case.c_str()); | 208 test_case.c_str()); |
| 213 } | 209 } |
| 214 }; | 210 }; |
| 215 | 211 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) | 284 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) |
| 289 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) | 285 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) |
| 290 | 286 |
| 291 TEST_PPAPI_IN_PROCESS(ImageData) | 287 TEST_PPAPI_IN_PROCESS(ImageData) |
| 292 TEST_PPAPI_OUT_OF_PROCESS(ImageData) | 288 TEST_PPAPI_OUT_OF_PROCESS(ImageData) |
| 293 TEST_PPAPI_NACL_VIA_HTTP(ImageData) | 289 TEST_PPAPI_NACL_VIA_HTTP(ImageData) |
| 294 | 290 |
| 295 TEST_PPAPI_IN_PROCESS(Buffer) | 291 TEST_PPAPI_IN_PROCESS(Buffer) |
| 296 TEST_PPAPI_OUT_OF_PROCESS(Buffer) | 292 TEST_PPAPI_OUT_OF_PROCESS(Buffer) |
| 297 | 293 |
| 298 // TODO(ygorshenin): investigate why | |
| 299 // TEST_PPAPI_IN_PROCESS(TCPSocketPrivateShared) fails, | |
| 300 // http://crbug.com/105860. | |
| 301 TEST_PPAPI_IN_PROCESS_VIA_HTTP(TCPSocketPrivateShared) | |
| 302 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(TCPSocketPrivateShared) | |
| 303 TEST_PPAPI_NACL_VIA_HTTP(TCPSocketPrivateShared) | |
| 304 | |
| 305 // TODO(ygorshenin): investigate why | |
| 306 // TEST_PPAPI_IN_PROCESS(UDPSocketPrivateShared) fails, | |
| 307 // http://crbug.com/105860. | |
| 308 TEST_PPAPI_IN_PROCESS_VIA_HTTP(UDPSocketPrivateShared) | |
| 309 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivateShared) | |
| 310 TEST_PPAPI_NACL_VIA_HTTP(UDPSocketPrivateShared) | |
| 311 | |
| 312 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader) | 294 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader) |
| 313 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLLoader) | 295 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLLoader) |
| 314 TEST_PPAPI_NACL_VIA_HTTP(URLLoader) | 296 TEST_PPAPI_NACL_VIA_HTTP(URLLoader) |
| 315 | 297 |
| 316 TEST_PPAPI_IN_PROCESS(PaintAggregator) | 298 TEST_PPAPI_IN_PROCESS(PaintAggregator) |
| 317 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) | 299 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) |
| 318 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) | 300 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) |
| 319 | 301 |
| 320 TEST_PPAPI_IN_PROCESS(Scrollbar) | 302 TEST_PPAPI_IN_PROCESS(Scrollbar) |
| 321 // http://crbug.com/89961 | 303 // http://crbug.com/89961 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 492 TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_InvalidConfigs) | 474 TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_InvalidConfigs) |
| 493 | 475 |
| 494 TEST_PPAPI_IN_PROCESS(Audio_Creation) | 476 TEST_PPAPI_IN_PROCESS(Audio_Creation) |
| 495 TEST_PPAPI_IN_PROCESS(Audio_DestroyNoStop) | 477 TEST_PPAPI_IN_PROCESS(Audio_DestroyNoStop) |
| 496 TEST_PPAPI_IN_PROCESS(Audio_Failures) | 478 TEST_PPAPI_IN_PROCESS(Audio_Failures) |
| 497 TEST_PPAPI_OUT_OF_PROCESS(Audio_Creation) | 479 TEST_PPAPI_OUT_OF_PROCESS(Audio_Creation) |
| 498 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) | 480 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) |
| 499 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) | 481 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) |
| 500 | 482 |
| 501 #endif // ADDRESS_SANITIZER | 483 #endif // ADDRESS_SANITIZER |
| OLD | NEW |