blob: de67df11a48e722fda577811ab754b4c0dae21dd [file] [log] [blame]
[email protected]745fc522014-05-28 21:54:451// Copyright 2014 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.
4
avi66a07722015-12-25 23:38:125#include "build/build_config.h"
[email protected]745fc522014-05-28 21:54:456#include "content/test/ppapi/ppapi_test.h"
tommyclia88b6092015-05-14 17:54:017#include "ppapi/shared_impl/test_utils.h"
[email protected]745fc522014-05-28 21:54:458
9// This file lists tests for Pepper APIs (without NaCl) against content_shell.
10// TODO(teravest): Move more tests here. http://crbug.com/371873
11
12// See chrome/test/ppapi/ppapi_browsertests.cc for Pepper testing that's
13// covered in browser_tests.
14
15namespace content {
16namespace {
17
18// This macro finesses macro expansion to do what we want.
19#define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name)
20
glideraacff2b2015-01-14 12:03:1921#if defined(THREAD_SANITIZER)
22#define DISABLE_IF_TSAN(test_name) DISABLED_##test_name
23#else
24#define DISABLE_IF_TSAN(test_name) test_name
25#endif
26
[email protected]745fc522014-05-28 21:54:4527#define TEST_PPAPI_IN_PROCESS(test_name) \
28 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \
29 RunTest(STRIP_PREFIXES(test_name)); \
30 }
31
glideraacff2b2015-01-14 12:03:1932// OutOfProcessPPAPITest tests time out under ThreadSanitizer,
33// see https://crbug.com/448323.
[email protected]745fc522014-05-28 21:54:4534#define TEST_PPAPI_OUT_OF_PROCESS(test_name) \
glideraacff2b2015-01-14 12:03:1935 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLE_IF_TSAN(test_name)) { \
[email protected]745fc522014-05-28 21:54:4536 RunTest(STRIP_PREFIXES(test_name)); \
37 }
38
dpranke98afc7a2016-06-16 19:49:2539// Doesn't work in GN CrOS ozone builds yet, http://crbug.com/619765
40#if defined(OS_CHROMEOS) && defined(USE_OZONE)
41#define MAYBE_BrowserFont DISABLED_BrowserFont
42#else
43#define MAYBE_BrowserFont BrowserFont
44#endif
45TEST_PPAPI_OUT_OF_PROCESS(MAYBE_BrowserFont)
[email protected]585765a2014-05-29 16:34:2646
47TEST_PPAPI_IN_PROCESS(Buffer)
48TEST_PPAPI_OUT_OF_PROCESS(Buffer)
49
50TEST_PPAPI_IN_PROCESS(CharSet)
51TEST_PPAPI_OUT_OF_PROCESS(CharSet)
52
53TEST_PPAPI_IN_PROCESS(Console)
54TEST_PPAPI_OUT_OF_PROCESS(Console)
55
[email protected]ae1353c2014-06-02 21:14:3456TEST_PPAPI_IN_PROCESS(Core)
57TEST_PPAPI_OUT_OF_PROCESS(Core)
58
[email protected]745fc522014-05-28 21:54:4559TEST_PPAPI_IN_PROCESS(Crypto)
60TEST_PPAPI_OUT_OF_PROCESS(Crypto)
61
[email protected]585765a2014-05-29 16:34:2662TEST_PPAPI_IN_PROCESS(Graphics2D)
63TEST_PPAPI_OUT_OF_PROCESS(Graphics2D)
64
65TEST_PPAPI_IN_PROCESS(ImageData)
66TEST_PPAPI_OUT_OF_PROCESS(ImageData)
67
68TEST_PPAPI_OUT_OF_PROCESS(InputEvent)
69
70// "Instance" tests are really InstancePrivate tests. InstancePrivate is not
71// supported in NaCl, so these tests are only run trusted.
72// Also note that these tests are run separately on purpose (versus collapsed
73// in to one IN_PROC_BROWSER_TEST_F macro), because some of them have leaks
74// on purpose that will look like failures to tests that are run later.
75TEST_PPAPI_IN_PROCESS(Instance_ExecuteScript)
76TEST_PPAPI_OUT_OF_PROCESS(Instance_ExecuteScript)
77
78IN_PROC_BROWSER_TEST_F(PPAPITest,
79 Instance_ExecuteScriptAtInstanceShutdown) {
80 // In other tests, we use one call to RunTest so that the tests can all run
81 // in one plugin instance. This saves time on loading the plugin (especially
82 // for NaCl). Here, we actually want to destroy the Instance, to test whether
83 // the destructor can run ExecuteScript successfully. That's why we have two
84 // separate calls to RunTest; the second one forces a navigation which
85 // destroys the instance from the prior RunTest.
86 // See test_instance_deprecated.cc for more information.
87 RunTest("Instance_SetupExecuteScriptAtInstanceShutdown");
88 RunTest("Instance_ExecuteScriptAtInstanceShutdown");
89}
90IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest,
glideraacff2b2015-01-14 12:03:1991 DISABLE_IF_TSAN(Instance_ExecuteScriptAtInstanceShutdown)) {
[email protected]585765a2014-05-29 16:34:2692 // (See the comment for the in-process version of this test above)
93 RunTest("Instance_SetupExecuteScriptAtInstanceShutdown");
94 RunTest("Instance_ExecuteScriptAtInstanceShutdown");
95}
96
97TEST_PPAPI_IN_PROCESS(Instance_LeakedObjectDestructors)
98TEST_PPAPI_OUT_OF_PROCESS(Instance_LeakedObjectDestructors)
99
[email protected]bd8f27c2014-05-31 01:12:55100// We run and reload the RecursiveObjects test to ensure that the
101// InstanceObject (and others) are properly cleaned up after the first run.
102IN_PROC_BROWSER_TEST_F(PPAPITest, Instance_RecursiveObjects) {
103 RunTestAndReload("Instance_RecursiveObjects");
104}
105// TODO(dmichael): Make it work out-of-process (or at least see whether we
106// care).
107IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest,
108 DISABLED_Instance_RecursiveObjects) {
109 RunTestAndReload("Instance_RecursiveObjects");
110}
111
tsergeantd37c6012015-07-16 05:55:10112#if defined(OS_WIN) || defined(OS_LINUX)
113// Flaky on Linux and Windows (crbug.com/438729)
pkotwiczc071901b2014-12-03 23:02:10114#define MAYBE_MediaStreamAudioTrack DISABLED_MediaStreamAudioTrack
115#else
116#define MAYBE_MediaStreamAudioTrack MediaStreamAudioTrack
117#endif
118TEST_PPAPI_OUT_OF_PROCESS(MAYBE_MediaStreamAudioTrack)
[email protected]bd8f27c2014-05-31 01:12:55119
120TEST_PPAPI_OUT_OF_PROCESS(MediaStreamVideoTrack)
121
[email protected]585765a2014-05-29 16:34:26122TEST_PPAPI_IN_PROCESS(Memory)
123TEST_PPAPI_OUT_OF_PROCESS(Memory)
124
[email protected]e87640bd2014-06-18 16:44:00125TEST_PPAPI_OUT_OF_PROCESS(MessageHandler)
126
[email protected]bd8f27c2014-05-31 01:12:55127TEST_PPAPI_OUT_OF_PROCESS(MessageLoop_Basics)
128TEST_PPAPI_OUT_OF_PROCESS(MessageLoop_Post)
129
130TEST_PPAPI_OUT_OF_PROCESS(NetworkProxy)
131
[email protected]585765a2014-05-29 16:34:26132// TODO(danakj): http://crbug.com/115286
133TEST_PPAPI_IN_PROCESS(DISABLED_Scrollbar)
134// http://crbug.com/89961
135TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Scrollbar)
136
[email protected]745fc522014-05-28 21:54:45137TEST_PPAPI_IN_PROCESS(TraceEvent)
138TEST_PPAPI_OUT_OF_PROCESS(TraceEvent)
139
dpranke98afc7a2016-06-16 19:49:25140// Doesn't work in GN CrOS ozone builds yet, http://crbug.com/619765
141#if defined(OS_CHROMEOS) && defined(USE_OZONE)
142#define MAYBE_TrueTypeFont DISABLED_TrueTypeFont
143#else
144#define MAYBE_TrueTypeFont TrueTypeFont
145#endif
146TEST_PPAPI_OUT_OF_PROCESS(MAYBE_TrueTypeFont)
[email protected]bd8f27c2014-05-31 01:12:55147
[email protected]585765a2014-05-29 16:34:26148TEST_PPAPI_IN_PROCESS(URLUtil)
149TEST_PPAPI_OUT_OF_PROCESS(URLUtil)
150
151TEST_PPAPI_IN_PROCESS(Var)
152TEST_PPAPI_OUT_OF_PROCESS(Var)
153
154// Flaky on mac, http://crbug.com/121107
155#if defined(OS_MACOSX)
156#define MAYBE_VarDeprecated DISABLED_VarDeprecated
157#else
158#define MAYBE_VarDeprecated VarDeprecated
159#endif
160TEST_PPAPI_IN_PROCESS(VarDeprecated)
161TEST_PPAPI_OUT_OF_PROCESS(MAYBE_VarDeprecated)
162
163TEST_PPAPI_IN_PROCESS(VarResource)
164TEST_PPAPI_OUT_OF_PROCESS(VarResource)
165
vabr69f341e2016-04-13 10:54:58166// Flaky on Win, Linux and CrOS, http://crbug.com/602877
vabr55017692016-04-13 12:05:32167#if defined(OS_WIN) || defined(OS_LINUX) || defined(OS_CHROMEOS)
vabr69f341e2016-04-13 10:54:58168#define MAYBE_VideoDecoder DISABLED_VideoDecoder
169#else
170#define MAYBE_VideoDecoder VideoDecoder
171#endif
172TEST_PPAPI_OUT_OF_PROCESS(MAYBE_VideoDecoder)
[email protected]0ff052d2014-06-13 15:00:14173
[email protected]585765a2014-05-29 16:34:26174TEST_PPAPI_IN_PROCESS(VideoDecoderDev)
175TEST_PPAPI_OUT_OF_PROCESS(VideoDecoderDev)
176
lionel.g.landwerlinc3f15122015-02-25 01:20:58177TEST_PPAPI_OUT_OF_PROCESS(VideoEncoder)
178
[email protected]745fc522014-05-28 21:54:45179} // namespace
180} // namespace content