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/extensions/extension_browsertest.h"
9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/browser_navigator.h"
12 #include "chrome/browser/ui/extensions/app_launch_params.h"
13 #include "chrome/browser/ui/extensions/application_launch.h"
14 #include "chrome/browser/ui/tabs/tab_strip_model.h"
15 #include "chrome/common/chrome_paths.h"
16 #include "chrome/test/base/ui_test_utils.h"
17 #include "chrome/test/nacl/nacl_browsertest_util.h"
18 #include "chrome/test/ppapi/ppapi_test.h"
19 #include "components/content_settings/core/browser/host_content_settings_map.h"
20 #include "components/nacl/common/nacl_switches.h"
21 #include "content/public/browser/web_contents.h"
22 #include "content/public/common/content_switches.h"
23 #include "content/public/common/url_constants.h"
24 #include "content/public/test/javascript_test_observer.h"
25 #include "content/public/test/test_renderer_host.h"
26 #include "extensions/common/constants.h"
27 #include "extensions/test/extension_test_message_listener.h"
28 #include "ppapi/shared_impl/test_utils.h"
30 using content::RenderViewHost
;
32 // This macro finesses macro expansion to do what we want.
33 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name)
34 // Turn the given token into a string. This allows us to use precompiler stuff
35 // to turn names into DISABLED_Foo, but still pass a string to RunTest.
36 #define STRINGIFY(test_name) #test_name
37 #define LIST_TEST(test_name) STRINGIFY(test_name) ","
39 // Use these macros to run the tests for a specific interface.
40 // Most interfaces should be tested with both macros.
41 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \
42 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
43 RunTest(STRIP_PREFIXES(test_name)); \
46 // Similar macros that test over HTTP.
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_OUT_OF_PROCESS_WITH_SSL_SERVER(test_name) \
54 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
55 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
58 // Disable all NaCl tests for --disable-nacl flag and on Mac ASAN builds.
60 // http://crbug.com/428670
62 #if defined(DISABLE_NACL) || (defined(OS_MACOSX) && defined(ADDRESS_SANITIZER))
64 #define MAYBE_PPAPI_NACL(test_name) DISABLED_##test_name
66 #define TEST_PPAPI_NACL(test_name)
67 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name)
68 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name)
69 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement)
73 #define MAYBE_PPAPI_NACL(test_name) test_name
75 // NaCl based PPAPI tests
76 #define TEST_PPAPI_NACL(test_name) \
77 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
78 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
80 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
81 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
83 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
84 MAYBE_PNACL_NONSFI(test_name)) { \
85 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
88 // NaCl based PPAPI tests
89 #define TEST_PPAPI_NACL_SUBTESTS(test_name, run_statement) \
90 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
93 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
96 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
97 MAYBE_PNACL_NONSFI(test_name)) { \
101 // NaCl based PPAPI tests with disallowed socket API
102 #define TEST_PPAPI_NACL_DISALLOWED_SOCKETS(test_name) \
103 IN_PROC_BROWSER_TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \
104 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \
107 // NaCl based PPAPI tests with SSL server
108 #define TEST_PPAPI_NACL_WITH_SSL_SERVER(test_name) \
109 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, test_name) { \
110 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
112 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, test_name) { \
113 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
115 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
116 MAYBE_PNACL_NONSFI(test_name)) { \
117 RunTestWithSSLServer(STRIP_PREFIXES(test_name)); \
121 #endif // DISABLE_NACL
127 // Flaky, http://crbug.com/111355
128 TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Broker
)
130 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest
, Accept
) {
131 // Accepting the infobar should grant permission to access the PPAPI broker.
132 InfoBarObserver
observer(this);
133 observer
.ExpectInfoBarAndAccept(true);
135 // PPB_Broker_Trusted::IsAllowed should return false before the infobar is
136 // popped and true after the infobar is popped.
137 RunTest("Broker_IsAllowedPermissionDenied");
138 RunTest("Broker_ConnectPermissionGranted");
139 RunTest("Broker_IsAllowedPermissionGranted");
141 // It should also set a content settings exception for the site.
142 GURL url
= GetTestFileUrl("Broker_ConnectPermissionGranted");
143 HostContentSettingsMap
* content_settings
=
144 browser()->profile()->GetHostContentSettingsMap();
145 EXPECT_EQ(CONTENT_SETTING_ALLOW
,
146 content_settings
->GetContentSetting(
147 url
, url
, CONTENT_SETTINGS_TYPE_PPAPI_BROKER
, std::string()));
150 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest
, Deny
) {
151 // Canceling the infobar should deny permission to access the PPAPI broker.
152 InfoBarObserver
observer(this);
153 observer
.ExpectInfoBarAndAccept(false);
155 // PPB_Broker_Trusted::IsAllowed should return false before and after the
156 // infobar is popped.
157 RunTest("Broker_IsAllowedPermissionDenied");
158 RunTest("Broker_ConnectPermissionDenied");
159 RunTest("Broker_IsAllowedPermissionDenied");
161 // It should also set a content settings exception for the site.
162 GURL url
= GetTestFileUrl("Broker_ConnectPermissionDenied");
163 HostContentSettingsMap
* content_settings
=
164 browser()->profile()->GetHostContentSettingsMap();
165 EXPECT_EQ(CONTENT_SETTING_BLOCK
,
166 content_settings
->GetContentSetting(
167 url
, url
, CONTENT_SETTINGS_TYPE_PPAPI_BROKER
, std::string()));
170 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest
, Blocked
) {
171 // Block access to the PPAPI broker.
172 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
173 CONTENT_SETTINGS_TYPE_PPAPI_BROKER
, CONTENT_SETTING_BLOCK
);
175 // We shouldn't see an infobar.
176 InfoBarObserver
observer(this);
178 RunTest("Broker_ConnectPermissionDenied");
179 RunTest("Broker_IsAllowedPermissionDenied");
182 IN_PROC_BROWSER_TEST_F(PPAPIBrokerInfoBarTest
, Allowed
) {
183 // Always allow access to the PPAPI broker.
184 browser()->profile()->GetHostContentSettingsMap()->SetDefaultContentSetting(
185 CONTENT_SETTINGS_TYPE_PPAPI_BROKER
, CONTENT_SETTING_ALLOW
);
187 // We shouldn't see an infobar.
188 InfoBarObserver
observer(this);
190 RunTest("Broker_ConnectPermissionGranted");
191 RunTest("Broker_IsAllowedPermissionGranted");
194 TEST_PPAPI_NACL(Console
)
196 TEST_PPAPI_NACL(Core
)
198 // Non-NaCl TraceEvent tests are in content/test/ppapi/ppapi_browsertest.cc.
199 TEST_PPAPI_NACL(TraceEvent
)
201 TEST_PPAPI_NACL(InputEvent
)
203 // Flaky on Linux and Windows. http://crbug.com/135403
204 #if defined(OS_LINUX) || defined(OS_WIN)
205 #define MAYBE_ImeInputEvent DISABLED_ImeInputEvent
207 #define MAYBE_ImeInputEvent ImeInputEvent
210 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_ImeInputEvent
)
211 TEST_PPAPI_NACL(MAYBE_ImeInputEvent
)
213 // Graphics2D_Dev isn't supported in NaCl, only test the other interfaces
214 // TODO(jhorwich) Enable when Graphics2D_Dev interfaces are proxied in NaCl.
215 TEST_PPAPI_NACL(Graphics2D_InvalidResource
)
216 TEST_PPAPI_NACL(Graphics2D_InvalidSize
)
217 TEST_PPAPI_NACL(Graphics2D_Humongous
)
218 TEST_PPAPI_NACL(Graphics2D_InitToZero
)
219 TEST_PPAPI_NACL(Graphics2D_Describe
)
220 TEST_PPAPI_NACL(Graphics2D_Paint
)
221 TEST_PPAPI_NACL(Graphics2D_Scroll
)
222 TEST_PPAPI_NACL(Graphics2D_Replace
)
223 TEST_PPAPI_NACL(Graphics2D_Flush
)
224 TEST_PPAPI_NACL(Graphics2D_FlushOffscreenUpdate
)
225 TEST_PPAPI_NACL(Graphics2D_BindNull
)
228 #if defined(USE_AURA)
229 // These tests fail with the test compositor which is what's used by default for
230 // browser tests on Windows Aura. Renable when the software compositor is
232 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
233 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
234 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
235 #else // defined(USE_AURA)
236 // In-process and NaCl tests are having flaky failures on Win: crbug.com/242252
237 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
238 #define MAYBE_OUT_Graphics3D Graphics3D
239 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
240 #endif // defined(USE_AURA)
241 #elif defined(OS_MACOSX)
242 // These tests fail when using the legacy software mode. Reenable when the
243 // software compositor is enabled crbug.com/286038
244 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
245 #define MAYBE_OUT_Graphics3D DISABLED_Graphics3D
246 #define MAYBE_NACL_Graphics3D DISABLED_Graphics3D
248 // The tests are failing in-process. crbug.com/280282
249 #define MAYBE_IN_Graphics3D DISABLED_Graphics3D
250 #define MAYBE_OUT_Graphics3D Graphics3D
251 #define MAYBE_NACL_Graphics3D Graphics3D
253 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_OUT_Graphics3D
)
254 TEST_PPAPI_NACL(MAYBE_NACL_Graphics3D
)
256 TEST_PPAPI_NACL(ImageData
)
258 // TCPSocket and TCPSocketPrivate tests.
259 #define RUN_TCPSOCKET_SUBTESTS \
261 LIST_TEST(TCPSocket_Connect) \
262 LIST_TEST(TCPSocket_ReadWrite) \
263 LIST_TEST(TCPSocket_SetOption) \
264 LIST_TEST(TCPSocket_Listen) \
265 LIST_TEST(TCPSocket_Backlog) \
266 LIST_TEST(TCPSocket_Interface_1_0) \
269 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, TCPSocket
) {
270 RUN_TCPSOCKET_SUBTESTS
;
272 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(TCPSocket
)) {
273 RUN_TCPSOCKET_SUBTESTS
;
275 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(TCPSocket
)) {
276 RUN_TCPSOCKET_SUBTESTS
;
278 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
279 MAYBE_PNACL_NONSFI(TCPSocket
)) {
280 RUN_TCPSOCKET_SUBTESTS
;
284 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(TCPServerSocketPrivate
)
285 TEST_PPAPI_NACL(TCPServerSocketPrivate
)
287 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivate
)
289 TEST_PPAPI_NACL_WITH_SSL_SERVER(TCPSocketPrivate
)
291 TEST_PPAPI_OUT_OF_PROCESS_WITH_SSL_SERVER(TCPSocketPrivateTrusted
)
294 // UDPSocket_Broadcast is disabled for OSX because it requires root
295 // permissions on OSX 10.7+.
296 #if defined(OS_MACOSX)
297 #define MAYBE_UDPSocket_Broadcast DISABLED_UDPSocket_Broadcast
299 #define MAYBE_UDPSocket_Broadcast UDPSocket_Broadcast
302 #define UDPSOCKET_TEST(_test) \
303 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, _test) { \
304 RunTestViaHTTP(LIST_TEST(_test)); \
306 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest, MAYBE_PPAPI_NACL(_test)) { \
307 RunTestViaHTTP(LIST_TEST(_test)); \
309 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest, MAYBE_GLIBC(_test)) { \
310 RunTestViaHTTP(LIST_TEST(_test)); \
312 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest, MAYBE_PPAPI_NACL(_test)) { \
313 RunTestViaHTTP(LIST_TEST(_test)); \
315 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest, \
316 MAYBE_PNACL_NONSFI(_test)) { \
317 RunTestViaHTTP(LIST_TEST(_test)); \
320 // Instead of one single test for all UDPSocket features (like it is done for
321 // TCPSocket), split them into multiple, making it easier to isolate which tests
323 UDPSOCKET_TEST(UDPSocket_ReadWrite
)
324 UDPSOCKET_TEST(UDPSocket_SetOption
)
325 UDPSOCKET_TEST(UDPSocket_SetOption_1_0
)
326 UDPSOCKET_TEST(UDPSocket_SetOption_1_1
)
327 UDPSOCKET_TEST(MAYBE_UDPSocket_Broadcast
)
328 UDPSOCKET_TEST(UDPSocket_ParallelSend
)
329 UDPSOCKET_TEST(UDPSocket_Multicast
)
331 // UDPSocketPrivate tests.
332 // UDPSocketPrivate_Broadcast is disabled for OSX because it requires root
333 // permissions on OSX 10.7+.
334 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Connect
)
335 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_ConnectFailure
)
336 #if !defined(OS_MACOSX)
337 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_Broadcast
)
338 #endif // !defined(OS_MACOSX)
339 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(UDPSocketPrivate_SetSocketFeatureErrors
)
340 TEST_PPAPI_NACL(UDPSocketPrivate_Connect
)
341 TEST_PPAPI_NACL(UDPSocketPrivate_ConnectFailure
)
342 #if !defined(OS_MACOSX)
343 TEST_PPAPI_NACL(UDPSocketPrivate_Broadcast
)
344 #endif // !defined(OS_MACOSX)
345 TEST_PPAPI_NACL(UDPSocketPrivate_SetSocketFeatureErrors
)
347 // Disallowed socket tests.
348 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(HostResolverPrivateDisallowed
)
349 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPServerSocketPrivateDisallowed
)
350 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(TCPSocketPrivateDisallowed
)
351 TEST_PPAPI_NACL_DISALLOWED_SOCKETS(UDPSocketPrivateDisallowed
)
353 // HostResolver and HostResolverPrivate tests.
354 #define RUN_HOST_RESOLVER_SUBTESTS \
356 LIST_TEST(HostResolver_Empty) \
357 LIST_TEST(HostResolver_Resolve) \
358 LIST_TEST(HostResolver_ResolveIPv4) \
361 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, HostResolver
) {
362 RUN_HOST_RESOLVER_SUBTESTS
;
365 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(HostResolver
)) {
366 RUN_HOST_RESOLVER_SUBTESTS
;
368 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(HostResolver
)) {
369 RUN_HOST_RESOLVER_SUBTESTS
;
371 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
372 MAYBE_PNACL_NONSFI(HostResolver
)) {
373 RUN_HOST_RESOLVER_SUBTESTS
;
376 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_Resolve
)
377 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(HostResolverPrivate_ResolveIPv4
)
378 TEST_PPAPI_NACL(HostResolverPrivate_Resolve
)
379 TEST_PPAPI_NACL(HostResolverPrivate_ResolveIPv4
)
381 // URLLoader tests. These are split into multiple test fixtures because if we
382 // run them all together, they tend to time out.
383 #define RUN_URLLOADER_SUBTESTS_0 \
385 LIST_TEST(URLLoader_BasicGET) \
386 LIST_TEST(URLLoader_BasicPOST) \
387 LIST_TEST(URLLoader_BasicFilePOST) \
388 LIST_TEST(URLLoader_BasicFileRangePOST) \
389 LIST_TEST(URLLoader_CompoundBodyPOST) \
392 #define RUN_URLLOADER_SUBTESTS_1 \
394 LIST_TEST(URLLoader_EmptyDataPOST) \
395 LIST_TEST(URLLoader_BinaryDataPOST) \
396 LIST_TEST(URLLoader_CustomRequestHeader) \
397 LIST_TEST(URLLoader_FailsBogusContentLength) \
398 LIST_TEST(URLLoader_StreamToFile) \
401 // TODO(bbudge) Fix Javascript URLs for trusted loaders.
402 // http://crbug.com/103062
403 #define RUN_URLLOADER_SUBTESTS_2 \
405 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
406 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
407 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
408 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
411 #define RUN_URLLOADER_NACL_SUBTESTS_2 \
413 LIST_TEST(URLLoader_UntrustedSameOriginRestriction) \
414 LIST_TEST(URLLoader_UntrustedCrossOriginRequest) \
415 LIST_TEST(URLLoader_UntrustedJavascriptURLRestriction) \
416 LIST_TEST(DISABLED_URLLoader_TrustedJavascriptURLRestriction) \
419 #define RUN_URLLOADER_SUBTESTS_3 \
421 LIST_TEST(URLLoader_UntrustedHttpRequests) \
422 LIST_TEST(URLLoader_FollowURLRedirect) \
423 LIST_TEST(URLLoader_AuditURLRedirect) \
424 LIST_TEST(URLLoader_AbortCalls) \
425 LIST_TEST(URLLoader_UntendedLoad) \
426 LIST_TEST(URLLoader_PrefetchBufferThreshold) \
429 // Note: we do not support Trusted APIs in NaCl, so these will be skipped.
430 // XRequestedWithHeader isn't trusted per-se, but the header isn't provided
431 // for NaCl and thus must be skipped.
432 #define RUN_URLLOADER_TRUSTED_SUBTESTS \
434 LIST_TEST(URLLoader_TrustedSameOriginRestriction) \
435 LIST_TEST(URLLoader_TrustedCrossOriginRequest) \
436 LIST_TEST(URLLoader_TrustedHttpRequests) \
437 LIST_TEST(URLLoader_XRequestedWithHeader) \
440 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, URLLoader0
) {
441 RUN_URLLOADER_SUBTESTS_0
;
443 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, URLLoader1
) {
444 RUN_URLLOADER_SUBTESTS_1
;
446 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, URLLoader2
) {
447 RUN_URLLOADER_SUBTESTS_2
;
449 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, URLLoader3
) {
450 RUN_URLLOADER_SUBTESTS_3
;
452 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, URLLoaderTrusted
) {
453 RUN_URLLOADER_TRUSTED_SUBTESTS
;
455 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(URLLoader0
)) {
456 RUN_URLLOADER_SUBTESTS_0
;
458 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(URLLoader1
)) {
459 RUN_URLLOADER_SUBTESTS_1
;
462 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(URLLoader2
)) {
463 RUN_URLLOADER_SUBTESTS_2
;
465 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(URLLoader3
)) {
466 RUN_URLLOADER_SUBTESTS_3
;
469 // Flaky on 32-bit linux bot; http://crbug.com/308906
470 #if defined(OS_LINUX) && defined(ARCH_CPU_X86)
471 #define MAYBE_URLLoader_BasicFilePOST DISABLED_URLLoader_BasicFilePOST
473 #define MAYBE_URLLoader_BasicFilePOST URLLoader_BasicFilePOST
476 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(URLLoader0
)) {
477 RUN_URLLOADER_SUBTESTS_0
;
479 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(URLLoader1
)) {
480 RUN_URLLOADER_SUBTESTS_1
;
482 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(URLLoader2
)) {
483 RUN_URLLOADER_SUBTESTS_2
;
485 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(URLLoader3
)) {
486 RUN_URLLOADER_SUBTESTS_3
;
488 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
489 MAYBE_PNACL_NONSFI(URLLoader0
)) {
490 RUN_URLLOADER_SUBTESTS_0
;
492 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
493 MAYBE_PNACL_NONSFI(URLLoader1
)) {
494 RUN_URLLOADER_SUBTESTS_1
;
496 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
497 MAYBE_PNACL_NONSFI(URLLoader2
)) {
498 RUN_URLLOADER_SUBTESTS_2
;
500 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
501 MAYBE_PNACL_NONSFI(URLLoader3
)) {
502 RUN_URLLOADER_SUBTESTS_3
;
506 // URLRequestInfo tests.
507 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_CreateAndIsURLRequestInfo
)
509 // Timing out on Windows. http://crbug.com/129571
511 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
512 DISABLED_URLRequest_CreateAndIsURLRequestInfo
514 #define MAYBE_URLRequest_CreateAndIsURLRequestInfo \
515 URLRequest_CreateAndIsURLRequestInfo
517 TEST_PPAPI_NACL(MAYBE_URLRequest_CreateAndIsURLRequestInfo
)
519 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_SetProperty
)
520 TEST_PPAPI_NACL(URLRequest_SetProperty
)
521 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_AppendDataToBody
)
522 TEST_PPAPI_NACL(URLRequest_AppendDataToBody
)
523 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(DISABLED_URLRequest_AppendFileToBody
)
524 TEST_PPAPI_NACL(DISABLED_URLRequest_AppendFileToBody
)
525 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_Stress
)
526 TEST_PPAPI_NACL(URLRequest_Stress
)
528 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator
)
529 TEST_PPAPI_NACL(PaintAggregator
)
531 // TODO(danakj): http://crbug.com/115286
532 TEST_PPAPI_NACL(DISABLED_Scrollbar
)
536 TEST_PPAPI_NACL(VarResource
)
538 // PostMessage tests.
539 #define RUN_POSTMESSAGE_SUBTESTS \
541 LIST_TEST(PostMessage_SendInInit) \
542 LIST_TEST(PostMessage_SendingData) \
543 LIST_TEST(PostMessage_SendingString) \
544 LIST_TEST(PostMessage_SendingArrayBuffer) \
545 LIST_TEST(PostMessage_SendingArray) \
546 LIST_TEST(PostMessage_SendingDictionary) \
547 LIST_TEST(PostMessage_SendingResource) \
548 LIST_TEST(PostMessage_SendingComplexVar) \
549 LIST_TEST(PostMessage_MessageEvent) \
550 LIST_TEST(PostMessage_NoHandler) \
551 LIST_TEST(PostMessage_ExtraParam) \
552 LIST_TEST(PostMessage_NonMainThread) \
555 // Windows defines 'PostMessage', so we have to undef it.
561 // http://crbug.com/95557
562 #define MAYBE_PostMessage DISABLED_PostMessage
564 #define MAYBE_PostMessage PostMessage
566 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, MAYBE_PostMessage
) {
567 RUN_POSTMESSAGE_SUBTESTS
;
570 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(PostMessage
)) {
571 RUN_POSTMESSAGE_SUBTESTS
;
573 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(PostMessage
)) {
574 RUN_POSTMESSAGE_SUBTESTS
;
576 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
577 MAYBE_PNACL_NONSFI(PostMessage
)) {
578 RUN_POSTMESSAGE_SUBTESTS
;
581 TEST_PPAPI_NACL(Memory
)
584 #define RUN_FILEIO_SUBTESTS \
586 LIST_TEST(FileIO_Open) \
587 LIST_TEST(FileIO_OpenDirectory) \
588 LIST_TEST(FileIO_AbortCalls) \
589 LIST_TEST(FileIO_ParallelReads) \
590 LIST_TEST(FileIO_ParallelWrites) \
591 LIST_TEST(FileIO_NotAllowMixedReadWrite) \
592 LIST_TEST(FileIO_ReadWriteSetLength) \
593 LIST_TEST(FileIO_ReadToArrayWriteSetLength) \
594 LIST_TEST(FileIO_TouchQuery) \
597 #define RUN_FILEIO_PRIVATE_SUBTESTS \
599 LIST_TEST(FileIO_RequestOSFileHandle) \
600 LIST_TEST(FileIO_RequestOSFileHandleWithOpenExclusive) \
601 LIST_TEST(FileIO_Mmap) \
604 IN_PROC_BROWSER_TEST_F(PPAPIPrivateTest
, FileIO_Private
) {
605 RUN_FILEIO_PRIVATE_SUBTESTS
;
608 // See: crbug.com/421284
609 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, DISABLED_FileIO
) {
612 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPIPrivateTest
, FileIO_Private
) {
613 RUN_FILEIO_PRIVATE_SUBTESTS
;
616 // http://crbug.com/313401
617 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, DISABLED_FileIO
) {
620 // http://crbug.com/313401
621 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClNewlibTest
,
622 DISABLED_NaCl_Newlib_FileIO_Private
) {
623 RUN_FILEIO_PRIVATE_SUBTESTS
;
626 // http://crbug.com/313205
627 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, DISABLED_FileIO
) {
630 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClTest
,
631 DISABLED_PNaCl_FileIO_Private
) {
632 RUN_FILEIO_PRIVATE_SUBTESTS
;
635 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
, MAYBE_PNACL_NONSFI(FileIO
)) {
638 IN_PROC_BROWSER_TEST_F(PPAPIPrivateNaClPNaClNonSfiTest
,
639 MAYBE_PNACL_NONSFI(FILEIO_Private
)) {
640 RUN_FILEIO_PRIVATE_SUBTESTS
;
644 #define RUN_FILEREF_SUBTESTS_1 \
646 LIST_TEST(FileRef_Create) \
647 LIST_TEST(FileRef_GetFileSystemType) \
648 LIST_TEST(FileRef_GetName) \
649 LIST_TEST(FileRef_GetPath) \
650 LIST_TEST(FileRef_GetParent) \
651 LIST_TEST(FileRef_MakeDirectory) \
654 #define RUN_FILEREF_SUBTESTS_2 \
656 LIST_TEST(FileRef_QueryAndTouchFile) \
657 LIST_TEST(FileRef_DeleteFileAndDirectory) \
658 LIST_TEST(FileRef_RenameFileAndDirectory) \
659 LIST_TEST(FileRef_Query) \
660 LIST_TEST(FileRef_FileNameEscaping) \
663 // Note, the FileRef tests are split into two, because all of them together
664 // sometimes take too long on windows: crbug.com/336999
665 // FileRef_ReadDirectoryEntries is flaky, so left out. See crbug.com/241646.
666 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, FileRef1
) {
667 RUN_FILEREF_SUBTESTS_1
;
669 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, FileRef2
) {
670 RUN_FILEREF_SUBTESTS_2
;
673 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(FileRef1
)) {
674 RUN_FILEREF_SUBTESTS_1
;
676 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, MAYBE_PPAPI_NACL(FileRef2
)) {
677 RUN_FILEREF_SUBTESTS_2
;
679 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(FileRef1
)) {
680 RUN_FILEREF_SUBTESTS_1
;
682 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, MAYBE_PPAPI_NACL(FileRef2
)) {
683 RUN_FILEREF_SUBTESTS_2
;
685 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
686 MAYBE_PNACL_NONSFI(FileRef1
)) {
687 RUN_FILEREF_SUBTESTS_1
;
689 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
690 MAYBE_PNACL_NONSFI(FileRef2
)) {
691 RUN_FILEREF_SUBTESTS_2
;
694 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(FileSystem
)
696 // PPAPINaClTest.FileSystem times out consistently on Windows and Mac.
697 // http://crbug.com/130372
698 #if defined(OS_MACOSX) || defined(OS_WIN)
699 #define MAYBE_FileSystem DISABLED_FileSystem
701 #define MAYBE_FileSystem FileSystem
704 TEST_PPAPI_NACL(MAYBE_FileSystem
)
706 #if defined(OS_MACOSX)
707 // http://crbug.com/103912
708 #define MAYBE_Fullscreen DISABLED_Fullscreen
709 #elif defined(OS_LINUX)
710 // http://crbug.com/146008
711 #define MAYBE_Fullscreen DISABLED_Fullscreen
712 #elif defined(OS_WIN)
713 // http://crbug.com/342269
714 #define MAYBE_Fullscreen DISABLED_Fullscreen
716 #define MAYBE_Fullscreen Fullscreen
719 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_Fullscreen
)
720 TEST_PPAPI_NACL(MAYBE_Fullscreen
)
722 TEST_PPAPI_OUT_OF_PROCESS(X509CertificatePrivate
)
724 TEST_PPAPI_OUT_OF_PROCESS(UMA
)
728 #define RUN_NETADDRESS_SUBTESTS \
730 LIST_TEST(NetAddress_IPv4Address) \
731 LIST_TEST(NetAddress_IPv6Address) \
732 LIST_TEST(NetAddress_DescribeAsString) \
735 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, NetAddress
) {
736 RUN_NETADDRESS_SUBTESTS
;
738 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, NetAddress
) {
739 RUN_NETADDRESS_SUBTESTS
;
741 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, NetAddress
) {
742 RUN_NETADDRESS_SUBTESTS
;
744 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
745 MAYBE_PNACL_NONSFI(NetAddress
)) {
746 RUN_NETADDRESS_SUBTESTS
;
749 // NetAddressPrivate tests.
750 #define RUN_NETADDRESS_PRIVATE_SUBTESTS \
752 LIST_TEST(NetAddressPrivate_AreEqual) \
753 LIST_TEST(NetAddressPrivate_AreHostsEqual) \
754 LIST_TEST(NetAddressPrivate_Describe) \
755 LIST_TEST(NetAddressPrivate_ReplacePort) \
756 LIST_TEST(NetAddressPrivate_GetAnyAddress) \
757 LIST_TEST(NetAddressPrivate_DescribeIPv6) \
758 LIST_TEST(NetAddressPrivate_GetFamily) \
759 LIST_TEST(NetAddressPrivate_GetPort) \
760 LIST_TEST(NetAddressPrivate_GetAddress) \
761 LIST_TEST(NetAddressPrivate_GetScopeID) \
764 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, NetAddressPrivate
) {
765 RUN_NETADDRESS_PRIVATE_SUBTESTS
;
768 #define RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS \
770 LIST_TEST(NetAddressPrivateUntrusted_AreEqual) \
771 LIST_TEST(NetAddressPrivateUntrusted_AreHostsEqual) \
772 LIST_TEST(NetAddressPrivateUntrusted_Describe) \
773 LIST_TEST(NetAddressPrivateUntrusted_ReplacePort) \
774 LIST_TEST(NetAddressPrivateUntrusted_GetAnyAddress) \
775 LIST_TEST(NetAddressPrivateUntrusted_GetFamily) \
776 LIST_TEST(NetAddressPrivateUntrusted_GetPort) \
777 LIST_TEST(NetAddressPrivateUntrusted_GetAddress) \
780 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, NetAddressPrivate
) {
781 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS
;
783 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, NetAddressPrivate
) {
784 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS
;
786 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
787 MAYBE_PNACL_NONSFI(NetAddressPrivate
)) {
788 RUN_NETADDRESS_PRIVATE_UNTRUSTED_SUBTESTS
;
791 // NetworkMonitor tests.
792 #define RUN_NETWORK_MONITOR_SUBTESTS \
794 LIST_TEST(NetworkMonitor_Basic) \
795 LIST_TEST(NetworkMonitor_2Monitors) \
796 LIST_TEST(NetworkMonitor_DeleteInCallback) \
799 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, NetworkMonitor
) {
800 RUN_NETWORK_MONITOR_SUBTESTS
;
802 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, NetworkMonitor
) {
803 RUN_NETWORK_MONITOR_SUBTESTS
;
805 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, NetworkMonitor
) {
806 RUN_NETWORK_MONITOR_SUBTESTS
;
808 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
809 MAYBE_PNACL_NONSFI(NetworkMonitor
)) {
810 RUN_NETWORK_MONITOR_SUBTESTS
;
814 #define RUN_FLASH_SUBTESTS \
816 LIST_TEST(Flash_SetInstanceAlwaysOnTop) \
817 LIST_TEST(Flash_GetCommandLineArgs) \
820 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, Flash
) {
824 // In-process WebSocket tests. Note, the WebSocket tests are split into two,
825 // because all of them together sometimes take too long on windows:
827 #define RUN_WEBSOCKET_SUBTESTS_1 \
828 RunTestWithWebSocketServer( \
829 LIST_TEST(WebSocket_IsWebSocket) \
830 LIST_TEST(WebSocket_UninitializedPropertiesAccess) \
831 LIST_TEST(WebSocket_InvalidConnect) \
832 LIST_TEST(WebSocket_Protocols) \
833 LIST_TEST(WebSocket_GetURL) \
834 LIST_TEST(WebSocket_ValidConnect) \
835 LIST_TEST(WebSocket_InvalidClose) \
836 LIST_TEST(WebSocket_ValidClose) \
837 LIST_TEST(WebSocket_GetProtocol) \
838 LIST_TEST(WebSocket_TextSendReceive) \
839 LIST_TEST(WebSocket_BinarySendReceive) \
840 LIST_TEST(WebSocket_StressedSendReceive) \
841 LIST_TEST(WebSocket_BufferedAmount) \
844 #define RUN_WEBSOCKET_SUBTESTS_2 \
845 RunTestWithWebSocketServer( \
846 LIST_TEST(WebSocket_AbortCallsWithCallback) \
847 LIST_TEST(WebSocket_AbortSendMessageCall) \
848 LIST_TEST(WebSocket_AbortCloseCall) \
849 LIST_TEST(WebSocket_AbortReceiveMessageCall) \
850 LIST_TEST(WebSocket_ClosedFromServerWhileSending) \
851 LIST_TEST(WebSocket_CcInterfaces) \
852 LIST_TEST(WebSocket_UtilityInvalidConnect) \
853 LIST_TEST(WebSocket_UtilityProtocols) \
854 LIST_TEST(WebSocket_UtilityGetURL) \
855 LIST_TEST(WebSocket_UtilityValidConnect) \
856 LIST_TEST(WebSocket_UtilityInvalidClose) \
857 LIST_TEST(WebSocket_UtilityValidClose) \
858 LIST_TEST(WebSocket_UtilityGetProtocol) \
859 LIST_TEST(WebSocket_UtilityTextSendReceive) \
860 LIST_TEST(WebSocket_UtilityBinarySendReceive) \
861 LIST_TEST(WebSocket_UtilityBufferedAmount) \
864 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, WebSocket1
) {
865 RUN_WEBSOCKET_SUBTESTS_1
;
867 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, WebSocket2
) {
868 RUN_WEBSOCKET_SUBTESTS_2
;
870 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, WebSocket1
) {
871 RUN_WEBSOCKET_SUBTESTS_1
;
873 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, WebSocket2
) {
874 RUN_WEBSOCKET_SUBTESTS_2
;
876 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, WebSocket1
) {
877 RUN_WEBSOCKET_SUBTESTS_1
;
879 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, WebSocket2
) {
880 RUN_WEBSOCKET_SUBTESTS_2
;
882 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
883 MAYBE_PNACL_NONSFI(WebSocket1
)) {
884 RUN_WEBSOCKET_SUBTESTS_1
;
886 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
887 MAYBE_PNACL_NONSFI(WebSocket2
)) {
888 RUN_WEBSOCKET_SUBTESTS_2
;
892 #define RUN_AUDIO_CONFIG_SUBTESTS \
894 LIST_TEST(AudioConfig_RecommendSampleRate) \
895 LIST_TEST(AudioConfig_ValidConfigs) \
896 LIST_TEST(AudioConfig_InvalidConfigs) \
899 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, AudioConfig
) {
900 RUN_AUDIO_CONFIG_SUBTESTS
;
902 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, AudioConfig
) {
903 RUN_AUDIO_CONFIG_SUBTESTS
;
905 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest
, MAYBE_GLIBC(AudioConfig
)) {
906 RUN_AUDIO_CONFIG_SUBTESTS
;
908 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, AudioConfig
) {
909 RUN_AUDIO_CONFIG_SUBTESTS
;
911 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
912 MAYBE_PNACL_NONSFI(AudioConfig
)) {
913 RUN_AUDIO_CONFIG_SUBTESTS
;
917 #define RUN_AUDIO_SUBTESTS \
919 LIST_TEST(Audio_Creation) \
920 LIST_TEST(Audio_DestroyNoStop) \
921 LIST_TEST(Audio_Failures) \
922 LIST_TEST(Audio_AudioCallback1) \
923 LIST_TEST(Audio_AudioCallback2) \
924 LIST_TEST(Audio_AudioCallback3) \
925 LIST_TEST(Audio_AudioCallback4) \
928 #if defined(OS_LINUX)
929 // http://crbug.com/396464
930 #define MAYBE_Audio DISABLED_Audio
932 #define MAYBE_Audio Audio
934 // PPB_Audio is not supported in-process.
935 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, MAYBE_Audio
) {
938 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, Audio
) {
941 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest
, MAYBE_GLIBC(Audio
)) {
944 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, Audio
) {
947 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
948 MAYBE_PNACL_NONSFI(Audio
)) {
952 #define RUN_AUDIO_THREAD_CREATOR_SUBTESTS \
954 LIST_TEST(Audio_AudioThreadCreatorIsRequired) \
955 LIST_TEST(Audio_AudioThreadCreatorIsCalled) \
958 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, AudioThreadCreator
) {
959 RUN_AUDIO_THREAD_CREATOR_SUBTESTS
;
961 IN_PROC_BROWSER_TEST_F(PPAPINaClGLibcTest
, MAYBE_GLIBC(AudioThreadCreator
)) {
962 RUN_AUDIO_THREAD_CREATOR_SUBTESTS
;
964 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, AudioThreadCreator
) {
965 RUN_AUDIO_THREAD_CREATOR_SUBTESTS
;
967 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
,
968 MAYBE_PNACL_NONSFI(AudioThreadCreator
)) {
969 RUN_AUDIO_THREAD_CREATOR_SUBTESTS
;
972 TEST_PPAPI_OUT_OF_PROCESS(View_CreatedVisible
);
973 #if defined(OS_MACOSX)
974 // http://crbug.com/474399
975 #define MAYBE_View_CreatedVisible DISABLED_View_CreatedVisible
977 #define MAYBE_View_CreatedVisible View_CreatedVisible
979 TEST_PPAPI_NACL(MAYBE_View_CreatedVisible
);
981 // This test ensures that plugins created in a background tab have their
982 // initial visibility set to false. We don't bother testing in-process for this
983 // custom test since the out of process code also exercises in-process.
984 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, View_CreateInvisible
) {
985 // Make a second tab in the foreground.
986 GURL url
= GetTestFileUrl("View_CreatedInvisible");
987 chrome::NavigateParams
params(browser(), url
, ui::PAGE_TRANSITION_LINK
);
988 params
.disposition
= NEW_BACKGROUND_TAB
;
989 ui_test_utils::NavigateToURL(¶ms
);
992 // This test messes with tab visibility so is custom.
993 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, DISABLED_View_PageHideShow
) {
994 // The plugin will be loaded in the foreground tab and will send us a message.
995 PPAPITestMessageHandler handler
;
996 content::JavascriptTestObserver
observer(
997 browser()->tab_strip_model()->GetActiveWebContents(),
1000 GURL url
= GetTestFileUrl("View_PageHideShow");
1001 ui_test_utils::NavigateToURL(browser(), url
);
1003 ASSERT_TRUE(observer
.Run()) << handler
.error_message();
1004 EXPECT_STREQ("TestPageHideShow:Created", handler
.message().c_str());
1007 // Make a new tab to cause the original one to hide, this should trigger the
1008 // next phase of the test.
1009 chrome::NavigateParams
params(
1010 browser(), GURL(url::kAboutBlankURL
), ui::PAGE_TRANSITION_LINK
);
1011 params
.disposition
= NEW_FOREGROUND_TAB
;
1012 ui_test_utils::NavigateToURL(¶ms
);
1014 // Wait until the test acks that it got hidden.
1015 ASSERT_TRUE(observer
.Run()) << handler
.error_message();
1016 EXPECT_STREQ("TestPageHideShow:Hidden", handler
.message().c_str());
1019 // Switch back to the test tab.
1020 browser()->tab_strip_model()->ActivateTabAt(0, true);
1022 ASSERT_TRUE(observer
.Run()) << handler
.error_message();
1023 EXPECT_STREQ("PASS", handler
.message().c_str());
1026 // Tests that if a plugin accepts touch events, the browser knows to send touch
1027 // events to the renderer.
1028 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, InputEvent_AcceptTouchEvent
) {
1029 std::string positive_tests
[] = { "InputEvent_AcceptTouchEvent_1",
1030 "InputEvent_AcceptTouchEvent_2",
1031 "InputEvent_AcceptTouchEvent_3",
1032 "InputEvent_AcceptTouchEvent_4"
1035 for (size_t i
= 0; i
< arraysize(positive_tests
); ++i
) {
1036 RenderViewHost
* host
= browser()->tab_strip_model()->
1037 GetActiveWebContents()->GetRenderViewHost();
1038 RunTest(positive_tests
[i
]);
1039 EXPECT_TRUE(content::RenderViewHostTester::HasTouchEventHandler(host
));
1044 #define RUN_VIEW_SUBTESTS \
1046 LIST_TEST(View_SizeChange) \
1047 LIST_TEST(View_ClipChange) \
1048 LIST_TEST(View_ScrollOffsetChange) \
1051 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, View
) {
1054 IN_PROC_BROWSER_TEST_F(PPAPINaClNewlibTest
, View
) {
1057 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClTest
, View
) {
1060 IN_PROC_BROWSER_TEST_F(PPAPINaClPNaClNonSfiTest
, MAYBE_PNACL_NONSFI(View
)) {
1064 // FlashMessageLoop tests.
1065 #define RUN_FLASH_MESSAGE_LOOP_SUBTESTS \
1067 LIST_TEST(FlashMessageLoop_Basics) \
1068 LIST_TEST(FlashMessageLoop_RunWithoutQuit) \
1071 #if defined(OS_LINUX) // Disabled due to flakiness http://crbug.com/316925
1072 #define MAYBE_FlashMessageLoop DISABLED_FlashMessageLoop
1074 #define MAYBE_FlashMessageLoop FlashMessageLoop
1076 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, MAYBE_FlashMessageLoop
) {
1077 RUN_FLASH_MESSAGE_LOOP_SUBTESTS
;
1080 // The compositor test timeouts sometimes, so we have to split it to two
1082 #define RUN_COMPOSITOR_SUBTESTS_0 \
1084 LIST_TEST(Compositor_BindUnbind) \
1085 LIST_TEST(Compositor_Release) \
1086 LIST_TEST(Compositor_ReleaseUnbound) \
1087 LIST_TEST(Compositor_ReleaseWithoutCommit) \
1088 LIST_TEST(Compositor_ReleaseWithoutCommitUnbound) \
1091 #define RUN_COMPOSITOR_SUBTESTS_1 \
1093 LIST_TEST(Compositor_CommitTwoTimesWithoutChange) \
1094 LIST_TEST(Compositor_CommitTwoTimesWithoutChangeUnbound) \
1095 LIST_TEST(Compositor_General) \
1096 LIST_TEST(Compositor_GeneralUnbound) \
1100 // This test fails with the test compositor which is what's used by default for
1101 // browser tests on Windows. Renable when the software compositor is available.
1102 #define MAYBE_Compositor0 DISABLED_Compositor0
1103 #define MAYBE_Compositor1 DISABLED_Compositor1
1104 #elif defined(OS_MACOSX)
1105 // This test fails when using the legacy software mode. Reenable when the
1106 // software compositor is enabled crbug.com/286038
1107 #define MAYBE_Compositor0 DISABLED_Compositor0
1108 #define MAYBE_Compositor1 DISABLED_Compositor1
1110 // flaky on Linux: http://crbug.com/396482
1111 #define MAYBE_Compositor0 DISABLED_Compositor0
1112 #define MAYBE_Compositor1 DISABLED_Compositor1
1115 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor0
, RUN_COMPOSITOR_SUBTESTS_0
)
1116 TEST_PPAPI_NACL_SUBTESTS(MAYBE_Compositor1
, RUN_COMPOSITOR_SUBTESTS_1
)
1118 #if defined(OS_LINUX) || defined(OS_WIN) || defined(OS_CHROMEOS)
1119 // Flaky on ChromeOS, Linux and Windows (crbug.com/438729)
1120 #define MAYBE_MediaStreamAudioTrack DISABLED_MediaStreamAudioTrack
1122 #define MAYBE_MediaStreamAudioTrack MediaStreamAudioTrack
1124 TEST_PPAPI_NACL(MAYBE_MediaStreamAudioTrack
)
1126 TEST_PPAPI_NACL(MediaStreamVideoTrack
)
1128 TEST_PPAPI_NACL(MouseCursor
)
1130 TEST_PPAPI_NACL(NetworkProxy
)
1132 TEST_PPAPI_NACL(TrueTypeFont
)
1134 TEST_PPAPI_NACL(VideoDecoder
)
1136 TEST_PPAPI_NACL(VideoEncoder
)
1138 // VideoDestination doesn't work in content_browsertests.
1139 TEST_PPAPI_OUT_OF_PROCESS(VideoDestination
)
1140 TEST_PPAPI_NACL(VideoDestination
)
1142 // VideoSource doesn't work in content_browsertests.
1143 TEST_PPAPI_OUT_OF_PROCESS(VideoSource
)
1144 TEST_PPAPI_NACL(VideoSource
)
1146 // Printing doesn't work in content_browsertests.
1147 TEST_PPAPI_OUT_OF_PROCESS(Printing
)
1149 TEST_PPAPI_NACL(MessageHandler
)
1151 TEST_PPAPI_NACL(MessageLoop_Basics
)
1152 TEST_PPAPI_NACL(MessageLoop_Post
)
1154 // Going forward, Flash APIs will only work out-of-process.
1155 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetLocalTimeZoneOffset
)
1156 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL
)
1157 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetSetting
)
1158 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetCrashData
)
1159 // http://crbug.com/176822
1160 #if !defined(OS_WIN)
1161 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard
)
1163 TEST_PPAPI_OUT_OF_PROCESS(FlashFile
)
1164 // Mac/Aura reach NOTIMPLEMENTED/time out.
1165 // mac: http://crbug.com/96767
1166 // aura: http://crbug.com/104384
1167 // cros: http://crbug.com/396502
1168 #if defined(OS_MACOSX) || defined(OS_CHROMEOS)
1169 #define MAYBE_FlashFullscreen DISABLED_FlashFullscreen
1171 #define MAYBE_FlashFullscreen FlashFullscreen
1173 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_FlashFullscreen
)
1175 TEST_PPAPI_OUT_OF_PROCESS(PDF
)
1177 // TODO(dalecurtis): Renable once the platform verification infobar has been
1178 // implemented; see http://crbug.com/270908
1179 // #if defined(OS_CHROMEOS)
1180 // TEST_PPAPI_OUT_OF_PROCESS(PlatformVerificationPrivate)
1183 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
, FlashDRM
) {
1185 #if (defined(OS_WIN) && defined(ENABLE_RLZ)) || defined(OS_CHROMEOS)
1186 // Only implemented on Windows and ChromeOS currently.
1187 LIST_TEST(FlashDRM_GetDeviceID
)
1189 LIST_TEST(FlashDRM_GetHmonitor
)
1190 LIST_TEST(FlashDRM_GetVoucherFile
));
1193 #if defined(OS_CHROMEOS)
1194 TEST_PPAPI_OUT_OF_PROCESS(OutputProtectionPrivate
)
1197 #if !defined(DISABLE_NACL)
1198 class PackagedAppTest
: public ExtensionBrowserTest
{
1200 explicit PackagedAppTest(const std::string
& toolchain
)
1201 : toolchain_(toolchain
) { }
1203 void LaunchTestingApp(const std::string
& extension_dirname
) {
1204 base::FilePath data_dir
;
1205 ASSERT_TRUE(PathService::Get(chrome::DIR_GEN_TEST_DATA
, &data_dir
));
1206 base::FilePath app_dir
= data_dir
.AppendASCII("ppapi")
1207 .AppendASCII("tests")
1208 .AppendASCII("extensions")
1209 .AppendASCII(extension_dirname
)
1210 .AppendASCII(toolchain_
);
1212 const extensions::Extension
* extension
= LoadExtension(app_dir
);
1213 ASSERT_TRUE(extension
);
1215 AppLaunchParams
params(browser()->profile(), extension
,
1216 extensions::LAUNCH_CONTAINER_NONE
, NEW_WINDOW
,
1217 extensions::SOURCE_TEST
);
1218 params
.command_line
= *base::CommandLine::ForCurrentProcess();
1219 OpenApplication(params
);
1222 void RunTests(const std::string
& extension_dirname
) {
1223 ExtensionTestMessageListener
listener("PASS", true);
1224 LaunchTestingApp(extension_dirname
);
1225 EXPECT_TRUE(listener
.WaitUntilSatisfied());
1228 std::string toolchain_
;
1231 class NewlibPackagedAppTest
: public PackagedAppTest
{
1233 NewlibPackagedAppTest() : PackagedAppTest("newlib") { }
1236 class NonSfiPackagedAppTest
: public PackagedAppTest
{
1238 NonSfiPackagedAppTest() : PackagedAppTest("nonsfi") { }
1240 void SetUpCommandLine(base::CommandLine
* command_line
) override
{
1241 PackagedAppTest::SetUpCommandLine(command_line
);
1242 command_line
->AppendSwitch(switches::kEnableNaClNonSfiMode
);
1246 // Load a packaged app, and wait for it to successfully post a "hello" message
1248 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest
, SuccessfulLoad
) {
1249 RunTests("packaged_app");
1252 IN_PROC_BROWSER_TEST_F(NonSfiPackagedAppTest
,
1253 MAYBE_PNACL_NONSFI(SuccessfulLoad
)) {
1254 RunTests("packaged_app");
1257 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest
, MulticastPermissions
) {
1258 RunTests("multicast_permissions");
1261 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest
, NoSocketPermissions
) {
1262 RunTests("no_socket_permissions");
1265 IN_PROC_BROWSER_TEST_F(NewlibPackagedAppTest
, SocketPermissions
) {
1266 RunTests("socket_permissions");