Move Webstore URL concepts to //extensions and out
[chromium-blink-merge.git] / chrome / test / ppapi / ppapi_browsertest.cc
blob82f12a890e04ead33b35a7faa671682a845a44e5
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 "chrome/test/ppapi/ppapi_test.h"
7 #include "base/test/test_timeouts.h"
8 #include "build/build_config.h"
9 #include "chrome/browser/content_settings/host_content_settings_map.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/tabs/tab_strip_model.h"
14 #include "chrome/test/base/ui_test_utils.h"
15 #include "chrome/test/nacl/nacl_browsertest_util.h"
16 #include "content/public/browser/web_contents.h"
17 #include "content/public/common/url_constants.h"
18 #include "content/public/test/javascript_test_observer.h"
19 #include "content/public/test/test_renderer_host.h"
20 #include "ppapi/shared_impl/test_harness_utils.h"
22 using content::RenderViewHost;
24 // This macro finesses macro expansion to do what we want.
25 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name)
26 // Turn the given token into a string. This allows us to use precompiler stuff
27 // to turn names into DISABLED_Foo, but still pass a string to RunTest.
28 #define STRINGIFY(test_name) #test_name
29 #define LIST_TEST(test_name) STRINGIFY(test_name) ","
31 // Use these macros to run the tests for a specific interface.
32 // Most interfaces should be tested with both macros.
33 #define TEST_PPAPI_IN_PROCESS(test_name) \
34 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \
35 RunTest(STRIP_PREFIXES(test_name)); \
37 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \
38 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
39 RunTest(STRIP_PREFIXES(test_name)); \
42 // Similar macros that test over HTTP.
43 #define TEST_PPAPI_IN_PROCESS_VIA_HTTP(test_name) \
44 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \
45 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
47 #define TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(test_name) \
48 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
49 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
52 // Similar macros that test with an SSL server.
53 #define TEST_PPAPI_IN_PROCESS_WITH_SSL_SERVER(test_name) \
54 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \
55 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
57 #define TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(test_name) \
58 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
59 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
62 #if defined(DISABLE_NACL)
64 #define TEST_PPAPI_NACL(test_name)
65 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name)
66 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name)
67 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement)
69 #else
71 // NaCl based PPAPI tests
72 #define TEST_PPAPI_NACL(test_name) \
73 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
74 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
75 } \
76 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(test_name)) { \
77 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
78 } \
79 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
80 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
81 } \
82 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
83 MAYBE_PNACL_NONSFI(test_name)) { \
84 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
87 // NaCl based PPAPI tests
88 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement) \
89 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
90 run_statement; \
91 } \
92 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(test_name)) { \
93 run_statement; \
94 } \
95 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
96 run_statement; \
97 } \
98 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
99 MAYBE_PNACL_NONSFI(test_name)) { \
100 run_statement; \
103 // NaCl based PPAPI tests with disallowed socket API
104 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name) \
105 IN_PROC_BROWSER_TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \
106 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
109 // NaCl based PPAPI tests with SSL server
110 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name) \
111 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
112 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
114 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(test_name)) { \
115 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
117 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
118 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
120 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
121 MAYBE_PNACL_NONSFI(test_name)) { \
122 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
125 #endif // DISABLE_NACL
128 // Interface tests.
131 TEST_PPAPI_IN_PROCESS(Broker)
132 // Flaky, http://crbug.com/111355
133 TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Broker)
135 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Accept) {
136 // Accepting the infobar should grant permission to access the PPAPI broker.
137 InfoBarObserver observer(this);
138 observer.ExpectInfoBarAndAccept(true);
140 // PPB_Broker_Trusted::IsAllowed should return false before the infobar is
141 // popped and true after the infobar is popped.
142 RunTest("Broker_IsAllowedPermissionDenied");
143 RunTest("Broker_ConnectPermissionGranted");
144 RunTest("Broker_IsAllowedPermissionGranted");
146 // It should also set a content settings exception for the site.
147 GURL url = GetTestFileUrl("Broker_ConnectPermissionGranted");
148 HostContentSettingsMap* content_settings =
149 browser()->profile()->GetHostContentSettingsMap();
150 EXPECT_EQ(CONTENT_SETTING_ALLOW,
151 content_settings->GetContentSetting(
152 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
155 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Deny) {
156 // Canceling the infobar should deny permission to access the PPAPI broker.
157 InfoBarObserver observer(this);
158 observer.ExpectInfoBarAndAccept(false);
160 // PPB_Broker_Trusted::IsAllowed should return false before and after the
161 // infobar is popped.
162 RunTest("Broker_IsAllowedPermissionDenied");
163 RunTest("Broker_ConnectPermissionDenied");
164 RunTest("Broker_IsAllowedPermissionDenied");
166 // It should also set a content settings exception for the site.
167 GURL url = GetTestFileUrl("Broker_ConnectPermissionDenied");
168 HostContentSettingsMap* content_settings =
169 browser()->profile()->GetHostContentSettingsMap();
170 EXPECT_EQ(CONTENT_SETTING_BLOCK,
171 content_settings->GetContentSetting(
172 url, url, CONTENT_SETTINGS_TYPE_PPAPI_BROKER, std::string()));
175 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Blocked) {
176 // Block access to the PPAPI broker.
177 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
178 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, CONTENT_SETTING_BLOCK);
180 // We shouldn't see an infobar.
181 InfoBarObserver observer(this);
183 RunTest("Broker_ConnectPermissionDenied");
184 RunTest("Broker_IsAllowedPermissionDenied");
187 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest, Allowed) {
188 // Always allow access to the PPAPI broker.
189 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
190 CONTENT_SETTINGS_TYPE_PPAPI_BROKER, 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 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
202 // TODO(erg): linux_aura bringup: http://crbug.com/318961
203 #define MAYBE_Core DISABLED_Core
204 #else
205 #define MAYBE_Core Core
206 #endif
207 TEST_PPAPI_NACL(MAYBE_Core)
209 // Non-NaCl TraceEvent tests are in content/test/ppapi/ppapi_browsertest.cc.
210 TEST_PPAPI_NACL(TraceEvent)
212 TEST_PPAPI_NACL(InputEvent)
214 // Flaky on Linux and Windows. http://crbug.com/135403
215 #if defined(OS_LINUX) || defined(OS_WIN)
216 #define MAYBE_ImeInputEvent DISABLED_ImeInputEvent
217 #else
218 #define MAYBE_ImeInputEvent ImeInputEvent
219 #endif
221 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_ImeInputEvent)
222 TEST_PPAPI_NACL(MAYBE_ImeInputEvent)
224 // Graphics2D_Dev isn't supported in NaCl, only test the other interfaces
225 // TODO(jhorwich) Enable when Graphics2D_Dev interfaces are proxied in NaCl.
226 TEST_PPAPI_NACL(Graphics2D_InvalidResource)
227 TEST_PPAPI_NACL(Graphics2D_InvalidSize)
228 TEST_PPAPI_NACL(Graphics2D_Humongous)
229 TEST_PPAPI_NACL(Graphics2D_InitToZero)
230 TEST_PPAPI_NACL(Graphics2D_Describe)
231 TEST_PPAPI_NACL(Graphics2D_Paint)
232 TEST_PPAPI_NACL(Graphics2D_Scroll)
233 TEST_PPAPI_NACL(Graphics2D_Replace)
234 TEST_PPAPI_NACL(Graphics2D_Flush)
235 TEST_PPAPI_NACL(Graphics2D_FlushOffscreenUpdate)
236 TEST_PPAPI_NACL(Graphics2D_BindNull)
238 #if defined(OS_WIN)
239 #if defined(USE_AURA)
240 // These tests fail with the test compositor which is what's used by default for
241 // browser tests on Windows Aura. Renable when the software compositor is
242 // available.
243 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
244 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
245 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
246 #else // defined(USE_AURA)
247 // In-process and NaCl tests are having flaky failures on Win: crbug.com/242252
248 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
249 #define MAYBE_OUT_Graphics3D Graphics3D
250 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
251 #endif // defined(USE_AURA)
252 #elif defined(OS_MACOSX)
253 // These tests fail when using the legacy software mode. Reenable when the
254 // software compositor is enabled crbug.com/286038
255 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
256 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
257 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
258 #else
259 // The tests are failing in-process. crbug.com/280282
260 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
261 #define MAYBE_OUT_Graphics3D Graphics3D
262 #define MAYBE_NACL_Graphics3D Graphics3D
263 #endif
264 TEST_PPAPI_IN_PROCESS(MAYBE_IN_Graphics3D)
265 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_OUT_Graphics3D)
266 TEST_PPAPI_NACL(MAYBE_NACL_Graphics3D)
268 TEST_PPAPI_NACL(ImageData)
270 // TCPSocket and TCPSocketPrivate tests.
271 #define RUN_TCPSOCKET_SUBTESTS \
272 RunTestViaHTTP( \
273 LIST_TEST(TCPSocket_Connect) \
274 LIST_TEST(TCPSocket_ReadWrite) \
275 LIST_TEST(TCPSocket_SetOption) \
276 LIST_TEST(TCPSocket_Listen) \
277 LIST_TEST(TCPSocket_Backlog) \
278 LIST_TEST(TCPSocket_Interface_1_0) \
281 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, TCPSocket) {
282 RUN_TCPSOCKET_SUBTESTS;
284 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, TCPSocket) {
285 RUN_TCPSOCKET_SUBTESTS;
287 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(TCPSocket)) {
288 RUN_TCPSOCKET_SUBTESTS;
290 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, TCPSocket) {
291 RUN_TCPSOCKET_SUBTESTS;
293 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
294 MAYBE_PNACL_NONSFI(TCPSocket)) {
295 RUN_TCPSOCKET_SUBTESTS;
298 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(TCPServerSocketPrivate)
299 TEST_PPAPI_NACL(TCPServerSocketPrivate)
301 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivate)
302 TEST_PPAPI_NACL_WITH_SSL_SERVER(TCPSocketPrivate)
304 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivateTrusted)
306 // UDPSocket tests.
307 // UDPSocket_Broadcast is disabled for OSX because it requires root
308 // permissions on OSX 10.7+.
309 #if defined(OS_MACOSX)
310 #define MAYBE_UDPSocket_Broadcast DISABLED_UDPSocket_Broadcast
311 #else
312 #define MAYBE_UDPSocket_Broadcast UDPSocket_Broadcast
313 #endif
315 #define RUN_UDPSOCKET_SUBTESTS \
316 RunTestViaHTTP( \
317 LIST_TEST(UDPSocket_ReadWrite) \
318 LIST_TEST(UDPSocket_SetOption) \
319 LIST_TEST(MAYBE_UDPSocket_Broadcast) \
322 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, UDPSocket) {
323 RUN_UDPSOCKET_SUBTESTS;
325 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, UDPSocket) {
326 RUN_UDPSOCKET_SUBTESTS;
328 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(UDPSocket)) {
329 RUN_UDPSOCKET_SUBTESTS;
331 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, UDPSocket) {
332 RUN_UDPSOCKET_SUBTESTS;
334 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
335 MAYBE_PNACL_NONSFI(UDPSocket)) {
336 RUN_UDPSOCKET_SUBTESTS;
340 // UDPSocketPrivate tests.
341 // UDPSocketPrivate_Broadcast is disabled for OSX because it requires root
342 // permissions on OSX 10.7+.
343 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Connect)
344 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_ConnectFailure)
345 #if !defined(OS_MACOSX)
346 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Broadcast)
347 #endif // !defined(OS_MACOSX)
348 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_SetSocketFeatureErrors)
349 TEST_PPAPI_NACL(UDPSocketPrivate_Connect)
350 TEST_PPAPI_NACL(UDPSocketPrivate_ConnectFailure)
351 #if !defined(OS_MACOSX)
352 TEST_PPAPI_NACL(UDPSocketPrivate_Broadcast)
353 #endif // !defined(OS_MACOSX)
354 TEST_PPAPI_NACL(UDPSocketPrivate_SetSocketFeatureErrors)
356 // Disallowed socket tests.
357 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(HostResolverPrivateDisallowed)
358 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPServerSocketPrivateDisallowed)
359 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPSocketPrivateDisallowed)
360 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(UDPSocketPrivateDisallowed)
362 // HostResolver and HostResolverPrivate tests.
363 #define RUN_HOST_RESOLVER_SUBTESTS \
364 RunTestViaHTTP( \
365 LIST_TEST(HostResolver_Empty) \
366 LIST_TEST(HostResolver_Resolve) \
367 LIST_TEST(HostResolver_ResolveIPv4) \
370 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, HostResolver) {
371 RUN_HOST_RESOLVER_SUBTESTS;
373 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, HostResolver) {
374 RUN_HOST_RESOLVER_SUBTESTS;
376 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(HostResolver)) {
377 RUN_HOST_RESOLVER_SUBTESTS;
379 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, HostResolver) {
380 RUN_HOST_RESOLVER_SUBTESTS;
382 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
383 MAYBE_PNACL_NONSFI(HostResolver)) {
384 RUN_HOST_RESOLVER_SUBTESTS;
387 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_Resolve)
388 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_ResolveIPv4)
389 TEST_PPAPI_NACL(HostResolverPrivate_Resolve)
390 TEST_PPAPI_NACL(HostResolverPrivate_ResolveIPv4)
392 // URLLoader tests. These are split into multiple test fixtures because if we
393 // run them all together, they tend to time out.
394 #define RUN_URLLOADER_SUBTESTS_0 \
395 RunTestViaHTTP( \
396 LIST_TEST(URLLoader_BasicGET) \
397 LIST_TEST(URLLoader_BasicPOST) \
398 LIST_TEST(URLLoader_BasicFilePOST) \
399 LIST_TEST(URLLoader_BasicFileRangePOST) \
400 LIST_TEST(URLLoader_CompoundBodyPOST) \
403 #define RUN_URLLOADER_SUBTESTS_1 \
404 RunTestViaHTTP( \
405 LIST_TEST(URLLoader_EmptyDataPOST) \
406 LIST_TEST(URLLoader_BinaryDataPOST) \
407 LIST_TEST(URLLoader_CustomRequestHeader) \
408 LIST_TEST(URLLoader_FailsBogusContentLength) \
409 LIST_TEST(URLLoader_StreamToFile) \
412 // TODO(bbudge) Fix Javascript URLs for trusted loaders.
413 // http://crbug.com/103062
414 #define RUN_URLLOADER_SUBTESTS_2 \
415 RunTestViaHTTP( \
416 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
417 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
418 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
419 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
422 #define RUN_URLLOADER_NACL_SUBTESTS_2 \
423 RunTestViaHTTP( \
424 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
425 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
426 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
427 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
430 #define RUN_URLLOADER_SUBTESTS_3 \
431 RunTestViaHTTP( \
432 LIST_TEST(URLLoader_UntrustedHttpRequests) \
433 LIST_TEST(URLLoader_FollowURLRedirect) \
434 LIST_TEST(URLLoader_AuditURLRedirect) \
435 LIST_TEST(URLLoader_AbortCalls) \
436 LIST_TEST(URLLoader_UntendedLoad) \
437 LIST_TEST(URLLoader_PrefetchBufferThreshold) \
440 // Note: we do not support Trusted APIs in NaCl, so these will be skipped.
441 // XRequestedWithHeader isn't trusted per-se, but the header isn't provided
442 // for NaCl and thus must be skipped.
443 #define RUN_URLLOADER_TRUSTED_SUBTESTS \
444 RunTestViaHTTP( \
445 LIST_TEST(URLLoader_TrustedSameOriginRestriction) \
446 LIST_TEST(URLLoader_TrustedCrossOriginRequest) \
447 LIST_TEST(URLLoader_TrustedHttpRequests) \
448 LIST_TEST(URLLoader_XRequestedWithHeader) \
451 IN_PROC_BROWSER_TEST_F(PPAPITest, URLLoader0) {
452 RUN_URLLOADER_SUBTESTS_0;
454 IN_PROC_BROWSER_TEST_F(PPAPITest, URLLoader1) {
455 RUN_URLLOADER_SUBTESTS_1;
457 IN_PROC_BROWSER_TEST_F(PPAPITest, URLLoader2) {
458 RUN_URLLOADER_SUBTESTS_2;
460 IN_PROC_BROWSER_TEST_F(PPAPITest, URLLoader3) {
461 RUN_URLLOADER_SUBTESTS_3;
463 IN_PROC_BROWSER_TEST_F(PPAPITest, URLLoaderTrusted) {
464 RUN_URLLOADER_TRUSTED_SUBTESTS;
466 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader0) {
467 RUN_URLLOADER_SUBTESTS_0;
469 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader1) {
470 RUN_URLLOADER_SUBTESTS_1;
472 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader2) {
473 RUN_URLLOADER_SUBTESTS_2;
475 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoader3) {
476 RUN_URLLOADER_SUBTESTS_3;
478 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, URLLoaderTrusted) {
479 RUN_URLLOADER_TRUSTED_SUBTESTS;
481 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, URLLoader0) {
482 RUN_URLLOADER_SUBTESTS_0;
484 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, URLLoader1) {
485 RUN_URLLOADER_SUBTESTS_1;
487 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, URLLoader2) {
488 RUN_URLLOADER_SUBTESTS_2;
490 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, URLLoader3) {
491 RUN_URLLOADER_SUBTESTS_3;
494 // Flaky on 32-bit linux bot; http://crbug.com/308906
495 #if defined(OS_LINUX) && defined(ARCH_CPU_X86)
496 #define MAYBE_URLLoader_BasicFilePOST DISABLED_URLLoader_BasicFilePOST
497 #else
498 #define MAYBE_URLLoader_BasicFilePOST URLLoader_BasicFilePOST
499 #endif
500 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(URLLoader0)) {
501 RunTestViaHTTP(
502 LIST_TEST(URLLoader_BasicGET)
503 LIST_TEST(URLLoader_BasicPOST)
504 LIST_TEST(MAYBE_URLLoader_BasicFilePOST)
505 LIST_TEST(URLLoader_BasicFileRangePOST)
506 LIST_TEST(URLLoader_CompoundBodyPOST)
510 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(URLLoader1)) {
511 RUN_URLLOADER_SUBTESTS_1;
513 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(URLLoader2)) {
514 RUN_URLLOADER_SUBTESTS_2;
516 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(URLLoader3)) {
517 RUN_URLLOADER_SUBTESTS_3;
519 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, URLLoader0) {
520 RUN_URLLOADER_SUBTESTS_0;
522 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, URLLoader1) {
523 RUN_URLLOADER_SUBTESTS_1;
525 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, URLLoader2) {
526 RUN_URLLOADER_SUBTESTS_2;
528 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, URLLoader3) {
529 RUN_URLLOADER_SUBTESTS_3;
531 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
532 MAYBE_PNACL_NONSFI(URLLoader0)) {
533 RUN_URLLOADER_SUBTESTS_0;
535 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
536 MAYBE_PNACL_NONSFI(URLLoader1)) {
537 RUN_URLLOADER_SUBTESTS_1;
539 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
540 MAYBE_PNACL_NONSFI(URLLoader2)) {
541 RUN_URLLOADER_SUBTESTS_2;
543 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
544 MAYBE_PNACL_NONSFI(URLLoader3)) {
545 RUN_URLLOADER_SUBTESTS_3;
548 // URLRequestInfo tests.
549 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLRequest_CreateAndIsURLRequestInfo)
550 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_CreateAndIsURLRequestInfo)
552 // Timing out on Windows. http://crbug.com/129571
553 #if defined(OS_WIN)
554 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
555 DISABLED_URLRequest_CreateAndIsURLRequestInfo
556 #else
557 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
558 URLRequest_CreateAndIsURLRequestInfo
559 #endif
560 TEST_PPAPI_NACL(MAYBE_URLRequest_CreateAndIsURLRequestInfo)
562 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLRequest_SetProperty)
563 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_SetProperty)
564 TEST_PPAPI_NACL(URLRequest_SetProperty)
565 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLRequest_AppendDataToBody)
566 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_AppendDataToBody)
567 TEST_PPAPI_NACL(URLRequest_AppendDataToBody)
568 TEST_PPAPI_IN_PROCESS_VIA_HTTP(DISABLED_URLRequest_AppendFileToBody)
569 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(DISABLED_URLRequest_AppendFileToBody)
570 TEST_PPAPI_NACL(DISABLED_URLRequest_AppendFileToBody)
571 TEST_PPAPI_IN_PROCESS_VIA_HTTP(URLRequest_Stress)
572 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_Stress)
573 TEST_PPAPI_NACL(URLRequest_Stress)
575 TEST_PPAPI_IN_PROCESS(PaintAggregator)
576 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator)
577 TEST_PPAPI_NACL(PaintAggregator)
579 // TODO(danakj): http://crbug.com/115286
580 TEST_PPAPI_NACL(DISABLED_Scrollbar)
582 TEST_PPAPI_NACL(Var)
584 TEST_PPAPI_NACL(VarResource)
586 // PostMessage tests.
587 #define RUN_POSTMESSAGE_SUBTESTS \
588 RunTestViaHTTP( \
589 LIST_TEST(PostMessage_SendInInit) \
590 LIST_TEST(PostMessage_SendingData) \
591 LIST_TEST(PostMessage_SendingString) \
592 LIST_TEST(PostMessage_SendingArrayBuffer) \
593 LIST_TEST(PostMessage_SendingArray) \
594 LIST_TEST(PostMessage_SendingDictionary) \
595 LIST_TEST(PostMessage_SendingResource) \
596 LIST_TEST(PostMessage_SendingComplexVar) \
597 LIST_TEST(PostMessage_MessageEvent) \
598 LIST_TEST(PostMessage_NoHandler) \
599 LIST_TEST(PostMessage_ExtraParam) \
600 LIST_TEST(PostMessage_NonMainThread) \
603 // Windows defines 'PostMessage', so we have to undef it.
604 #ifdef PostMessage
605 #undef PostMessage
606 #endif
608 #if defined(OS_WIN)
609 // http://crbug.com/95557
610 #define MAYBE_PostMessage DISABLED_PostMessage
611 #else
612 #define MAYBE_PostMessage PostMessage
613 #endif
614 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_PostMessage) {
615 RUN_POSTMESSAGE_SUBTESTS;
617 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, PostMessage) {
618 RUN_POSTMESSAGE_SUBTESTS;
620 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(PostMessage)) {
621 RUN_POSTMESSAGE_SUBTESTS;
623 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, PostMessage) {
624 RUN_POSTMESSAGE_SUBTESTS;
626 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
627 MAYBE_PNACL_NONSFI(PostMessage)) {
628 RUN_POSTMESSAGE_SUBTESTS;
631 TEST_PPAPI_NACL(Memory)
633 // FileIO tests.
634 #define RUN_FILEIO_SUBTESTS \
635 RunTestViaHTTP( \
636 LIST_TEST(FileIO_Open) \
637 LIST_TEST(FileIO_OpenDirectory) \
638 LIST_TEST(FileIO_AbortCalls) \
639 LIST_TEST(FileIO_ParallelReads) \
640 LIST_TEST(FileIO_ParallelWrites) \
641 LIST_TEST(FileIO_NotAllowMixedReadWrite) \
642 LIST_TEST(FileIO_ReadWriteSetLength) \
643 LIST_TEST(FileIO_ReadToArrayWriteSetLength) \
644 LIST_TEST(FileIO_TouchQuery) \
647 #define RUN_FILEIO_PRIVATE_SUBTESTS \
648 RunTestViaHTTP( \
649 LIST_TEST(FileIO_RequestOSFileHandle) \
650 LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive) \
651 LIST_TEST(FileIO_Mmap) \
654 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA)
655 // TODO(erg): linux_aura bringup: http://crbug.com/318961
656 #define MAYBE_FileIO DISABLED_FileIO
657 #define MAYBE_FileIO_Private DISABLED_FileIO_Private
658 #else
659 #define MAYBE_FileIO FileIO
660 #define MAYBE_FileIO_Private FileIO_Private
661 #endif
663 IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_FileIO) {
664 RUN_FILEIO_SUBTESTS;
666 IN_PROC_BROWSER_TEST_F(PPAPIPrivateTest, MAYBE_FileIO_Private) {
667 RUN_FILEIO_PRIVATE_SUBTESTS;
669 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_FileIO) {
670 RUN_FILEIO_SUBTESTS;
672 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPIPrivateTest, MAYBE_FileIO_Private) {
673 RUN_FILEIO_PRIVATE_SUBTESTS;
676 // http://crbug.com/313401
677 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, DISABLED_FileIO) {
678 RUN_FILEIO_SUBTESTS;
680 // http://crbug.com/313401
681 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClNewlibTest,
682 DISABLED_NaCl_Newlib_FileIO_Private) {
683 RUN_FILEIO_PRIVATE_SUBTESTS;
686 // Flaky on 32-bit linux bot; http://crbug.com/308905
687 // Flaky on Windows too; http://crbug.com/321300
688 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, DISABLED_FileIO) {
689 RUN_FILEIO_SUBTESTS;
691 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClGLibcTest, DISABLED_FileIO_Private) {
692 RUN_FILEIO_PRIVATE_SUBTESTS;
695 // http://crbug.com/313205
696 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, DISABLED_FileIO) {
697 RUN_FILEIO_SUBTESTS;
699 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClTest,
700 DISABLED_PNaCl_FileIO_Private) {
701 RUN_FILEIO_PRIVATE_SUBTESTS;
704 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, MAYBE_PNACL_NONSFI(FileIO)) {
705 RUN_FILEIO_SUBTESTS;
707 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClTest,
708 MAYBE_PNACL_NONSFI(FILEIO_Private)) {
709 RUN_FILEIO_PRIVATE_SUBTESTS;
712 // PPB_FileMapping is only implemented on POSIX currently.
713 // http://crbug.com/83774
714 #if defined(OS_WIN)
715 #define MAYBE_FileMapping DISABLED_FileMapping
716 #else
717 #define MAYBE_FileMapping FileMapping
718 #endif
719 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_FileMapping)
720 TEST_PPAPI_NACL(MAYBE_FileMapping)
722 // FileRef tests.
723 #define RUN_FILEREF_SUBTESTS_1 \
724 RunTestViaHTTP( \
725 LIST_TEST(FileRef_Create) \
726 LIST_TEST(FileRef_GetFileSystemType) \
727 LIST_TEST(FileRef_GetName) \
728 LIST_TEST(FileRef_GetPath) \
729 LIST_TEST(FileRef_GetParent) \
730 LIST_TEST(FileRef_MakeDirectory) \
733 #define RUN_FILEREF_SUBTESTS_2 \
734 RunTestViaHTTP( \
735 LIST_TEST(FileRef_QueryAndTouchFile) \
736 LIST_TEST(FileRef_DeleteFileAndDirectory) \
737 LIST_TEST(FileRef_RenameFileAndDirectory) \
738 LIST_TEST(FileRef_Query) \
739 LIST_TEST(FileRef_FileNameEscaping) \
742 // Note, the FileRef tests are split into two, because all of them together
743 // sometimes take too long on windows: crbug.com/336999
744 IN_PROC_BROWSER_TEST_F(PPAPITest, FileRef1) {
745 RUN_FILEREF_SUBTESTS_1;
747 IN_PROC_BROWSER_TEST_F(PPAPITest, FileRef2) {
748 RUN_FILEREF_SUBTESTS_2;
750 // This test only works as an in-process test. See crbug.com/241646.
751 IN_PROC_BROWSER_TEST_F(PPAPITest, FileRef_ReadDirectoryEntries) {
752 RunTestViaHTTP(LIST_TEST(FileRef_ReadDirectoryEntries));
754 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FileRef1) {
755 RUN_FILEREF_SUBTESTS_1;
757 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FileRef2) {
758 RUN_FILEREF_SUBTESTS_2;
760 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, FileRef1) {
761 RUN_FILEREF_SUBTESTS_1;
763 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, FileRef2) {
764 RUN_FILEREF_SUBTESTS_2;
766 // Flaky on 32-bit linux bot; http://crbug.com/308908
767 // Glibc not available on ARM
768 #if (defined(OS_LINUX) && defined(ARCH_CPU_X86)) \
769 || defined(ARCH_CPU_ARM_FAMILY)
770 #define MAYBE_NaCl_Glibc_FileRef1 DISABLED_FileRef1
771 #define MAYBE_NaCl_Glibc_FileRef2 DISABLED_FileRef2
772 #else
773 #define MAYBE_NaCl_Glibc_FileRef1 FileRef1
774 #define MAYBE_NaCl_Glibc_FileRef2 FileRef2
775 #endif
776 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_NaCl_Glibc_FileRef1) {
777 RUN_FILEREF_SUBTESTS_1;
779 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_NaCl_Glibc_FileRef2) {
780 RUN_FILEREF_SUBTESTS_2;
782 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, FileRef1) {
783 RUN_FILEREF_SUBTESTS_1;
785 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, FileRef2) {
786 RUN_FILEREF_SUBTESTS_2;
788 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
789 MAYBE_PNACL_NONSFI(FileRef1)) {
790 RUN_FILEREF_SUBTESTS_1;
792 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
793 MAYBE_PNACL_NONSFI(FileRef2)) {
794 RUN_FILEREF_SUBTESTS_2;
797 TEST_PPAPI_IN_PROCESS_VIA_HTTP(FileSystem)
798 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(FileSystem)
800 // PPAPINaClTest.FileSystem times out consistently on Windows and Mac.
801 // http://crbug.com/130372
802 #if defined(OS_MACOSX) || defined(OS_WIN)
803 #define MAYBE_FileSystem DISABLED_FileSystem
804 #else
805 #define MAYBE_FileSystem FileSystem
806 #endif
808 TEST_PPAPI_NACL(MAYBE_FileSystem)
810 #if defined(OS_MACOSX)
811 // http://crbug.com/103912
812 #define MAYBE_Fullscreen DISABLED_Fullscreen
813 #elif defined(OS_LINUX)
814 // http://crbug.com/146008
815 #define MAYBE_Fullscreen DISABLED_Fullscreen
816 #elif defined(OS_WIN)
817 // http://crbug.com/342269
818 #define MAYBE_Fullscreen DISABLED_Fullscreen
819 #else
820 #define MAYBE_Fullscreen Fullscreen
821 #endif
823 TEST_PPAPI_IN_PROCESS_VIA_HTTP(MAYBE_Fullscreen)
824 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_Fullscreen)
825 TEST_PPAPI_NACL(MAYBE_Fullscreen)
827 TEST_PPAPI_OUT_OF_PROCESS(X509CertificatePrivate)
829 TEST_PPAPI_IN_PROCESS(UMA)
830 TEST_PPAPI_OUT_OF_PROCESS(UMA)
831 TEST_PPAPI_NACL(UMA)
833 // NetAddress tests.
834 #define RUN_NETADDRESS_SUBTESTS \
835 RunTestViaHTTP( \
836 LIST_TEST(NetAddress_IPv4Address) \
837 LIST_TEST(NetAddress_IPv6Address) \
838 LIST_TEST(NetAddress_DescribeAsString) \
841 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetAddress) {
842 RUN_NETADDRESS_SUBTESTS;
844 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, NetAddress) {
845 RUN_NETADDRESS_SUBTESTS;
847 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(NetAddress)) {
848 RUN_NETADDRESS_SUBTESTS;
850 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, NetAddress) {
851 RUN_NETADDRESS_SUBTESTS;
853 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
854 MAYBE_PNACL_NONSFI(NetAddress)) {
855 RUN_NETADDRESS_SUBTESTS;
858 // NetAddressPrivate tests.
859 #define RUN_NETADDRESS_PRIVATE_SUBTESTS \
860 RunTestViaHTTP( \
861 LIST_TEST(NetAddressPrivate_AreEqual) \
862 LIST_TEST(NetAddressPrivate_AreHostsEqual) \
863 LIST_TEST(NetAddressPrivate_Describe) \
864 LIST_TEST(NetAddressPrivate_ReplacePort) \
865 LIST_TEST(NetAddressPrivate_GetAnyAddress) \
866 LIST_TEST(NetAddressPrivate_DescribeIPv6) \
867 LIST_TEST(NetAddressPrivate_GetFamily) \
868 LIST_TEST(NetAddressPrivate_GetPort) \
869 LIST_TEST(NetAddressPrivate_GetAddress) \
870 LIST_TEST(NetAddressPrivate_GetScopeID) \
873 IN_PROC_BROWSER_TEST_F(PPAPITest, NetAddressPrivate) {
874 RUN_NETADDRESS_PRIVATE_SUBTESTS;
876 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetAddressPrivate) {
877 RUN_NETADDRESS_PRIVATE_SUBTESTS;
880 #define RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS \
881 RunTestViaHTTP( \
882 LIST_TEST(NetAddressPrivateUntrusted_AreEqual) \
883 LIST_TEST(NetAddressPrivateUntrusted_AreHostsEqual) \
884 LIST_TEST(NetAddressPrivateUntrusted_Describe) \
885 LIST_TEST(NetAddressPrivateUntrusted_ReplacePort) \
886 LIST_TEST(NetAddressPrivateUntrusted_GetAnyAddress) \
887 LIST_TEST(NetAddressPrivateUntrusted_GetFamily) \
888 LIST_TEST(NetAddressPrivateUntrusted_GetPort) \
889 LIST_TEST(NetAddressPrivateUntrusted_GetAddress) \
892 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, NetAddressPrivate) {
893 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
895 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(NetAddressPrivate)) {
896 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
898 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, NetAddressPrivate) {
899 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
901 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
902 MAYBE_PNACL_NONSFI(NetAddressPrivate)) {
903 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS;
906 // NetworkMonitor tests.
907 #define RUN_NETWORK_MONITOR_SUBTESTS \
908 RunTestViaHTTP( \
909 LIST_TEST(NetworkMonitor_Basic) \
910 LIST_TEST(NetworkMonitor_2Monitors) \
911 LIST_TEST(NetworkMonitor_DeleteInCallback) \
914 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, NetworkMonitor) {
915 RUN_NETWORK_MONITOR_SUBTESTS;
917 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, NetworkMonitor) {
918 RUN_NETWORK_MONITOR_SUBTESTS;
920 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(NetworkMonitor)) {
921 RUN_NETWORK_MONITOR_SUBTESTS;
923 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, NetworkMonitor) {
924 RUN_NETWORK_MONITOR_SUBTESTS;
926 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
927 MAYBE_PNACL_NONSFI(NetworkMonitor)) {
928 RUN_NETWORK_MONITOR_SUBTESTS;
931 // Flash tests.
932 #define RUN_FLASH_SUBTESTS \
933 RunTestViaHTTP( \
934 LIST_TEST(Flash_SetInstanceAlwaysOnTop) \
935 LIST_TEST(Flash_GetCommandLineArgs) \
938 IN_PROC_BROWSER_TEST_F(PPAPITest, Flash) {
939 RUN_FLASH_SUBTESTS;
941 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, Flash) {
942 RUN_FLASH_SUBTESTS;
945 // In-process WebSocket tests. Note, the WebSocket tests are split into two,
946 // because all of them together sometimes take too long on windows:
947 // crbug.com/336999
948 #define RUN_WEBSOCKET_SUBTESTS_1 \
949 RunTestWithWebSocketServer( \
950 LIST_TEST(WebSocket_IsWebSocket) \
951 LIST_TEST(WebSocket_UninitializedPropertiesAccess) \
952 LIST_TEST(WebSocket_InvalidConnect) \
953 LIST_TEST(WebSocket_Protocols) \
954 LIST_TEST(WebSocket_GetURL) \
955 LIST_TEST(WebSocket_ValidConnect) \
956 LIST_TEST(WebSocket_InvalidClose) \
957 LIST_TEST(WebSocket_ValidClose) \
958 LIST_TEST(WebSocket_GetProtocol) \
959 LIST_TEST(WebSocket_TextSendReceive) \
960 LIST_TEST(WebSocket_BinarySendReceive) \
961 LIST_TEST(WebSocket_StressedSendReceive) \
962 LIST_TEST(WebSocket_BufferedAmount) \
965 #define RUN_WEBSOCKET_SUBTESTS_2 \
966 RunTestWithWebSocketServer( \
967 LIST_TEST(WebSocket_AbortCallsWithCallback) \
968 LIST_TEST(WebSocket_AbortSendMessageCall) \
969 LIST_TEST(WebSocket_AbortCloseCall) \
970 LIST_TEST(WebSocket_AbortReceiveMessageCall) \
971 LIST_TEST(WebSocket_ClosedFromServerWhileSending) \
972 LIST_TEST(WebSocket_CcInterfaces) \
973 LIST_TEST(WebSocket_UtilityInvalidConnect) \
974 LIST_TEST(WebSocket_UtilityProtocols) \
975 LIST_TEST(WebSocket_UtilityGetURL) \
976 LIST_TEST(WebSocket_UtilityValidConnect) \
977 LIST_TEST(WebSocket_UtilityInvalidClose) \
978 LIST_TEST(WebSocket_UtilityValidClose) \
979 LIST_TEST(WebSocket_UtilityGetProtocol) \
980 LIST_TEST(WebSocket_UtilityTextSendReceive) \
981 LIST_TEST(WebSocket_UtilityBinarySendReceive) \
982 LIST_TEST(WebSocket_UtilityBufferedAmount) \
985 IN_PROC_BROWSER_TEST_F(PPAPITest, WebSocket1) {
986 RUN_WEBSOCKET_SUBTESTS_1;
988 IN_PROC_BROWSER_TEST_F(PPAPITest, WebSocket2) {
989 RUN_WEBSOCKET_SUBTESTS_2;
991 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, WebSocket1) {
992 RUN_WEBSOCKET_SUBTESTS_1;
994 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, WebSocket2) {
995 RUN_WEBSOCKET_SUBTESTS_2;
997 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(WebSocket1)) {
998 RUN_WEBSOCKET_SUBTESTS_1;
1000 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(WebSocket2)) {
1001 RUN_WEBSOCKET_SUBTESTS_2;
1003 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, WebSocket1) {
1004 RUN_WEBSOCKET_SUBTESTS_1;
1006 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, WebSocket2) {
1007 RUN_WEBSOCKET_SUBTESTS_2;
1009 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, WebSocket1) {
1010 RUN_WEBSOCKET_SUBTESTS_1;
1012 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, WebSocket2) {
1013 RUN_WEBSOCKET_SUBTESTS_2;
1015 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
1016 MAYBE_PNACL_NONSFI(WebSocket1)) {
1017 RUN_WEBSOCKET_SUBTESTS_1;
1019 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
1020 MAYBE_PNACL_NONSFI(WebSocket2)) {
1021 RUN_WEBSOCKET_SUBTESTS_2;
1024 // AudioConfig tests
1025 #define RUN_AUDIO_CONFIG_SUBTESTS \
1026 RunTestViaHTTP( \
1027 LIST_TEST(AudioConfig_RecommendSampleRate) \
1028 LIST_TEST(AudioConfig_ValidConfigs) \
1029 LIST_TEST(AudioConfig_InvalidConfigs) \
1032 IN_PROC_BROWSER_TEST_F(PPAPITest, AudioConfig) {
1033 RUN_AUDIO_CONFIG_SUBTESTS;
1035 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, AudioConfig) {
1036 RUN_AUDIO_CONFIG_SUBTESTS;
1038 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, AudioConfig) {
1039 RUN_AUDIO_CONFIG_SUBTESTS;
1041 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(AudioConfig)) {
1042 RUN_AUDIO_CONFIG_SUBTESTS;
1044 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, AudioConfig) {
1045 RUN_AUDIO_CONFIG_SUBTESTS;
1047 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
1048 MAYBE_PNACL_NONSFI(AudioConfig)) {
1049 RUN_AUDIO_CONFIG_SUBTESTS;
1052 // PPB_Audio tests.
1053 #define RUN_AUDIO_SUBTESTS \
1054 RunTestViaHTTP( \
1055 LIST_TEST(Audio_Creation) \
1056 LIST_TEST(Audio_DestroyNoStop) \
1057 LIST_TEST(Audio_Failures) \
1058 LIST_TEST(Audio_AudioCallback1) \
1059 LIST_TEST(Audio_AudioCallback2) \
1060 LIST_TEST(Audio_AudioCallback3) \
1061 LIST_TEST(Audio_AudioCallback4) \
1064 #if defined(OS_LINUX)
1065 // http://crbug.com/396464
1066 #define MAYBE_Audio DISABLED_Audio
1067 #else
1068 #define MAYBE_Audio Audio
1069 #endif
1070 // PPB_Audio is not supported in-process.
1071 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_Audio) {
1072 RUN_AUDIO_SUBTESTS;
1074 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, Audio) {
1075 RUN_AUDIO_SUBTESTS;
1077 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(Audio)) {
1078 RUN_AUDIO_SUBTESTS;
1080 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, Audio) {
1081 RUN_AUDIO_SUBTESTS;
1083 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
1084 MAYBE_PNACL_NONSFI(Audio)) {
1085 RUN_AUDIO_SUBTESTS;
1088 #define RUN_AUDIO_THREAD_CREATOR_SUBTESTS \
1089 RunTestViaHTTP( \
1090 LIST_TEST(Audio_AudioThreadCreatorIsRequired) \
1091 LIST_TEST(Audio_AudioThreadCreatorIsCalled) \
1094 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, AudioThreadCreator) {
1095 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
1097 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(AudioThreadCreator)) {
1098 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
1100 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, AudioThreadCreator) {
1101 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
1103 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest,
1104 MAYBE_PNACL_NONSFI(AudioThreadCreator)) {
1105 RUN_AUDIO_THREAD_CREATOR_SUBTESTS;
1108 TEST_PPAPI_IN_PROCESS(View_CreatedVisible);
1109 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible);
1110 TEST_PPAPI_NACL(View_CreatedVisible);
1111 // This test ensures that plugins created in a background tab have their
1112 // initial visibility set to false. We don't bother testing in-process for this
1113 // custom test since the out of process code also exercises in-process.
1115 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) {
1116 // Make a second tab in the foreground.
1117 GURL url = GetTestFileUrl("View_CreatedInvisible");
1118 chrome::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK);
1119 params.disposition = NEW_BACKGROUND_TAB;
1120 ui_test_utils::NavigateToURL(&params);
1123 // This test messes with tab visibility so is custom.
1124 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_View_PageHideShow) {
1125 // The plugin will be loaded in the foreground tab and will send us a message.
1126 PPAPITestMessageHandler handler;
1127 content::JavascriptTestObserver observer(
1128 browser()->tab_strip_model()->GetActiveWebContents(),
1129 &handler);
1131 GURL url = GetTestFileUrl("View_PageHideShow");
1132 ui_test_utils::NavigateToURL(browser(), url);
1134 ASSERT_TRUE(observer.Run()) << handler.error_message();
1135 EXPECT_STREQ("TestPageHideShow:Created", handler.message().c_str());
1136 observer.Reset();
1138 // Make a new tab to cause the original one to hide, this should trigger the
1139 // next phase of the test.
1140 chrome::NavigateParams params(
1141 browser(), GURL(url::kAboutBlankURL), content::PAGE_TRANSITION_LINK);
1142 params.disposition = NEW_FOREGROUND_TAB;
1143 ui_test_utils::NavigateToURL(&params);
1145 // Wait until the test acks that it got hidden.
1146 ASSERT_TRUE(observer.Run()) << handler.error_message();
1147 EXPECT_STREQ("TestPageHideShow:Hidden", handler.message().c_str());
1148 observer.Reset();
1150 // Switch back to the test tab.
1151 browser()->tab_strip_model()->ActivateTabAt(0, true);
1153 ASSERT_TRUE(observer.Run()) << handler.error_message();
1154 EXPECT_STREQ("PASS", handler.message().c_str());
1157 // Tests that if a plugin accepts touch events, the browser knows to send touch
1158 // events to the renderer.
1159 IN_PROC_BROWSER_TEST_F(PPAPITest, InputEvent_AcceptTouchEvent) {
1160 std::string positive_tests[] = { "InputEvent_AcceptTouchEvent_1",
1161 "InputEvent_AcceptTouchEvent_2",
1162 "InputEvent_AcceptTouchEvent_3",
1163 "InputEvent_AcceptTouchEvent_4"
1166 for (size_t i = 0; i < arraysize(positive_tests); ++i) {
1167 RenderViewHost* host = browser()->tab_strip_model()->
1168 GetActiveWebContents()->GetRenderViewHost();
1169 RunTest(positive_tests[i]);
1170 EXPECT_TRUE(content::RenderViewHostTester::HasTouchEventHandler(host));
1174 // View tests.
1175 #define RUN_VIEW_SUBTESTS \
1176 RunTestViaHTTP( \
1177 LIST_TEST(View_SizeChange) \
1178 LIST_TEST(View_ClipChange) \
1179 LIST_TEST(View_ScrollOffsetChange) \
1182 IN_PROC_BROWSER_TEST_F(PPAPITest, View) {
1183 RUN_VIEW_SUBTESTS;
1185 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View) {
1186 RUN_VIEW_SUBTESTS;
1188 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, View) {
1189 RUN_VIEW_SUBTESTS;
1191 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(View)) {
1192 RUN_VIEW_SUBTESTS;
1194 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, View) {
1195 RUN_VIEW_SUBTESTS;
1197 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, MAYBE_PNACL_NONSFI(View)) {
1198 RUN_VIEW_SUBTESTS;
1201 // FlashMessageLoop tests.
1202 #define RUN_FLASH_MESSAGE_LOOP_SUBTESTS \
1203 RunTest( \
1204 LIST_TEST(FlashMessageLoop_Basics) \
1205 LIST_TEST(FlashMessageLoop_RunWithoutQuit) \
1208 IN_PROC_BROWSER_TEST_F(PPAPITest, FlashMessageLoop) {
1209 RUN_FLASH_MESSAGE_LOOP_SUBTESTS;
1211 #if defined(OS_LINUX) // Disabled due to flakiness http://crbug.com/316925
1212 #define MAYBE_FlashMessageLoop DISABLED_FlashMessageLoop
1213 #else
1214 #define MAYBE_FlashMessageLoop FlashMessageLoop
1215 #endif
1216 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_FlashMessageLoop) {
1217 RUN_FLASH_MESSAGE_LOOP_SUBTESTS;
1220 // The compositor test timeouts sometimes, so we have to split it to two
1221 // subtests.
1222 #define RUN_COMPOSITOR_SUBTESTS_0 \
1223 RunTestViaHTTP( \
1224 LIST_TEST(Compositor_BindUnbind) \
1225 LIST_TEST(Compositor_Release) \
1226 LIST_TEST(Compositor_ReleaseUnbound) \
1227 LIST_TEST(Compositor_ReleaseWithoutCommit) \
1228 LIST_TEST(Compositor_ReleaseWithoutCommitUnbound) \
1231 #define RUN_COMPOSITOR_SUBTESTS_1 \
1232 RunTestViaHTTP( \
1233 LIST_TEST(Compositor_CommitTwoTimesWithoutChange) \
1234 LIST_TEST(Compositor_CommitTwoTimesWithoutChangeUnbound) \
1235 LIST_TEST(Compositor_General) \
1236 LIST_TEST(Compositor_GeneralUnbound) \
1239 #if defined(OS_WIN)
1240 // This test fails with the test compositor which is what's used by default for
1241 // browser tests on Windows. Renable when the software compositor is available.
1242 #define MAYBE_Compositor0 DISABLED_Compositor0
1243 #define MAYBE_Compositor1 DISABLED_Compositor1
1244 #elif defined(OS_MACOSX)
1245 // This test fails when using the legacy software mode. Reenable when the
1246 // software compositor is enabled crbug.com/286038
1247 #define MAYBE_Compositor0 DISABLED_Compositor0
1248 #define MAYBE_Compositor1 DISABLED_Compositor1
1249 #else
1250 // flaky on Linux: http://crbug.com/396482
1251 #define MAYBE_Compositor0 DISABLED_Compositor0
1252 #define MAYBE_Compositor1 DISABLED_Compositor1
1253 #endif
1255 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor0, RUN_COMPOSITOR_SUBTESTS_0)
1256 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor1, RUN_COMPOSITOR_SUBTESTS_1)
1258 TEST_PPAPI_NACL(MediaStreamAudioTrack)
1260 TEST_PPAPI_NACL(MediaStreamVideoTrack)
1262 TEST_PPAPI_NACL(MouseCursor)
1264 TEST_PPAPI_NACL(NetworkProxy)
1266 TEST_PPAPI_NACL(TrueTypeFont)
1268 TEST_PPAPI_NACL(VideoDecoder)
1270 // VideoDestination doesn't work in content_browsertests.
1271 TEST_PPAPI_OUT_OF_PROCESS(VideoDestination)
1272 TEST_PPAPI_NACL(VideoDestination)
1274 // VideoSource doesn't work in content_browsertests.
1275 TEST_PPAPI_OUT_OF_PROCESS(VideoSource)
1276 TEST_PPAPI_NACL(VideoSource)
1278 // Printing doesn't work in content_browsertests.
1279 TEST_PPAPI_OUT_OF_PROCESS(Printing)
1281 TEST_PPAPI_NACL(MessageHandler)
1283 TEST_PPAPI_NACL(MessageLoop_Basics)
1284 TEST_PPAPI_NACL(MessageLoop_Post)
1286 // Going forward, Flash APIs will only work out-of-process.
1287 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetLocalTimeZoneOffset)
1288 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL)
1289 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetSetting)
1290 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetCrashData)
1291 // http://crbug.com/176822
1292 #if !defined(OS_WIN)
1293 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard)
1294 #endif
1295 TEST_PPAPI_OUT_OF_PROCESS(FlashFile)
1296 // Mac/Aura reach NOTIMPLEMENTED/time out.
1297 // mac: http://crbug.com/96767
1298 // aura: http://crbug.com/104384
1299 // cros: http://crbug.com/396502
1300 #if defined(OS_MACOSX) || defined(OS_CHROMEOS)
1301 #define MAYBE_FlashFullscreen DISABLED_FlashFullscreen
1302 #else
1303 #define MAYBE_FlashFullscreen FlashFullscreen
1304 #endif
1305 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_FlashFullscreen)
1307 TEST_PPAPI_OUT_OF_PROCESS(PDF)
1309 // TODO(dalecurtis): Renable once the platform verification infobar has been
1310 // implemented; see http://crbug.com/270908
1311 // #if defined(OS_CHROMEOS)
1312 // TEST_PPAPI_OUT_OF_PROCESS(PlatformVerificationPrivate)
1313 // #endif
1315 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FlashDRM) {
1316 RunTest(
1317 #if (defined(OS_WIN) && defined(ENABLE_RLZ)) || defined(OS_CHROMEOS)
1318 // Only implemented on Windows and ChromeOS currently.
1319 LIST_TEST(FlashDRM_GetDeviceID)
1320 #endif
1321 LIST_TEST(FlashDRM_GetHmonitor)
1322 LIST_TEST(FlashDRM_GetVoucherFile));
1325 TEST_PPAPI_IN_PROCESS(TalkPrivate)
1326 TEST_PPAPI_OUT_OF_PROCESS(TalkPrivate)
1328 #if defined(OS_CHROMEOS)
1329 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate)
1330 #endif