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 20 matching lines...) Expand all Loading... |
31 #include "content/public/common/content_paths.h" | 31 #include "content/public/common/content_paths.h" |
32 #include "content/public/common/content_switches.h" | 32 #include "content/public/common/content_switches.h" |
33 #include "content/public/test/browser_test_utils.h" | 33 #include "content/public/test/browser_test_utils.h" |
34 #include "content/public/test/test_renderer_host.h" | 34 #include "content/public/test/test_renderer_host.h" |
35 #include "net/base/net_util.h" | 35 #include "net/base/net_util.h" |
36 #include "net/base/test_data_directory.h" | 36 #include "net/base/test_data_directory.h" |
37 #include "ppapi/shared_impl/ppapi_switches.h" | 37 #include "ppapi/shared_impl/ppapi_switches.h" |
38 #include "ui/gl/gl_switches.h" | 38 #include "ui/gl/gl_switches.h" |
39 #include "webkit/plugins/plugin_switches.h" | 39 #include "webkit/plugins/plugin_switches.h" |
40 | 40 |
| 41 #if defined(OS_WIN) && defined(USE_ASH) |
| 42 #include "base/win/windows_version.h" |
| 43 #endif |
| 44 |
41 using content::DomOperationNotificationDetails; | 45 using content::DomOperationNotificationDetails; |
42 using content::RenderViewHost; | 46 using content::RenderViewHost; |
43 | 47 |
44 namespace { | 48 namespace { |
45 | 49 |
46 // Platform-specific filename relative to the chrome executable. | 50 // Platform-specific filename relative to the chrome executable. |
47 #if defined(OS_WIN) | 51 #if defined(OS_WIN) |
48 const wchar_t library_name[] = L"ppapi_tests.dll"; | 52 const wchar_t library_name[] = L"ppapi_tests.dll"; |
49 #elif defined(OS_MACOSX) | 53 #elif defined(OS_MACOSX) |
50 const char library_name[] = "ppapi_tests.plugin"; | 54 const char library_name[] = "ppapi_tests.plugin"; |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
247 std::string PPAPITestBase::StripPrefixes(const std::string& test_name) { | 251 std::string PPAPITestBase::StripPrefixes(const std::string& test_name) { |
248 const char* const prefixes[] = { | 252 const char* const prefixes[] = { |
249 "FAILS_", "FLAKY_", "DISABLED_", "SLOW_" }; | 253 "FAILS_", "FLAKY_", "DISABLED_", "SLOW_" }; |
250 for (size_t i = 0; i < sizeof(prefixes)/sizeof(prefixes[0]); ++i) | 254 for (size_t i = 0; i < sizeof(prefixes)/sizeof(prefixes[0]); ++i) |
251 if (test_name.find(prefixes[i]) == 0) | 255 if (test_name.find(prefixes[i]) == 0) |
252 return test_name.substr(strlen(prefixes[i])); | 256 return test_name.substr(strlen(prefixes[i])); |
253 return test_name; | 257 return test_name; |
254 } | 258 } |
255 | 259 |
256 void PPAPITestBase::RunTestURL(const GURL& test_url) { | 260 void PPAPITestBase::RunTestURL(const GURL& test_url) { |
| 261 #if defined(OS_WIN) && defined(USE_ASH) |
| 262 // PPAPITests are broken in Ash browser tests (http://crbug.com/263548). |
| 263 if (base::win::GetVersion() >= base::win::VERSION_WIN8) { |
| 264 LOG(WARNING) << "PPAPITests are disabled for Ash browser tests."; |
| 265 return; |
| 266 } |
| 267 #endif |
| 268 |
257 // See comment above TestingInstance in ppapi/test/testing_instance.h. | 269 // See comment above TestingInstance in ppapi/test/testing_instance.h. |
258 // Basically it sends messages using the DOM automation controller. The | 270 // Basically it sends messages using the DOM automation controller. The |
259 // value of "..." means it's still working and we should continue to wait, | 271 // value of "..." means it's still working and we should continue to wait, |
260 // any other value indicates completion (in this case it will start with | 272 // any other value indicates completion (in this case it will start with |
261 // "PASS" or "FAIL"). This keeps us from timing out on waits for long tests. | 273 // "PASS" or "FAIL"). This keeps us from timing out on waits for long tests. |
262 PPAPITestMessageHandler handler; | 274 PPAPITestMessageHandler handler; |
263 JavascriptTestObserver observer( | 275 JavascriptTestObserver observer( |
264 browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(), | 276 browser()->tab_strip_model()->GetActiveWebContents()->GetRenderViewHost(), |
265 &handler); | 277 &handler); |
266 | 278 |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 const std::string& base, | 386 const std::string& base, |
375 const std::string& test_case) { | 387 const std::string& test_case) { |
376 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), | 388 return base::StringPrintf("%smode=nacl_newlib&testcase=%s", base.c_str(), |
377 test_case.c_str()); | 389 test_case.c_str()); |
378 } | 390 } |
379 | 391 |
380 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { | 392 void PPAPIBrokerInfoBarTest::SetUpOnMainThread() { |
381 // The default content setting for the PPAPI broker is ASK. We purposefully | 393 // The default content setting for the PPAPI broker is ASK. We purposefully |
382 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. | 394 // don't call PPAPITestBase::SetUpOnMainThread() to keep it that way. |
383 } | 395 } |
OLD | NEW |