Linux: Depend on liberation-fonts package for RPMs.
[chromium-blink-merge.git] / chrome / test / ppapi / ppapi_browsertest.cc
blob50f0a9eb0a13a7c5a4e01f86cdce19f8819e54bf
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
3 // found in the LICENSE file.
5 #include "base/path_service.h"
6 #include "base/test/test_timeouts.h"
7 #include "build/build_config.h"
8 #include "chrome/browser/content_settings/host_content_settings_map_factory.h"
9 #include "chrome/browser/extensions/extension_browsertest.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h"
12 #include "chrome/browser/ui/browser_navigator.h"
13 #include "chrome/browser/ui/extensions/app_launch_params.h"
14 #include "chrome/browser/ui/extensions/application_launch.h"
15 #include "chrome/browser/ui/tabs/tab_strip_model.h"
16 #include "chrome/common/chrome_paths.h"
17 #include "chrome/test/base/ui_test_utils.h"
18 #include "chrome/test/nacl/nacl_browsertest_util.h"
19 #include "chrome/test/ppapi/ppapi_test.h"
20 #include "components/content_settings/core/browser/host_content_settings_map.h"
21 #include "components/nacl/common/nacl_switches.h"
22 #include "content/public/browser/web_contents.h"
23 #include "content/public/common/content_switches.h"
24 #include "content/public/common/url_constants.h"
25 #include "content/public/test/javascript_test_observer.h"
26 #include "content/public/test/test_renderer_host.h"
27 #include "extensions/common/constants.h"
28 #include "extensions/test/extension_test_message_listener.h"
29 #include "ppapi/shared_impl/test_utils.h"
31 using content::RenderViewHost;
33 // This macro finesses macro expansion to do what we want.
34 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name)
35 // Turn the given token into a string. This allows us to use precompiler stuff
36 // to turn names into DISABLED_Foo, but still pass a string to RunTest.
37 #define STRINGIFY(test_name) #test_name
38 #define LIST_TEST(test_name) STRINGIFY(test_name) ","
40 // Use these macros to run the tests for a specific interface.
41 // Most interfaces should be tested with both macros.
42 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \
43 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
44 RunTest(STRIP_PREFIXES(test_name)); \
47 // Similar macros that test over HTTP.
48 #define TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(test_name) \
49 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
50 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
53 // Similar macros that test with an SSL server.
54 #define TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(test_name) \
55 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
56 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
59 // Disable all NaCl tests for --disable-nacl flag and on Mac ASAN builds.
60 // Flaky on Mac ASAN:
61 // http://crbug.com/428670
63 #if defined(DISABLE_NACL) || \
64 (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER)) || \
65 defined(DISABLE_NACL_BROWSERTESTS)
67 #define MAYBE_PPAPI_NACL(test_name) DISABLED_##test_name
69 #define TEST_PPAPI_NACL(test_name)
70 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name)
71 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name)
72 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement)
74 #else
76 #define MAYBE_PPAPI_NACL(test_name) test_name
78 // NaCl based PPAPI tests
79 #define TEST_PPAPI_NACL(test_name) \
80 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
81 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
82 } \
83 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
84 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
85 } \
86 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
87 MAYBE_PNACL_NONSFI(test_name)) { \
88 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
91 // NaCl based PPAPI tests
92 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement) \
93 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
94 run_statement; \
95 } \
96 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
97 run_statement; \
98 } \
99 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
100 MAYBE_PNACL_NONSFI(test_name)) { \
101 run_statement; \
104 // NaCl based PPAPI tests with disallowed socket API
105 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name) \
106 IN_PROC_BROWSER_TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \
107 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
110 // NaCl based PPAPI tests with SSL server
111 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name) \
112 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
113 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
115 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
116 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
118 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
119 MAYBE_PNACL_NONSFI(test_name)) { \
120 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
124 #endif // DISABLE_NACL
127 // Interface tests.
130 // Flaky, http://crbug.com/111355
131 TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Broker)
133 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Accept) {
134 // Accepting the infobar should grant permission to access the PPAPI broker.
135 InfoBarObserver observer(this);
136 observer.ExpectInfoBarAndAccept(true);
138 // PPB_Broker_Trusted::IsAllowed should return false before the infobar is
139 // popped and true after the infobar is popped.
140 RunTest("Broker_IsAllowedPermissionDenied");
141 RunTest("Broker_ConnectPermissionGranted");
142 RunTest("Broker_IsAllowedPermissionGranted");
144 // It should also set a content settings exception for the site.
145 GURL url = GetTestFileUrl("Broker_ConnectPermissionGranted");
146 HostContentSettingsMap* content_settings =
147 HostContentSettingsMapFactory::GetForProfile(browser()->profile());
148 EXPECT_EQ(CONTENT_SETTING_ALLOW,
149 content_settings->GetContentSetting(
150 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
153 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Deny) {
154 // Canceling the infobar should deny permission to access the PPAPI broker.
155 InfoBarObserver observer(this);
156 observer.ExpectInfoBarAndAccept(false);
158 // PPB_Broker_Trusted::IsAllowed should return false before and after the
159 // infobar is popped.
160 RunTest("Broker_IsAllowedPermissionDenied");
161 RunTest("Broker_ConnectPermissionDenied");
162 RunTest("Broker_IsAllowedPermissionDenied");
164 // It should also set a content settings exception for the site.
165 GURL url = GetTestFileUrl("Broker_ConnectPermissionDenied");
166 HostContentSettingsMap* content_settings =
167 HostContentSettingsMapFactory::GetForProfile(browser()->profile());
168 EXPECT_EQ(CONTENT_SETTING_BLOCK,
169 content_settings->GetContentSetting(
170 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
173 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Blocked) {
174 // Block access to the PPAPI broker.
175 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
176 ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
177 CONTENT_SETTING_BLOCK);
179 // We shouldn't see an infobar.
180 InfoBarObserver observer(this);
182 RunTest("Broker_ConnectPermissionDenied");
183 RunTest("Broker_IsAllowedPermissionDenied");
186 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Allowed) {
187 // Always allow access to the PPAPI broker.
188 HostContentSettingsMapFactory::GetForProfile(browser()->profile())
189 ->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PPAPI_BROKER,
190 CONTENT_SETTING_ALLOW);
192 // We shouldn't see an infobar.
193 InfoBarObserver observer(this);
195 RunTest("Broker_ConnectPermissionGranted");
196 RunTest("Broker_IsAllowedPermissionGranted");
199 TEST_PPAPI_NACL(Console)
201 TEST_PPAPI_NACL(Core)
203 // Non-NaCl TraceEvent tests are in content/test/ppapi/ppapi_browsertest.cc.
204 TEST_PPAPI_NACL(TraceEvent)
206 TEST_PPAPI_NACL(InputEvent)
208 // Flaky on Linux and Windows. http://crbug.com/135403
209 #if defined(OS_LINUX) || defined(OS_WIN)
210 #define MAYBE_ImeInputEvent DISABLED_ImeInputEvent
211 #else
212 #define MAYBE_ImeInputEvent ImeInputEvent
213 #endif
215 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_ImeInputEvent)
216 TEST_PPAPI_NACL(MAYBE_ImeInputEvent)
218 // Graphics2D_Dev isn't supported in NaCl, only test the other interfaces
219 // TODO(jhorwich) Enable when Graphics2D_Dev interfaces are proxied in NaCl.
220 TEST_PPAPI_NACL(Graphics2D_InvalidResource)
221 TEST_PPAPI_NACL(Graphics2D_InvalidSize)
222 TEST_PPAPI_NACL(Graphics2D_Humongous)
223 TEST_PPAPI_NACL(Graphics2D_InitToZero)
224 TEST_PPAPI_NACL(Graphics2D_Describe)
225 TEST_PPAPI_NACL(Graphics2D_Paint)
226 TEST_PPAPI_NACL(Graphics2D_Scroll)
227 TEST_PPAPI_NACL(Graphics2D_Replace)
228 TEST_PPAPI_NACL(Graphics2D_Flush)
229 TEST_PPAPI_NACL(Graphics2D_FlushOffscreenUpdate)
230 TEST_PPAPI_NACL(Graphics2D_BindNull)
232 #if defined(OS_WIN)
233 #if defined(USE_AURA)
234 // These tests fail with the test compositor which is what's used by default for
235 // browser tests on Windows Aura. Renable when the software compositor is
236 // available.
237 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
238 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
239 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
240 #else // defined(USE_AURA)
241 // In-process and NaCl tests are having flaky failures on Win: crbug.com/242252
242 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
243 #define MAYBE_OUT_Graphics3D Graphics3D
244 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
245 #endif // defined(USE_AURA)
246 #elif defined(OS_MACOSX)
247 // These tests fail when using the legacy software mode. Reenable when the
248 // software compositor is enabled crbug.com/286038
249 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
250 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
251 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
252 #else
253 // The tests are failing in-process. crbug.com/280282
254 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
255 #define MAYBE_OUT_Graphics3D Graphics3D
256 #define MAYBE_NACL_Graphics3D Graphics3D
257 #endif
258 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_OUT_Graphics3D)
259 TEST_PPAPI_NACL(MAYBE_NACL_Graphics3D)
261 TEST_PPAPI_NACL(ImageData)
263 // TCPSocket and TCPSocketPrivate tests.
264 #define RUN_TCPSOCKET_SUBTESTS \
265 RunTestViaHTTP( \
266 LIST_TEST(TCPSocket_Connect) \
267 LIST_TEST(TCPSocket_ReadWrite) \
268 LIST_TEST(TCPSocket_SetOption) \
269 LIST_TEST(TCPSocket_Listen) \
270 LIST_TEST(TCPSocket_Backlog) \
271 LIST_TEST(TCPSocket_Interface_1_0) \
274 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, TCPSocket) {
275 RUN_TCPSOCKET_SUBTESTS;
277 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(TCPSocket)) {
278 RUN_TCPSOCKET_SUBTESTS;
280 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(TCPSocket)) {
281 RUN_TCPSOCKET_SUBTESTS;
283 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
284 MAYBE_PNACL_NONSFI(TCPSocket)) {
285 RUN_TCPSOCKET_SUBTESTS;
289 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(TCPServerSocketPrivate)
290 TEST_PPAPI_NACL(TCPServerSocketPrivate)
292 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivate)
294 TEST_PPAPI_NACL_WITH_SSL_SERVER(TCPSocketPrivate)
296 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivateTrusted)
298 // UDPSocket tests.
299 // UDPSocket_Broadcast is disabled for OSX because it requires root
300 // permissions on OSX 10.7+.
301 #if defined(OS_MACOSX)
302 #define MAYBE_UDPSocket_Broadcast DISABLED_UDPSocket_Broadcast
303 #else
304 #define MAYBE_UDPSocket_Broadcast UDPSocket_Broadcast
305 #endif
307 #define UDPSOCKET_TEST(_test) \
308 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, _test) { \
309 RunTestViaHTTP(LIST_TEST(_test)); \
311 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(_test)) { \
312 RunTestViaHTTP(LIST_TEST(_test)); \
314 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(_test)) { \
315 RunTestViaHTTP(LIST_TEST(_test)); \
317 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(_test)) { \
318 RunTestViaHTTP(LIST_TEST(_test)); \
320 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
321 MAYBE_PNACL_NONSFI(_test)) { \
322 RunTestViaHTTP(LIST_TEST(_test)); \
325 // Instead of one single test for all UDPSocket features (like it is done for
326 // TCPSocket), split them into multiple, making it easier to isolate which tests
327 // are failing.
328 UDPSOCKET_TEST(UDPSocket_ReadWrite)
329 UDPSOCKET_TEST(UDPSocket_SetOption)
330 UDPSOCKET_TEST(UDPSocket_SetOption_1_0)
331 UDPSOCKET_TEST(UDPSocket_SetOption_1_1)
332 UDPSOCKET_TEST(MAYBE_UDPSocket_Broadcast)
333 UDPSOCKET_TEST(UDPSocket_ParallelSend)
334 UDPSOCKET_TEST(UDPSocket_Multicast)
336 // UDPSocketPrivate tests.
337 // UDPSocketPrivate_Broadcast is disabled for OSX because it requires root
338 // permissions on OSX 10.7+.
339 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Connect)
340 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_ConnectFailure)
341 #if !defined(OS_MACOSX)
342 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Broadcast)
343 #endif // !defined(OS_MACOSX)
344 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_SetSocketFeatureErrors)
345 TEST_PPAPI_NACL(UDPSocketPrivate_Connect)
346 TEST_PPAPI_NACL(UDPSocketPrivate_ConnectFailure)
347 #if !defined(OS_MACOSX)
348 TEST_PPAPI_NACL(UDPSocketPrivate_Broadcast)
349 #endif // !defined(OS_MACOSX)
350 TEST_PPAPI_NACL(UDPSocketPrivate_SetSocketFeatureErrors)
352 // Disallowed socket tests.
353 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(HostResolverPrivateDisallowed)
354 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPServerSocketPrivateDisallowed)
355 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPSocketPrivateDisallowed)
356 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(UDPSocketPrivateDisallowed)
358 // HostResolver and HostResolverPrivate tests.
359 #define RUN_HOST_RESOLVER_SUBTESTS \
360 RunTestViaHTTP( \
361 LIST_TEST(HostResolver_Empty) \
362 LIST_TEST(HostResolver_Resolve) \
363 LIST_TEST(HostResolver_ResolveIPv4) \
366 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, HostResolver) {
367 RUN_HOST_RESOLVER_SUBTESTS;
370 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(HostResolver)) {
371 RUN_HOST_RESOLVER_SUBTESTS;
373 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(HostResolver)) {
374 RUN_HOST_RESOLVER_SUBTESTS;
376 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
377 MAYBE_PNACL_NONSFI(HostResolver)) {
378 RUN_HOST_RESOLVER_SUBTESTS;
381 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_Resolve)
382 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_ResolveIPv4)
383 TEST_PPAPI_NACL(HostResolverPrivate_Resolve)
384 TEST_PPAPI_NACL(HostResolverPrivate_ResolveIPv4)
386 // URLLoader tests. These are split into multiple test fixtures because if we
387 // run them all together, they tend to time out.
388 #define RUN_URLLOADER_SUBTESTS_0 \
389 RunTestViaHTTP( \
390 LIST_TEST(URLLoader_BasicGET) \
391 LIST_TEST(URLLoader_BasicPOST) \
392 LIST_TEST(URLLoader_BasicFilePOST) \
393 LIST_TEST(URLLoader_BasicFileRangePOST) \
394 LIST_TEST(URLLoader_CompoundBodyPOST) \
397 #define RUN_URLLOADER_SUBTESTS_1 \
398 RunTestViaHTTP( \
399 LIST_TEST(URLLoader_EmptyDataPOST) \
400 LIST_TEST(URLLoader_BinaryDataPOST) \
401 LIST_TEST(URLLoader_CustomRequestHeader) \
402 LIST_TEST(URLLoader_FailsBogusContentLength) \
403 LIST_TEST(URLLoader_StreamToFile) \
406 // TODO(bbudge) Fix Javascript URLs for trusted loaders.
407 // http://crbug.com/103062
408 #define RUN_URLLOADER_SUBTESTS_2 \
409 RunTestViaHTTP( \
410 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
411 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
412 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
413 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
416 #define RUN_URLLOADER_NACL_SUBTESTS_2 \
417 RunTestViaHTTP( \
418 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
419 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
420 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
421 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
424 #define RUN_URLLOADER_SUBTESTS_3 \
425 RunTestViaHTTP( \
426 LIST_TEST(URLLoader_UntrustedHttpRequests) \
427 LIST_TEST(URLLoader_FollowURLRedirect) \
428 LIST_TEST(URLLoader_AuditURLRedirect) \
429 LIST_TEST(URLLoader_AbortCalls) \
430 LIST_TEST(URLLoader_UntendedLoad) \
431 LIST_TEST(URLLoader_PrefetchBufferThreshold) \
434 // Note: we do not support Trusted APIs in NaCl, so these will be skipped.
435 // XRequestedWithHeader isn't trusted per-se, but the header isn't provided
436 // for NaCl and thus must be skipped.
437 #define RUN_URLLOADER_TRUSTED_SUBTESTS \
438 RunTestViaHTTP( \
439 LIST_TEST(URLLoader_TrustedSameOriginRestriction) \
440 LIST_TEST(URLLoader_TrustedCrossOriginRequest) \
441 LIST_TEST(URLLoader_TrustedHttpRequests) \
442 LIST_TEST(URLLoader_XRequestedWithHeader) \
445 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader0) {
446 RUN_URLLOADER_SUBTESTS_0;
448 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader1) {
449 RUN_URLLOADER_SUBTESTS_1;
451 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader2) {
452 RUN_URLLOADER_SUBTESTS_2;
454 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader3) {
455 RUN_URLLOADER_SUBTESTS_3;
457 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoaderTrusted) {
458 RUN_URLLOADER_TRUSTED_SUBTESTS;
460 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(URLLoader0)) {
461 RUN_URLLOADER_SUBTESTS_0;
463 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(URLLoader1)) {
464 RUN_URLLOADER_SUBTESTS_1;
467 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(URLLoader2)) {
468 RUN_URLLOADER_SUBTESTS_2;
470 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(URLLoader3)) {
471 RUN_URLLOADER_SUBTESTS_3;
474 // Flaky on 32-bit linux bot; http://crbug.com/308906
475 #if defined(OS_LINUX) && defined(ARCH_CPU_X86)
476 #define MAYBE_URLLoader_BasicFilePOST DISABLED_URLLoader_BasicFilePOST
477 #else
478 #define MAYBE_URLLoader_BasicFilePOST URLLoader_BasicFilePOST
479 #endif
481 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(URLLoader0)) {
482 RUN_URLLOADER_SUBTESTS_0;
484 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(URLLoader1)) {
485 RUN_URLLOADER_SUBTESTS_1;
487 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(URLLoader2)) {
488 RUN_URLLOADER_SUBTESTS_2;
490 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(URLLoader3)) {
491 RUN_URLLOADER_SUBTESTS_3;
493 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
494 MAYBE_PNACL_NONSFI(URLLoader0)) {
495 RUN_URLLOADER_SUBTESTS_0;
497 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
498 MAYBE_PNACL_NONSFI(URLLoader1)) {
499 RUN_URLLOADER_SUBTESTS_1;
501 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
502 MAYBE_PNACL_NONSFI(URLLoader2)) {
503 RUN_URLLOADER_SUBTESTS_2;
505 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
506 MAYBE_PNACL_NONSFI(URLLoader3)) {
507 RUN_URLLOADER_SUBTESTS_3;
511 // URLRequestInfo tests.
512 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_CreateAndIsURLRequestInfo)
514 // Timing out on Windows. http://crbug.com/129571
515 #if defined(OS_WIN)
516 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
517 DISABLED_URLRequest_CreateAndIsURLRequestInfo
518 #else
519 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
520 URLRequest_CreateAndIsURLRequestInfo
521 #endif
522 TEST_PPAPI_NACL(MAYBE_URLRequest_CreateAndIsURLRequestInfo)
524 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_SetProperty)
525 TEST_PPAPI_NACL(URLRequest_SetProperty)
526 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_AppendDataToBody)
527 TEST_PPAPI_NACL(URLRequest_AppendDataToBody)
528 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(DISABLED_URLRequest_AppendFileToBody)
529 TEST_PPAPI_NACL(DISABLED_URLRequest_AppendFileToBody)
530 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_Stress)
531 TEST_PPAPI_NACL(URLRequest_Stress)
533 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator)
534 TEST_PPAPI_NACL(PaintAggregator)
536 // TODO(danakj): http://crbug.com/115286
537 TEST_PPAPI_NACL(DISABLED_Scrollbar)
539 TEST_PPAPI_NACL(Var)
541 TEST_PPAPI_NACL(VarResource)
543 // PostMessage tests.
544 #define RUN_POSTMESSAGE_SUBTESTS \
545 RunTestViaHTTP( \
546 LIST_TEST(PostMessage_SendInInit) \
547 LIST_TEST(PostMessage_SendingData) \
548 LIST_TEST(PostMessage_SendingString) \
549 LIST_TEST(PostMessage_SendingArrayBuffer) \
550 LIST_TEST(PostMessage_SendingArray) \
551 LIST_TEST(PostMessage_SendingDictionary) \
552 LIST_TEST(PostMessage_SendingResource) \
553 LIST_TEST(PostMessage_SendingComplexVar) \
554 LIST_TEST(PostMessage_MessageEvent) \
555 LIST_TEST(PostMessage_NoHandler) \
556 LIST_TEST(PostMessage_ExtraParam) \
557 LIST_TEST(PostMessage_NonMainThread) \
560 // Windows defines 'PostMessage', so we have to undef it.
561 #ifdef PostMessage
562 #undef PostMessage
563 #endif
565 #if defined(OS_WIN)
566 // http://crbug.com/95557
567 #define MAYBE_PostMessage DISABLED_PostMessage
568 #else
569 #define MAYBE_PostMessage PostMessage
570 #endif
571 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_PostMessage) {
572 RUN_POSTMESSAGE_SUBTESTS;
575 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(PostMessage)) {
576 RUN_POSTMESSAGE_SUBTESTS;
578 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(PostMessage)) {
579 RUN_POSTMESSAGE_SUBTESTS;
581 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
582 MAYBE_PNACL_NONSFI(PostMessage)) {
583 RUN_POSTMESSAGE_SUBTESTS;
586 TEST_PPAPI_NACL(Memory)
588 // FileIO tests.
589 #define RUN_FILEIO_SUBTESTS \
590 RunTestViaHTTP( \
591 LIST_TEST(FileIO_Open) \
592 LIST_TEST(FileIO_OpenDirectory) \
593 LIST_TEST(FileIO_AbortCalls) \
594 LIST_TEST(FileIO_ParallelReads) \
595 LIST_TEST(FileIO_ParallelWrites) \
596 LIST_TEST(FileIO_NotAllowMixedReadWrite) \
597 LIST_TEST(FileIO_ReadWriteSetLength) \
598 LIST_TEST(FileIO_ReadToArrayWriteSetLength) \
599 LIST_TEST(FileIO_TouchQuery) \
602 #define RUN_FILEIO_PRIVATE_SUBTESTS \
603 RunTestViaHTTP( \
604 LIST_TEST(FileIO_RequestOSFileHandle) \
605 LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive) \
606 LIST_TEST(FileIO_Mmap) \
609 IN_PROC_BROWSER_TEST_F(PPAPIPrivateTest, FileIO_Private) {
610 RUN_FILEIO_PRIVATE_SUBTESTS;
613 // See: crbug.com/421284
614 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_FileIO) {
615 RUN_FILEIO_SUBTESTS;
617 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPIPrivateTest, FileIO_Private) {
618 RUN_FILEIO_PRIVATE_SUBTESTS;
621 // http://crbug.com/313401
622 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, DISABLED_FileIO) {
623 RUN_FILEIO_SUBTESTS;
625 // http://crbug.com/313401
626 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClNewlibTest,
627 DISABLED_NaCl_Newlib_FileIO_Private) {
628 RUN_FILEIO_PRIVATE_SUBTESTS;
631 // http://crbug.com/313205
632 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, DISABLED_FileIO) {
633 RUN_FILEIO_SUBTESTS;
635 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClTest,
636 DISABLED_PNaCl_FileIO_Private) {
637 RUN_FILEIO_PRIVATE_SUBTESTS;
640 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, MAYBE_PNACL_NONSFI(FileIO)) {
641 RUN_FILEIO_SUBTESTS;
643 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClNonSfiTest,
644 MAYBE_PNACL_NONSFI(FILEIO_Private)) {
645 RUN_FILEIO_PRIVATE_SUBTESTS;
648 // FileRef tests.
649 #define RUN_FILEREF_SUBTESTS_1 \
650 RunTestViaHTTP( \
651 LIST_TEST(FileRef_Create) \
652 LIST_TEST(FileRef_GetFileSystemType) \
653 LIST_TEST(FileRef_GetName) \
654 LIST_TEST(FileRef_GetPath) \
655 LIST_TEST(FileRef_GetParent) \
656 LIST_TEST(FileRef_MakeDirectory) \
659 #define RUN_FILEREF_SUBTESTS_2 \
660 RunTestViaHTTP( \
661 LIST_TEST(FileRef_QueryAndTouchFile) \
662 LIST_TEST(FileRef_DeleteFileAndDirectory) \
663 LIST_TEST(FileRef_RenameFileAndDirectory) \
664 LIST_TEST(FileRef_Query) \
665 LIST_TEST(FileRef_FileNameEscaping) \
668 // Note, the FileRef tests are split into two, because all of them together
669 // sometimes take too long on windows: crbug.com/336999
670 // FileRef_ReadDirectoryEntries is flaky, so left out. See crbug.com/241646.
671 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FileRef1) {
672 RUN_FILEREF_SUBTESTS_1;
674 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FileRef2) {
675 RUN_FILEREF_SUBTESTS_2;
678 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(FileRef1)) {
679 RUN_FILEREF_SUBTESTS_1;
681 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(FileRef2)) {
682 RUN_FILEREF_SUBTESTS_2;
684 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(FileRef1)) {
685 RUN_FILEREF_SUBTESTS_1;
687 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(FileRef2)) {
688 RUN_FILEREF_SUBTESTS_2;
690 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
691 MAYBE_PNACL_NONSFI(FileRef1)) {
692 RUN_FILEREF_SUBTESTS_1;
694 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
695 MAYBE_PNACL_NONSFI(FileRef2)) {
696 RUN_FILEREF_SUBTESTS_2;
699 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(FileSystem)
701 // PPAPINaClTest.FileSystem times out consistently on Windows and Mac.
702 // http://crbug.com/130372
703 #if defined(OS_MACOSX) || defined(OS_WIN)
704 #define MAYBE_FileSystem DISABLED_FileSystem
705 #else
706 #define MAYBE_FileSystem FileSystem
707 #endif
709 TEST_PPAPI_NACL(MAYBE_FileSystem)
711 #if defined(OS_MACOSX)
712 // http://crbug.com/103912
713 #define MAYBE_Fullscreen DISABLED_Fullscreen
714 #elif defined(OS_LINUX)
715 // http://crbug.com/146008
716 #define MAYBE_Fullscreen DISABLED_Fullscreen
717 #elif defined(OS_WIN)
718 // http://crbug.com/342269
719 #define MAYBE_Fullscreen DISABLED_Fullscreen
720 #else
721 #define MAYBE_Fullscreen Fullscreen
722 #endif
724 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_Fullscreen)
725 TEST_PPAPI_NACL(MAYBE_Fullscreen)
727 TEST_PPAPI_OUT_OF_PROCESS(X509CertificatePrivate)
729 TEST_PPAPI_OUT_OF_PROCESS(UMA)
730 TEST_PPAPI_NACL(UMA)
732 // NetAddress tests.
733 #define RUN_NETADDRESS_SUBTESTS \
734 RunTestViaHTTP( \
735 LIST_TEST(NetAddress_IPv4Address) \
736 LIST_TEST(NetAddress_IPv6Address) \
737 LIST_TEST(NetAddress_DescribeAsString) \
740 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetAddress) {
741 RUN_NETADDRESS_SUBTESTS;
743 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(NetAddress)) {
744 RUN_NETADDRESS_SUBTESTS;
746 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(NetAddress)) {
747 RUN_NETADDRESS_SUBTESTS;
749 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
750 MAYBE_PNACL_NONSFI(NetAddress)) {
751 RUN_NETADDRESS_SUBTESTS;
754 // NetAddressPrivate tests.
755 #define RUN_NETADDRESS_PRIVATE_SUBTESTS \
756 RunTestViaHTTP( \
757 LIST_TEST(NetAddressPrivate_AreEqual) \
758 LIST_TEST(NetAddressPrivate_AreHostsEqual) \
759 LIST_TEST(NetAddressPrivate_Describe) \
760 LIST_TEST(NetAddressPrivate_ReplacePort) \
761 LIST_TEST(NetAddressPrivate_GetAnyAddress) \
762 LIST_TEST(NetAddressPrivate_DescribeIPv6) \
763 LIST_TEST(NetAddressPrivate_GetFamily) \
764 LIST_TEST(NetAddressPrivate_GetPort) \
765 LIST_TEST(NetAddressPrivate_GetAddress) \
766 LIST_TEST(NetAddressPrivate_GetScopeID) \
769 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetAddressPrivate) {
770 RUN_NETADDRESS_PRIVATE_SUBTESTS;
773 #define RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS \
774 RunTestViaHTTP( \
775 LIST_TEST(NetAddressPrivateUntrusted_AreEqual) \
776 LIST_TEST(NetAddressPrivateUntrusted_AreHostsEqual) \
777 LIST_TEST(NetAddressPrivateUntrusted_Describe) \
778 LIST_TEST(NetAddressPrivateUntrusted_ReplacePort) \
779 LIST_TEST(NetAddressPrivateUntrusted_GetAnyAddress) \
780 LIST_TEST(NetAddressPrivateUntrusted_GetFamily) \
781 LIST_TEST(NetAddressPrivateUntrusted_GetPort) \
782 LIST_TEST(NetAddressPrivateUntrusted_GetAddress) \
785 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest,
786 MAYBE_PPAPI_NACL(NetAddressPrivate)) {
787 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
789 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest,
790 MAYBE_PPAPI_NACL(NetAddressPrivate)) {
791 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
793 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
794 MAYBE_PNACL_NONSFI(NetAddressPrivate)) {
795 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
798 // NetworkMonitor tests.
799 #define RUN_NETWORK_MONITOR_SUBTESTS \
800 RunTestViaHTTP( \
801 LIST_TEST(NetworkMonitor_Basic) \
802 LIST_TEST(NetworkMonitor_2Monitors) \
803 LIST_TEST(NetworkMonitor_DeleteInCallback) \
806 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetworkMonitor) {
807 RUN_NETWORK_MONITOR_SUBTESTS;
809 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(NetworkMonitor)) {
810 RUN_NETWORK_MONITOR_SUBTESTS;
812 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(NetworkMonitor)) {
813 RUN_NETWORK_MONITOR_SUBTESTS;
815 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
816 MAYBE_PNACL_NONSFI(NetworkMonitor)) {
817 RUN_NETWORK_MONITOR_SUBTESTS;
820 // Flash tests.
821 #define RUN_FLASH_SUBTESTS \
822 RunTestViaHTTP( \
823 LIST_TEST(Flash_SetInstanceAlwaysOnTop) \
824 LIST_TEST(Flash_GetCommandLineArgs) \
827 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, Flash) {
828 RUN_FLASH_SUBTESTS;
831 // In-process WebSocket tests. Note, the WebSocket tests are split into two,
832 // because all of them together sometimes take too long on windows:
833 // crbug.com/336999
834 #define RUN_WEBSOCKET_SUBTESTS_1 \
835 RunTestWithWebSocketServer( \
836 LIST_TEST(WebSocket_IsWebSocket) \
837 LIST_TEST(WebSocket_UninitializedPropertiesAccess) \
838 LIST_TEST(WebSocket_InvalidConnect) \
839 LIST_TEST(WebSocket_Protocols) \
840 LIST_TEST(WebSocket_GetURL) \
841 LIST_TEST(WebSocket_ValidConnect) \
842 LIST_TEST(WebSocket_InvalidClose) \
843 LIST_TEST(WebSocket_ValidClose) \
844 LIST_TEST(WebSocket_GetProtocol) \
845 LIST_TEST(WebSocket_TextSendReceive) \
846 LIST_TEST(WebSocket_BinarySendReceive) \
847 LIST_TEST(WebSocket_StressedSendReceive) \
848 LIST_TEST(WebSocket_BufferedAmount) \
851 #define RUN_WEBSOCKET_SUBTESTS_2 \
852 RunTestWithWebSocketServer( \
853 LIST_TEST(WebSocket_AbortCallsWithCallback) \
854 LIST_TEST(WebSocket_AbortSendMessageCall) \
855 LIST_TEST(WebSocket_AbortCloseCall) \
856 LIST_TEST(WebSocket_AbortReceiveMessageCall) \
857 LIST_TEST(WebSocket_ClosedFromServerWhileSending) \
858 LIST_TEST(WebSocket_CcInterfaces) \
859 LIST_TEST(WebSocket_UtilityInvalidConnect) \
860 LIST_TEST(WebSocket_UtilityProtocols) \
861 LIST_TEST(WebSocket_UtilityGetURL) \
862 LIST_TEST(WebSocket_UtilityValidConnect) \
863 LIST_TEST(WebSocket_UtilityInvalidClose) \
864 LIST_TEST(WebSocket_UtilityValidClose) \
865 LIST_TEST(WebSocket_UtilityGetProtocol) \
866 LIST_TEST(WebSocket_UtilityTextSendReceive) \
867 LIST_TEST(WebSocket_UtilityBinarySendReceive) \
868 LIST_TEST(WebSocket_UtilityBufferedAmount) \
871 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, WebSocket1) {
872 RUN_WEBSOCKET_SUBTESTS_1;
874 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, WebSocket2) {
875 RUN_WEBSOCKET_SUBTESTS_2;
877 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(WebSocket1)) {
878 RUN_WEBSOCKET_SUBTESTS_1;
880 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(WebSocket2)) {
881 RUN_WEBSOCKET_SUBTESTS_2;
883 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(WebSocket1)) {
884 RUN_WEBSOCKET_SUBTESTS_1;
886 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(WebSocket2)) {
887 RUN_WEBSOCKET_SUBTESTS_2;
889 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
890 MAYBE_PNACL_NONSFI(WebSocket1)) {
891 RUN_WEBSOCKET_SUBTESTS_1;
893 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
894 MAYBE_PNACL_NONSFI(WebSocket2)) {
895 RUN_WEBSOCKET_SUBTESTS_2;
898 // AudioConfig tests
899 #define RUN_AUDIO_CONFIG_SUBTESTS \
900 RunTestViaHTTP( \
901 LIST_TEST(AudioConfig_RecommendSampleRate) \
902 LIST_TEST(AudioConfig_ValidConfigs) \
903 LIST_TEST(AudioConfig_InvalidConfigs) \
906 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, AudioConfig) {
907 RUN_AUDIO_CONFIG_SUBTESTS;
909 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(AudioConfig)) {
910 RUN_AUDIO_CONFIG_SUBTESTS;
912 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(AudioConfig)) {
913 RUN_AUDIO_CONFIG_SUBTESTS;
915 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(AudioConfig)) {
916 RUN_AUDIO_CONFIG_SUBTESTS;
918 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
919 MAYBE_PNACL_NONSFI(AudioConfig)) {
920 RUN_AUDIO_CONFIG_SUBTESTS;
923 // PPB_Audio tests.
924 #define RUN_AUDIO_SUBTESTS \
925 RunTestViaHTTP( \
926 LIST_TEST(Audio_Creation) \
927 LIST_TEST(Audio_DestroyNoStop) \
928 LIST_TEST(Audio_Failures) \
929 LIST_TEST(Audio_AudioCallback1) \
930 LIST_TEST(Audio_AudioCallback2) \
931 LIST_TEST(Audio_AudioCallback3) \
932 LIST_TEST(Audio_AudioCallback4) \
935 #if defined(OS_LINUX)
936 // http://crbug.com/396464
937 #define MAYBE_Audio DISABLED_Audio
938 #else
939 #define MAYBE_Audio Audio
940 #endif
941 // PPB_Audio is not supported in-process.
942 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_Audio) {
943 RUN_AUDIO_SUBTESTS;
945 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(Audio)) {
946 RUN_AUDIO_SUBTESTS;
948 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(Audio)) {
949 RUN_AUDIO_SUBTESTS;
951 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(Audio)) {
952 RUN_AUDIO_SUBTESTS;
954 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
955 MAYBE_PNACL_NONSFI(Audio)) {
956 RUN_AUDIO_SUBTESTS;
959 #define RUN_AUDIO_THREAD_CREATOR_SUBTESTS \
960 RunTestViaHTTP( \
961 LIST_TEST(Audio_AudioThreadCreatorIsRequired) \
962 LIST_TEST(Audio_AudioThreadCreatorIsCalled) \
965 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest,
966 MAYBE_PPAPI_NACL(AudioThreadCreator)) {
967 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
969 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(AudioThreadCreator)) {
970 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
972 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest,
973 MAYBE_PPAPI_NACL(AudioThreadCreator)) {
974 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
976 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
977 MAYBE_PNACL_NONSFI(AudioThreadCreator)) {
978 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
981 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible);
982 #if defined(OS_MACOSX)
983 // http://crbug.com/474399
984 #define MAYBE_View_CreatedVisible DISABLED_View_CreatedVisible
985 #else
986 #define MAYBE_View_CreatedVisible View_CreatedVisible
987 #endif
988 TEST_PPAPI_NACL(MAYBE_View_CreatedVisible);
990 // This test ensures that plugins created in a background tab have their
991 // initial visibility set to false. We don't bother testing in-process for this
992 // custom test since the out of process code also exercises in-process.
993 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) {
994 // Make a second tab in the foreground.
995 GURL url = GetTestFileUrl("View_CreatedInvisible");
996 chrome::NavigateParams params(browser(), url, ui::PAGE_TRANSITION_LINK);
997 params.disposition = NEW_BACKGROUND_TAB;
998 ui_test_utils::NavigateToURL(&params);
1001 // This test messes with tab visibility so is custom.
1002 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) {
1003 // The plugin will be loaded in the foreground tab and will send us a message.
1004 PPAPITestMessageHandler handler;
1005 content::JavascriptTestObserver observer(
1006 browser()->tab_strip_model()->GetActiveWebContents(),
1007 &handler);
1009 GURL url = GetTestFileUrl("View_PageHideShow");
1010 ui_test_utils::NavigateToURL(browser(), url);
1012 ASSERT_TRUE(observer.Run()) << handler.error_message();
1013 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str());
1014 observer.Reset();
1016 // Make a new tab to cause the original one to hide, this should trigger the
1017 // next phase of the test.
1018 chrome::NavigateParams params(
1019 browser(), GURL(url::kAboutBlankURL), ui::PAGE_TRANSITION_LINK);
1020 params.disposition = NEW_FOREGROUND_TAB;
1021 ui_test_utils::NavigateToURL(&params);
1023 // Wait until the test acks that it got hidden.
1024 ASSERT_TRUE(observer.Run()) << handler.error_message();
1025 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str());
1026 observer.Reset();
1028 // Switch back to the test tab.
1029 browser()->tab_strip_model()->ActivateTabAt(0, true);
1031 ASSERT_TRUE(observer.Run()) << handler.error_message();
1032 EXPECT_STREQ("PASS", handler.message().c_str());
1035 // Tests that if a plugin accepts touch events, the browser knows to send touch
1036 // events to the renderer.
1037 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, InputEvent_AcceptTouchEvent) {
1038 std::string positive_tests[] = { "InputEvent_AcceptTouchEvent_1",
1039 "InputEvent_AcceptTouchEvent_2",
1040 "InputEvent_AcceptTouchEvent_3",
1041 "InputEvent_AcceptTouchEvent_4"
1044 for (size_t i = 0; i < arraysize(positive_tests); ++i) {
1045 RenderViewHost* host = browser()->tab_strip_model()->
1046 GetActiveWebContents()->GetRenderViewHost();
1047 RunTest(positive_tests[i]);
1048 EXPECT_TRUE(content::RenderViewHostTester::HasTouchEventHandler(host));
1052 // View tests.
1053 #define RUN_VIEW_SUBTESTS \
1054 RunTestViaHTTP( \
1055 LIST_TEST(View_SizeChange) \
1056 LIST_TEST(View_ClipChange) \
1057 LIST_TEST(View_ScrollOffsetChange) \
1060 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View) {
1061 RUN_VIEW_SUBTESTS;
1063 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(View)) {
1064 RUN_VIEW_SUBTESTS;
1066 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(View)) {
1067 RUN_VIEW_SUBTESTS;
1069 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, MAYBE_PNACL_NONSFI(View)) {
1070 RUN_VIEW_SUBTESTS;
1073 // FlashMessageLoop tests.
1074 #define RUN_FLASH_MESSAGE_LOOP_SUBTESTS \
1075 RunTest( \
1076 LIST_TEST(FlashMessageLoop_Basics) \
1077 LIST_TEST(FlashMessageLoop_RunWithoutQuit) \
1080 #if defined(OS_LINUX) // Disabled due to flakiness http://crbug.com/316925
1081 #define MAYBE_FlashMessageLoop DISABLED_FlashMessageLoop
1082 #else
1083 #define MAYBE_FlashMessageLoop FlashMessageLoop
1084 #endif
1085 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_FlashMessageLoop) {
1086 RUN_FLASH_MESSAGE_LOOP_SUBTESTS;
1089 // The compositor test timeouts sometimes, so we have to split it to two
1090 // subtests.
1091 #define RUN_COMPOSITOR_SUBTESTS_0 \
1092 RunTestViaHTTP( \
1093 LIST_TEST(Compositor_BindUnbind) \
1094 LIST_TEST(Compositor_Release) \
1095 LIST_TEST(Compositor_ReleaseUnbound) \
1096 LIST_TEST(Compositor_ReleaseWithoutCommit) \
1097 LIST_TEST(Compositor_ReleaseWithoutCommitUnbound) \
1100 #define RUN_COMPOSITOR_SUBTESTS_1 \
1101 RunTestViaHTTP( \
1102 LIST_TEST(Compositor_CommitTwoTimesWithoutChange) \
1103 LIST_TEST(Compositor_CommitTwoTimesWithoutChangeUnbound) \
1104 LIST_TEST(Compositor_General) \
1105 LIST_TEST(Compositor_GeneralUnbound) \
1108 #if defined(OS_WIN)
1109 // This test fails with the test compositor which is what's used by default for
1110 // browser tests on Windows. Renable when the software compositor is available.
1111 #define MAYBE_Compositor0 DISABLED_Compositor0
1112 #define MAYBE_Compositor1 DISABLED_Compositor1
1113 #elif defined(OS_MACOSX)
1114 // This test fails when using the legacy software mode. Reenable when the
1115 // software compositor is enabled crbug.com/286038
1116 #define MAYBE_Compositor0 DISABLED_Compositor0
1117 #define MAYBE_Compositor1 DISABLED_Compositor1
1118 #else
1119 // flaky on Linux: http://crbug.com/396482
1120 #define MAYBE_Compositor0 DISABLED_Compositor0
1121 #define MAYBE_Compositor1 DISABLED_Compositor1
1122 #endif
1124 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor0, RUN_COMPOSITOR_SUBTESTS_0)
1125 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor1, RUN_COMPOSITOR_SUBTESTS_1)
1127 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
1128 // Flaky on ChromeOS, Linux and Windows (crbug.com/438729)
1129 #define MAYBE_MediaStreamAudioTrack DISABLED_MediaStreamAudioTrack
1130 #else
1131 #define MAYBE_MediaStreamAudioTrack MediaStreamAudioTrack
1132 #endif
1133 TEST_PPAPI_NACL(MAYBE_MediaStreamAudioTrack)
1135 TEST_PPAPI_NACL(MediaStreamVideoTrack)
1137 TEST_PPAPI_NACL(MouseCursor)
1139 TEST_PPAPI_NACL(NetworkProxy)
1141 TEST_PPAPI_NACL(TrueTypeFont)
1143 TEST_PPAPI_NACL(VideoDecoder)
1145 TEST_PPAPI_NACL(VideoEncoder)
1147 // VideoDestination doesn't work in content_browsertests.
1148 TEST_PPAPI_OUT_OF_PROCESS(VideoDestination)
1149 TEST_PPAPI_NACL(VideoDestination)
1151 // VideoSource doesn't work in content_browsertests.
1152 TEST_PPAPI_OUT_OF_PROCESS(VideoSource)
1153 TEST_PPAPI_NACL(VideoSource)
1155 // Printing doesn't work in content_browsertests.
1156 TEST_PPAPI_OUT_OF_PROCESS(Printing)
1158 TEST_PPAPI_NACL(MessageHandler)
1160 TEST_PPAPI_NACL(MessageLoop_Basics)
1161 TEST_PPAPI_NACL(MessageLoop_Post)
1163 // Going forward, Flash APIs will only work out-of-process.
1164 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetLocalTimeZoneOffset)
1165 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL)
1166 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetSetting)
1167 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetCrashData)
1168 // http://crbug.com/176822
1169 #if !defined(OS_WIN)
1170 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard)
1171 #endif
1172 TEST_PPAPI_OUT_OF_PROCESS(FlashFile)
1173 // Mac/Aura reach NOTIMPLEMENTED/time out.
1174 // mac: http://crbug.com/96767
1175 // aura: http://crbug.com/104384
1176 // cros: http://crbug.com/396502
1177 #if defined(OS_MACOSX) || defined(OS_CHROMEOS)
1178 #define MAYBE_FlashFullscreen DISABLED_FlashFullscreen
1179 #else
1180 #define MAYBE_FlashFullscreen FlashFullscreen
1181 #endif
1182 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_FlashFullscreen)
1184 TEST_PPAPI_OUT_OF_PROCESS(PDF)
1186 // TODO(dalecurtis): Renable once the platform verification infobar has been
1187 // implemented; see http://crbug.com/270908
1188 // #if defined(OS_CHROMEOS)
1189 // TEST_PPAPI_OUT_OF_PROCESS(PlatformVerificationPrivate)
1190 // #endif
1192 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FlashDRM) {
1193 RunTest(
1194 #if (defined(OS_WIN) && defined(ENABLE_RLZ)) || defined(OS_CHROMEOS)
1195 // Only implemented on Windows and ChromeOS currently.
1196 LIST_TEST(FlashDRM_GetDeviceID)
1197 #endif
1198 LIST_TEST(FlashDRM_GetHmonitor)
1199 LIST_TEST(FlashDRM_GetVoucherFile));
1202 #if defined(OS_CHROMEOS)
1203 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate)
1204 #endif
1206 #if !defined(DISABLE_NACL)
1207 class PackagedAppTest : public ExtensionBrowserTest {
1208 public:
1209 explicit PackagedAppTest(const std::string& toolchain)
1210 : toolchain_(toolchain) { }
1212 void LaunchTestingApp(const std::string& extension_dirname) {
1213 base::FilePath data_dir;
1214 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA, &data_dir));
1215 base::FilePath app_dir = data_dir.AppendASCII("ppapi")
1216 .AppendASCII("tests")
1217 .AppendASCII("extensions")
1218 .AppendASCII(extension_dirname)
1219 .AppendASCII(toolchain_);
1221 const extensions::Extension* extension = LoadExtension(app_dir);
1222 ASSERT_TRUE(extension);
1224 AppLaunchParams params(browser()->profile(), extension,
1225 extensions::LAUNCH_CONTAINER_NONE, NEW_WINDOW,
1226 extensions::SOURCE_TEST);
1227 params.command_line = *base::CommandLine::ForCurrentProcess();
1228 OpenApplication(params);
1231 void RunTests(const std::string& extension_dirname) {
1232 ExtensionTestMessageListener listener("PASS", true);
1233 LaunchTestingApp(extension_dirname);
1234 EXPECT_TRUE(listener.WaitUntilSatisfied());
1236 protected:
1237 std::string toolchain_;
1240 class NewlibPackagedAppTest : public PackagedAppTest {
1241 public:
1242 NewlibPackagedAppTest() : PackagedAppTest("newlib") { }
1245 class NonSfiPackagedAppTest : public PackagedAppTest {
1246 public:
1247 NonSfiPackagedAppTest() : PackagedAppTest("nonsfi") { }
1249 void SetUpCommandLine(base::CommandLine* command_line) override {
1250 PackagedAppTest::SetUpCommandLine(command_line);
1251 command_line->AppendSwitch(switches::kEnableNaClNonSfiMode);
1255 // Load a packaged app, and wait for it to successfully post a "hello" message
1256 // back.
1257 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest,
1258 MAYBE_PPAPI_NACL(SuccessfulLoad)) {
1259 RunTests("packaged_app");
1262 IN_PROC_BROWSER_TEST_F(NonSfiPackagedAppTest,
1263 MAYBE_PNACL_NONSFI(SuccessfulLoad)) {
1264 RunTests("packaged_app");
1267 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest,
1268 MAYBE_PPAPI_NACL(MulticastPermissions)) {
1269 RunTests("multicast_permissions");
1272 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest,
1273 MAYBE_PPAPI_NACL(NoSocketPermissions)) {
1274 RunTests("no_socket_permissions");
1277 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest,
1278 MAYBE_PPAPI_NACL(SocketPermissions)) {
1279 RunTests("socket_permissions");
1282 #endif