1 // 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.
5 #include "content/test/ppapi/ppapi_test.h"
6 #include "ppapi/shared_impl/test_harness_utils.h"
8 // This file lists tests for Pepper APIs (without NaCl) against content_shell.
9 // TODO(teravest): Move more tests here. http://crbug.com/371873
11 // See chrome/test/ppapi/ppapi_browsertests.cc for Pepper testing that's
12 // covered in browser_tests.
17 // This macro finesses macro expansion to do what we want.
18 #define STRIP_PREFIXES(test_name) ppapi::StripTestPrefixes(#test_name)
20 #define TEST_PPAPI_IN_PROCESS(test_name) \
21 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \
22 RunTest(STRIP_PREFIXES(test_name)); \
25 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \
26 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \
27 RunTest(STRIP_PREFIXES(test_name)); \
30 TEST_PPAPI_IN_PROCESS(BrowserFont
)
33 #define MAYBE_OUT_BrowserFont DISABLED_BrowserFont
35 #define MAYBE_OUT_BrowserFont BrowserFont
37 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_OUT_BrowserFont
)
39 TEST_PPAPI_IN_PROCESS(Buffer
)
40 TEST_PPAPI_OUT_OF_PROCESS(Buffer
)
42 TEST_PPAPI_IN_PROCESS(CharSet
)
43 TEST_PPAPI_OUT_OF_PROCESS(CharSet
)
45 TEST_PPAPI_IN_PROCESS(Console
)
46 TEST_PPAPI_OUT_OF_PROCESS(Console
)
48 TEST_PPAPI_IN_PROCESS(Core
)
49 TEST_PPAPI_OUT_OF_PROCESS(Core
)
51 TEST_PPAPI_IN_PROCESS(Crypto
)
52 TEST_PPAPI_OUT_OF_PROCESS(Crypto
)
54 TEST_PPAPI_IN_PROCESS(Graphics2D
)
55 TEST_PPAPI_OUT_OF_PROCESS(Graphics2D
)
57 TEST_PPAPI_IN_PROCESS(ImageData
)
58 TEST_PPAPI_OUT_OF_PROCESS(ImageData
)
60 TEST_PPAPI_OUT_OF_PROCESS(InputEvent
)
62 // "Instance" tests are really InstancePrivate tests. InstancePrivate is not
63 // supported in NaCl, so these tests are only run trusted.
64 // Also note that these tests are run separately on purpose (versus collapsed
65 // in to one IN_PROC_BROWSER_TEST_F macro), because some of them have leaks
66 // on purpose that will look like failures to tests that are run later.
67 TEST_PPAPI_IN_PROCESS(Instance_ExecuteScript
)
68 TEST_PPAPI_OUT_OF_PROCESS(Instance_ExecuteScript
)
70 IN_PROC_BROWSER_TEST_F(PPAPITest
,
71 Instance_ExecuteScriptAtInstanceShutdown
) {
72 // In other tests, we use one call to RunTest so that the tests can all run
73 // in one plugin instance. This saves time on loading the plugin (especially
74 // for NaCl). Here, we actually want to destroy the Instance, to test whether
75 // the destructor can run ExecuteScript successfully. That's why we have two
76 // separate calls to RunTest; the second one forces a navigation which
77 // destroys the instance from the prior RunTest.
78 // See test_instance_deprecated.cc for more information.
79 RunTest("Instance_SetupExecuteScriptAtInstanceShutdown");
80 RunTest("Instance_ExecuteScriptAtInstanceShutdown");
82 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
,
83 Instance_ExecuteScriptAtInstanceShutdown
) {
84 // (See the comment for the in-process version of this test above)
85 RunTest("Instance_SetupExecuteScriptAtInstanceShutdown");
86 RunTest("Instance_ExecuteScriptAtInstanceShutdown");
89 TEST_PPAPI_IN_PROCESS(Instance_LeakedObjectDestructors
)
90 TEST_PPAPI_OUT_OF_PROCESS(Instance_LeakedObjectDestructors
)
92 // We run and reload the RecursiveObjects test to ensure that the
93 // InstanceObject (and others) are properly cleaned up after the first run.
94 IN_PROC_BROWSER_TEST_F(PPAPITest
, Instance_RecursiveObjects
) {
95 RunTestAndReload("Instance_RecursiveObjects");
97 // TODO(dmichael): Make it work out-of-process (or at least see whether we
99 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest
,
100 DISABLED_Instance_RecursiveObjects
) {
101 RunTestAndReload("Instance_RecursiveObjects");
104 TEST_PPAPI_OUT_OF_PROCESS(MediaStreamAudioTrack
)
106 TEST_PPAPI_OUT_OF_PROCESS(MediaStreamVideoTrack
)
108 TEST_PPAPI_IN_PROCESS(Memory
)
109 TEST_PPAPI_OUT_OF_PROCESS(Memory
)
111 TEST_PPAPI_OUT_OF_PROCESS(MessageHandler
)
113 TEST_PPAPI_OUT_OF_PROCESS(MessageLoop_Basics
)
114 TEST_PPAPI_OUT_OF_PROCESS(MessageLoop_Post
)
116 TEST_PPAPI_OUT_OF_PROCESS(NetworkProxy
)
118 // TODO(danakj): http://crbug.com/115286
119 TEST_PPAPI_IN_PROCESS(DISABLED_Scrollbar
)
120 // http://crbug.com/89961
121 TEST_PPAPI_OUT_OF_PROCESS(DISABLED_Scrollbar
)
123 TEST_PPAPI_IN_PROCESS(TraceEvent
)
124 TEST_PPAPI_OUT_OF_PROCESS(TraceEvent
)
126 TEST_PPAPI_OUT_OF_PROCESS(TrueTypeFont
)
128 TEST_PPAPI_IN_PROCESS(URLUtil
)
129 TEST_PPAPI_OUT_OF_PROCESS(URLUtil
)
131 TEST_PPAPI_IN_PROCESS(Var
)
132 TEST_PPAPI_OUT_OF_PROCESS(Var
)
134 // Flaky on mac, http://crbug.com/121107
135 #if defined(OS_MACOSX)
136 #define MAYBE_VarDeprecated DISABLED_VarDeprecated
138 #define MAYBE_VarDeprecated VarDeprecated
140 TEST_PPAPI_IN_PROCESS(VarDeprecated
)
141 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_VarDeprecated
)
143 TEST_PPAPI_IN_PROCESS(VarResource
)
144 TEST_PPAPI_OUT_OF_PROCESS(VarResource
)
146 TEST_PPAPI_OUT_OF_PROCESS(VideoDecoder
)
148 TEST_PPAPI_IN_PROCESS(VideoDecoderDev
)
149 TEST_PPAPI_OUT_OF_PROCESS(VideoDecoderDev
)
152 } // namespace content