| 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"); |
| 173 } | 175 } |
| 174 | 176 |
| 175 std::string BuildQuery(const std::string& base, | 177 std::string BuildQuery(const std::string& base, |
| 176 const std::string& test_case){ | 178 const std::string& test_case){ |
| 177 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); | 179 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); |
| 178 } | 180 } |
| 179 | 181 |
| 180 }; | 182 }; |
| 181 | 183 |
| 182 // Variant of PPAPITest that runs plugins out-of-process to test proxy | 184 // Variant of PPAPITest that runs plugins out-of-process to test proxy |
| 183 // codepaths. | 185 // codepaths. |
| 184 class OutOfProcessPPAPITest : public PPAPITest { | 186 class OutOfProcessPPAPITest : public PPAPITest { |
| 185 public: | 187 public: |
| 186 OutOfProcessPPAPITest() { | 188 OutOfProcessPPAPITest() { |
| 187 // Run PPAPI out-of-process to exercise proxy implementations. | 189 // Run PPAPI out-of-process to exercise proxy implementations. |
| 188 launch_arguments_.AppendSwitch(switches::kPpapiOutOfProcess); | 190 launch_arguments_.AppendSwitch(switches::kPpapiOutOfProcess); |
| 189 } | 191 } |
| 190 }; | 192 }; |
| 191 | 193 |
| 192 // NaCl plugin test runner. | 194 // NaCl plugin test runner. |
| 193 class PPAPINaClTest : public PPAPITestBase { | 195 class PPAPINaClTest : public PPAPITestBase { |
| 194 public: | 196 public: |
| 195 PPAPINaClTest() { | 197 PPAPINaClTest() { |
| 196 FilePath plugin_lib; | 198 FilePath plugin_lib; |
| 197 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 199 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
| 198 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 200 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
| 199 | 201 |
| 200 // Enable running NaCl outside of the store. | 202 // Enable running NaCl outside of the store. |
| 201 launch_arguments_.AppendSwitch(switches::kEnableNaCl); | 203 launch_arguments_.AppendSwitch(switches::kEnableNaCl); |
| 204 launch_arguments_.AppendSwitchASCII(switches::kAllowNaClSocketAPI, |
| 205 "127.0.0.1"); |
| 202 } | 206 } |
| 203 | 207 |
| 204 // Append the correct mode and testcase string | 208 // Append the correct mode and testcase string |
| 205 std::string BuildQuery(const std::string& base, | 209 std::string BuildQuery(const std::string& base, |
| 206 const std::string& test_case) { | 210 const std::string& test_case) { |
| 207 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), | 211 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), |
| 208 test_case.c_str()); | 212 test_case.c_str()); |
| 209 } | 213 } |
| 210 }; | 214 }; |
| 211 | 215 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) | 288 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D) |
| 285 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) | 289 TEST_PPAPI_NACL_VIA_HTTP(Graphics2D) |
| 286 | 290 |
| 287 TEST_PPAPI_IN_PROCESS(ImageData) | 291 TEST_PPAPI_IN_PROCESS(ImageData) |
| 288 TEST_PPAPI_OUT_OF_PROCESS(ImageData) | 292 TEST_PPAPI_OUT_OF_PROCESS(ImageData) |
| 289 TEST_PPAPI_NACL_VIA_HTTP(ImageData) | 293 TEST_PPAPI_NACL_VIA_HTTP(ImageData) |
| 290 | 294 |
| 291 TEST_PPAPI_IN_PROCESS(Buffer) | 295 TEST_PPAPI_IN_PROCESS(Buffer) |
| 292 TEST_PPAPI_OUT_OF_PROCESS(Buffer) | 296 TEST_PPAPI_OUT_OF_PROCESS(Buffer) |
| 293 | 297 |
| 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 |
| 294 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader) | 312 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLLoader) |
| 295 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLLoader) | 313 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLLoader) |
| 296 TEST_PPAPI_NACL_VIA_HTTP(URLLoader) | 314 TEST_PPAPI_NACL_VIA_HTTP(URLLoader) |
| 297 | 315 |
| 298 TEST_PPAPI_IN_PROCESS(PaintAggregator) | 316 TEST_PPAPI_IN_PROCESS(PaintAggregator) |
| 299 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) | 317 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) |
| 300 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) | 318 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) |
| 301 | 319 |
| 302 TEST_PPAPI_IN_PROCESS(Scrollbar) | 320 TEST_PPAPI_IN_PROCESS(Scrollbar) |
| 303 // http://crbug.com/89961 | 321 // http://crbug.com/89961 |
| (...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 477 TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_InvalidConfigs) | 495 TEST_PPAPI_OUT_OF_PROCESS(AudioConfig_InvalidConfigs) |
| 478 | 496 |
| 479 TEST_PPAPI_IN_PROCESS(Audio_Creation) | 497 TEST_PPAPI_IN_PROCESS(Audio_Creation) |
| 480 TEST_PPAPI_IN_PROCESS(Audio_DestroyNoStop) | 498 TEST_PPAPI_IN_PROCESS(Audio_DestroyNoStop) |
| 481 TEST_PPAPI_IN_PROCESS(Audio_Failures) | 499 TEST_PPAPI_IN_PROCESS(Audio_Failures) |
| 482 TEST_PPAPI_OUT_OF_PROCESS(Audio_Creation) | 500 TEST_PPAPI_OUT_OF_PROCESS(Audio_Creation) |
| 483 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) | 501 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) |
| 484 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) | 502 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) |
| 485 | 503 |
| 486 #endif // ADDRESS_SANITIZER | 504 #endif // ADDRESS_SANITIZER |
| OLD | NEW |