OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/command_line.h" | |
5 #include "base/file_util.h" | 6 #include "base/file_util.h" |
6 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/stringprintf.h" | |
9 #include "base/string_util.h" | |
7 #include "base/test/test_timeouts.h" | 10 #include "base/test/test_timeouts.h" |
11 #include "base/timer.h" | |
8 #include "build/build_config.h" | 12 #include "build/build_config.h" |
9 #include "content/public/common/content_switches.h" | 13 #include "chrome/browser/ui/browser.h" |
10 #include "content/common/pepper_plugin_registry.h" | 14 #include "chrome/browser/ui/browser_navigator.h" |
11 #include "chrome/common/chrome_paths.h" | 15 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/chrome_switches.h" | 16 #include "chrome/common/chrome_switches.h" |
13 #include "chrome/test/automation/browser_proxy.h" | 17 #include "chrome/test/base/in_process_browser_test.h" |
14 #include "chrome/test/automation/tab_proxy.h" | |
15 #include "chrome/test/base/ui_test_utils.h" | 18 #include "chrome/test/base/ui_test_utils.h" |
16 #include "chrome/test/ui/ui_test.h" | 19 #include "content/common/pepper_plugin_registry.h" |
20 #include "content/public/browser/dom_operation_notification_details.h" | |
21 #include "content/public/browser/notification_types.h" | |
22 #include "content/public/browser/web_contents.h" | |
23 #include "content/public/common/content_switches.h" | |
17 #include "content/public/common/url_constants.h" | 24 #include "content/public/common/url_constants.h" |
18 #include "net/base/net_util.h" | 25 #include "net/base/net_util.h" |
19 #include "net/test/test_server.h" | 26 #include "net/test/test_server.h" |
20 #include "webkit/plugins/plugin_switches.h" | 27 #include "webkit/plugins/plugin_switches.h" |
21 | 28 |
29 using content::DomOperationNotificationDetails; | |
30 using content::RenderViewHost; | |
31 | |
22 namespace { | 32 namespace { |
23 | 33 |
24 // Platform-specific filename relative to the chrome executable. | 34 // Platform-specific filename relative to the chrome executable. |
25 #if defined(OS_WIN) | 35 #if defined(OS_WIN) |
26 const wchar_t library_name[] = L"ppapi_tests.dll"; | 36 const wchar_t library_name[] = L"ppapi_tests.dll"; |
27 #elif defined(OS_MACOSX) | 37 #elif defined(OS_MACOSX) |
28 const char library_name[] = "ppapi_tests.plugin"; | 38 const char library_name[] = "ppapi_tests.plugin"; |
29 #elif defined(OS_POSIX) | 39 #elif defined(OS_POSIX) |
30 const char library_name[] = "libppapi_tests.so"; | 40 const char library_name[] = "libppapi_tests.so"; |
31 #endif | 41 #endif |
32 | 42 |
43 // The large timeout was causing the cycle time for the whole test suite | |
44 // to be too long when a tiny bug caused all tests to timeout. | |
45 // http://crbug.com/108264 | |
46 static int kTimeoutMs = 90000; | |
47 //static int kTimeoutMs = TestTimeouts::large_test_timeout_ms()); | |
48 | |
49 class TestFinishObserver : public content::NotificationObserver { | |
50 public: | |
51 explicit TestFinishObserver(RenderViewHost* render_view_host, int timeout_s) | |
52 : finished_(false), waiting_(false), timeout_s_(timeout_s) { | |
53 registrar_.Add(this, content::NOTIFICATION_DOM_OPERATION_RESPONSE, | |
54 content::Source<RenderViewHost>(render_view_host)); | |
55 timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s), | |
56 this, &TestFinishObserver::OnTimeout); | |
57 } | |
58 | |
59 bool WaitForFinish() { | |
60 if (!finished_) { | |
61 waiting_ = true; | |
62 ui_test_utils::RunMessageLoop(); | |
63 waiting_ = false; | |
64 } | |
65 return finished_; | |
66 } | |
67 | |
68 virtual void Observe(int type, | |
69 const content::NotificationSource& source, | |
70 const content::NotificationDetails& details) { | |
71 DCHECK(type == content::NOTIFICATION_DOM_OPERATION_RESPONSE); | |
72 content::Details<DomOperationNotificationDetails> dom_op_details(details); | |
73 // We might receive responses for other script execution, but we only | |
74 // care about the test finished message. | |
75 std::string response; | |
76 TrimString(dom_op_details->json, "\"", &response); | |
77 if (response == "...") { | |
78 timer_.Stop(); | |
79 timer_.Start(FROM_HERE, base::TimeDelta::FromSeconds(timeout_s_), | |
80 this, &TestFinishObserver::OnTimeout); | |
81 } else { | |
82 result_ = response; | |
83 finished_ = true; | |
84 if (waiting_) | |
85 MessageLoopForUI::current()->Quit(); | |
86 } | |
87 } | |
88 | |
89 std::string result() const { return result_; } | |
90 | |
91 void Reset() { | |
92 finished_ = false; | |
93 waiting_ = false; | |
94 result_ = ""; | |
brettw
2012/03/09 22:11:25
Pet peeve: can this be result_.clear()?
jam
2012/03/09 22:38:39
Done.
| |
95 } | |
96 | |
97 private: | |
98 void OnTimeout() { | |
99 MessageLoopForUI::current()->Quit(); | |
100 } | |
101 | |
102 bool finished_; | |
103 bool waiting_; | |
104 int timeout_s_; | |
105 std::string result_; | |
106 content::NotificationRegistrar registrar_; | |
107 base::RepeatingTimer<TestFinishObserver> timer_; | |
108 | |
109 DISALLOW_COPY_AND_ASSIGN(TestFinishObserver); | |
110 }; | |
111 | |
33 } // namespace | 112 } // namespace |
34 | 113 |
35 class PPAPITestBase : public UITest { | 114 class PPAPITestBase : public InProcessBrowserTest { |
36 public: | 115 public: |
37 PPAPITestBase() { | 116 PPAPITestBase() { |
117 EnableDOMAutomation(); | |
118 } | |
119 | |
120 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
38 // The test sends us the result via a cookie. | 121 // The test sends us the result via a cookie. |
39 launch_arguments_.AppendSwitch(switches::kEnableFileCookies); | 122 command_line->AppendSwitch(switches::kEnableFileCookies); |
40 | 123 |
41 // Some stuff is hung off of the testing interface which is not enabled | 124 // Some stuff is hung off of the testing interface which is not enabled |
42 // by default. | 125 // by default. |
43 launch_arguments_.AppendSwitch(switches::kEnablePepperTesting); | 126 command_line->AppendSwitch(switches::kEnablePepperTesting); |
44 | 127 |
45 // Smooth scrolling confuses the scrollbar test. | 128 // Smooth scrolling confuses the scrollbar test. |
46 launch_arguments_.AppendSwitch(switches::kDisableSmoothScrolling); | 129 command_line->AppendSwitch(switches::kDisableSmoothScrolling); |
47 } | 130 } |
48 | 131 |
49 virtual std::string BuildQuery(const std::string& base, | 132 virtual std::string BuildQuery(const std::string& base, |
50 const std::string& test_case) = 0; | 133 const std::string& test_case) = 0; |
51 | 134 |
52 // Returns the URL to load for file: tests. | 135 // Returns the URL to load for file: tests. |
53 GURL GetTestFileUrl(const std::string& test_case) { | 136 GURL GetTestFileUrl(const std::string& test_case) { |
54 FilePath test_path; | 137 FilePath test_path; |
55 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_path)); | 138 EXPECT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &test_path)); |
56 test_path = test_path.Append(FILE_PATH_LITERAL("ppapi")); | 139 test_path = test_path.Append(FILE_PATH_LITERAL("ppapi")); |
57 test_path = test_path.Append(FILE_PATH_LITERAL("tests")); | 140 test_path = test_path.Append(FILE_PATH_LITERAL("tests")); |
58 test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html")); | 141 test_path = test_path.Append(FILE_PATH_LITERAL("test_case.html")); |
59 | 142 |
60 // Sanity check the file name. | 143 // Sanity check the file name. |
61 EXPECT_TRUE(file_util::PathExists(test_path)); | 144 EXPECT_TRUE(file_util::PathExists(test_path)); |
62 | 145 |
63 GURL test_url = net::FilePathToFileURL(test_path); | 146 GURL test_url = net::FilePathToFileURL(test_path); |
64 | 147 |
65 GURL::Replacements replacements; | 148 GURL::Replacements replacements; |
66 std::string query = BuildQuery("", test_case); | 149 std::string query = BuildQuery("", test_case); |
67 replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); | 150 replacements.SetQuery(query.c_str(), url_parse::Component(0, query.size())); |
68 return test_url.ReplaceComponents(replacements); | 151 return test_url.ReplaceComponents(replacements); |
69 } | 152 } |
70 | 153 |
71 void RunTest(const std::string& test_case) { | 154 void RunTest(const std::string& test_case) { |
72 scoped_refptr<TabProxy> tab = GetActiveTab(); | |
73 EXPECT_TRUE(tab.get()); | |
74 if (!tab.get()) | |
75 return; | |
76 GURL url = GetTestFileUrl(test_case); | 155 GURL url = GetTestFileUrl(test_case); |
77 EXPECT_TRUE(tab->NavigateToURLBlockUntilNavigationsComplete(url, 1)); | 156 RunTestURL(url); |
78 RunTestURL(tab, url); | |
79 } | 157 } |
80 | 158 |
81 void RunTestViaHTTP(const std::string& test_case) { | 159 void RunTestViaHTTP(const std::string& test_case) { |
82 // For HTTP tests, we use the output DIR to grab the generated files such | 160 // For HTTP tests, we use the output DIR to grab the generated files such |
83 // as the NEXEs. | 161 // as the NEXEs. |
84 FilePath exe_dir = CommandLine::ForCurrentProcess()->GetProgram().DirName(); | 162 FilePath exe_dir = CommandLine::ForCurrentProcess()->GetProgram().DirName(); |
85 FilePath src_dir; | 163 FilePath src_dir; |
86 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); | 164 ASSERT_TRUE(PathService::Get(base::DIR_SOURCE_ROOT, &src_dir)); |
87 | 165 |
88 // TestServer expects a path relative to source. So we must first | 166 // TestServer expects a path relative to source. So we must first |
(...skipping 23 matching lines...) Expand all Loading... | |
112 for (; match < exe_size; ++match) { | 190 for (; match < exe_size; ++match) { |
113 web_dir = web_dir.Append(exe_parts[match]); | 191 web_dir = web_dir.Append(exe_parts[match]); |
114 } | 192 } |
115 | 193 |
116 net::TestServer test_server(net::TestServer::TYPE_HTTP, | 194 net::TestServer test_server(net::TestServer::TYPE_HTTP, |
117 net::TestServer::kLocalhost, | 195 net::TestServer::kLocalhost, |
118 web_dir); | 196 web_dir); |
119 ASSERT_TRUE(test_server.Start()); | 197 ASSERT_TRUE(test_server.Start()); |
120 std::string query = BuildQuery("files/test_case.html?", test_case); | 198 std::string query = BuildQuery("files/test_case.html?", test_case); |
121 | 199 |
122 scoped_refptr<TabProxy> tab = GetActiveTab(); | |
123 GURL url = test_server.GetURL(query); | 200 GURL url = test_server.GetURL(query); |
124 EXPECT_TRUE(tab->NavigateToURLBlockUntilNavigationsComplete(url, 1)); | 201 RunTestURL(url); |
125 RunTestURL(tab, url); | |
126 } | 202 } |
127 | 203 |
128 void RunTestWithWebSocketServer(const std::string& test_case) { | 204 void RunTestWithWebSocketServer(const std::string& test_case) { |
129 FilePath websocket_root_dir; | 205 FilePath websocket_root_dir; |
130 ASSERT_TRUE( | 206 ASSERT_TRUE( |
131 PathService::Get(chrome::DIR_LAYOUT_TESTS, &websocket_root_dir)); | 207 PathService::Get(chrome::DIR_LAYOUT_TESTS, &websocket_root_dir)); |
132 | 208 |
133 ui_test_utils::TestWebSocketServer server; | 209 ui_test_utils::TestWebSocketServer server; |
134 ASSERT_TRUE(server.Start(websocket_root_dir)); | 210 ASSERT_TRUE(server.Start(websocket_root_dir)); |
135 RunTestViaHTTP(test_case); | 211 RunTestViaHTTP(test_case); |
136 } | 212 } |
137 | 213 |
138 std::string StripPrefixes(const std::string& test_name) { | 214 std::string StripPrefixes(const std::string& test_name) { |
139 const char* const prefixes[] = { "FAILS_", "FLAKY_", "DISABLED_" }; | 215 const char* const prefixes[] = { "FAILS_", "FLAKY_", "DISABLED_" }; |
140 for (size_t i = 0; i < sizeof(prefixes)/sizeof(prefixes[0]); ++i) | 216 for (size_t i = 0; i < sizeof(prefixes)/sizeof(prefixes[0]); ++i) |
141 if (test_name.find(prefixes[i]) == 0) | 217 if (test_name.find(prefixes[i]) == 0) |
142 return test_name.substr(strlen(prefixes[i])); | 218 return test_name.substr(strlen(prefixes[i])); |
143 return test_name; | 219 return test_name; |
144 } | 220 } |
145 | 221 |
146 protected: | 222 protected: |
147 // Runs the test for a tab given the tab that's already navigated to the | 223 // Runs the test for a tab given the tab that's already navigated to the |
148 // given URL. | 224 // given URL. |
149 void RunTestURL(scoped_refptr<TabProxy> tab, const GURL& test_url) { | 225 void RunTestURL(const GURL& test_url) { |
150 ASSERT_TRUE(tab.get()); | 226 // See comment above TestingInstance in ppapi/test/testing_instance.h. |
227 // Basically it sends messages using the DOM automation controller. The | |
228 // value of "..." means it's still working and we should continue to wait, | |
229 // any other value indicates completion (in this case it will start with | |
230 // "PASS" or "FAIL"). This keeps us from timing out on waits for long tests. | |
231 TestFinishObserver observer( | |
232 browser()->GetSelectedWebContents()->GetRenderViewHost(), kTimeoutMs); | |
151 | 233 |
152 // The large timeout was causing the cycle time for the whole test suite | 234 ui_test_utils::NavigateToURL(browser(), test_url); |
153 // to be too long when a tiny bug caused all tests to timeout. | |
154 // http://crbug.com/108264 | |
155 int timeout_ms = 90000; | |
156 //int timeout_ms = TestTimeouts::large_test_timeout_ms()); | |
157 | 235 |
158 // See comment above TestingInstance in ppapi/test/testing_instance.h. | 236 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
159 // Basically it sets a series of numbered cookies. The value of "..." means | |
160 // it's still working and we should continue to wait, any other value | |
161 // indicates completion (in this case it will start with "PASS" or "FAIL"). | |
162 // This keeps us from timing out on cookie waits for long tests. | |
163 int progress_number = 0; | |
164 std::string progress; | |
165 while (true) { | |
166 std::string cookie_name = StringPrintf("PPAPI_PROGRESS_%d", | |
167 progress_number); | |
168 progress = WaitUntilCookieNonEmpty(tab.get(), test_url, | |
169 cookie_name.c_str(), timeout_ms); | |
170 if (progress != "...") | |
171 break; | |
172 progress_number++; | |
173 } | |
174 | 237 |
175 if (progress_number == 0) { | 238 EXPECT_STREQ("PASS", observer.result().c_str()); |
176 // Failing the first time probably means the plugin wasn't loaded. | |
177 ASSERT_FALSE(progress.empty()) | |
178 << "Plugin couldn't be loaded. Make sure the PPAPI test plugin is " | |
179 << "built, in the right place, and doesn't have any missing symbols."; | |
180 } else { | |
181 ASSERT_FALSE(progress.empty()) << "Test timed out."; | |
182 } | |
183 | |
184 EXPECT_STREQ("PASS", progress.c_str()); | |
185 } | 239 } |
186 }; | 240 }; |
187 | 241 |
188 // In-process plugin test runner. See OutOfProcessPPAPITest below for the | 242 // In-process plugin test runner. See OutOfProcessPPAPITest below for the |
189 // out-of-process version. | 243 // out-of-process version. |
190 class PPAPITest : public PPAPITestBase { | 244 class PPAPITest : public PPAPITestBase { |
191 public: | 245 public: |
192 PPAPITest() { | 246 PPAPITest() { |
247 } | |
248 | |
249 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
250 PPAPITestBase::SetUpCommandLine(command_line); | |
251 | |
193 // Append the switch to register the pepper plugin. | 252 // Append the switch to register the pepper plugin. |
194 // library name = <out dir>/<test_name>.<library_extension> | 253 // library name = <out dir>/<test_name>.<library_extension> |
195 // MIME type = application/x-ppapi-<test_name> | 254 // MIME type = application/x-ppapi-<test_name> |
196 FilePath plugin_dir; | 255 FilePath plugin_dir; |
197 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &plugin_dir)); | 256 EXPECT_TRUE(PathService::Get(base::DIR_EXE, &plugin_dir)); |
198 | 257 |
199 FilePath plugin_lib = plugin_dir.Append(library_name); | 258 FilePath plugin_lib = plugin_dir.Append(library_name); |
200 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 259 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
201 FilePath::StringType pepper_plugin = plugin_lib.value(); | 260 FilePath::StringType pepper_plugin = plugin_lib.value(); |
202 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); | 261 pepper_plugin.append(FILE_PATH_LITERAL(";application/x-ppapi-tests")); |
203 launch_arguments_.AppendSwitchNative(switches::kRegisterPepperPlugins, | 262 command_line->AppendSwitchNative(switches::kRegisterPepperPlugins, |
204 pepper_plugin); | 263 pepper_plugin); |
205 launch_arguments_.AppendSwitchASCII(switches::kAllowNaClSocketAPI, | 264 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); |
206 "127.0.0.1"); | |
207 } | 265 } |
208 | 266 |
209 std::string BuildQuery(const std::string& base, | 267 std::string BuildQuery(const std::string& base, |
210 const std::string& test_case){ | 268 const std::string& test_case){ |
211 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); | 269 return StringPrintf("%stestcase=%s", base.c_str(), test_case.c_str()); |
212 } | 270 } |
213 | 271 |
214 }; | 272 }; |
215 | 273 |
216 // Variant of PPAPITest that runs plugins out-of-process to test proxy | 274 // Variant of PPAPITest that runs plugins out-of-process to test proxy |
217 // codepaths. | 275 // codepaths. |
218 class OutOfProcessPPAPITest : public PPAPITest { | 276 class OutOfProcessPPAPITest : public PPAPITest { |
219 public: | 277 public: |
220 OutOfProcessPPAPITest() { | 278 OutOfProcessPPAPITest() { |
279 | |
280 } | |
281 | |
282 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
283 PPAPITest::SetUpCommandLine(command_line); | |
284 | |
221 // Run PPAPI out-of-process to exercise proxy implementations. | 285 // Run PPAPI out-of-process to exercise proxy implementations. |
222 launch_arguments_.AppendSwitch(switches::kPpapiOutOfProcess); | 286 command_line->AppendSwitch(switches::kPpapiOutOfProcess); |
223 } | 287 } |
224 }; | 288 }; |
225 | 289 |
226 // NaCl plugin test runner. | 290 // NaCl plugin test runner. |
227 class PPAPINaClTest : public PPAPITestBase { | 291 class PPAPINaClTest : public PPAPITestBase { |
228 public: | 292 public: |
229 PPAPINaClTest() { | 293 PPAPINaClTest() { |
294 } | |
295 | |
296 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
297 PPAPITestBase::SetUpCommandLine(command_line); | |
298 | |
230 FilePath plugin_lib; | 299 FilePath plugin_lib; |
231 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 300 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
232 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 301 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
233 | 302 |
234 // Enable running NaCl outside of the store. | 303 // Enable running NaCl outside of the store. |
235 launch_arguments_.AppendSwitch(switches::kEnableNaCl); | 304 command_line->AppendSwitch(switches::kEnableNaCl); |
236 launch_arguments_.AppendSwitchASCII(switches::kAllowNaClSocketAPI, | 305 command_line->AppendSwitchASCII(switches::kAllowNaClSocketAPI, "127.0.0.1"); |
237 "127.0.0.1"); | |
238 } | 306 } |
239 | 307 |
240 // Append the correct mode and testcase string | 308 // Append the correct mode and testcase string |
241 std::string BuildQuery(const std::string& base, | 309 std::string BuildQuery(const std::string& base, |
242 const std::string& test_case) { | 310 const std::string& test_case) { |
243 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), | 311 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), |
244 test_case.c_str()); | 312 test_case.c_str()); |
245 } | 313 } |
246 }; | 314 }; |
247 | 315 |
248 class PPAPINaClTestDisallowedSockets : public PPAPITestBase { | 316 class PPAPINaClTestDisallowedSockets : public PPAPITestBase { |
249 public: | 317 public: |
250 PPAPINaClTestDisallowedSockets() { | 318 PPAPINaClTestDisallowedSockets() { |
319 } | |
320 | |
321 virtual void SetUpCommandLine(CommandLine* command_line) OVERRIDE { | |
322 PPAPITestBase::SetUpCommandLine(command_line); | |
323 | |
251 FilePath plugin_lib; | 324 FilePath plugin_lib; |
252 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); | 325 EXPECT_TRUE(PathService::Get(chrome::FILE_NACL_PLUGIN, &plugin_lib)); |
253 EXPECT_TRUE(file_util::PathExists(plugin_lib)); | 326 EXPECT_TRUE(file_util::PathExists(plugin_lib)); |
254 | 327 |
255 // Enable running NaCl outside of the store. | 328 // Enable running NaCl outside of the store. |
256 launch_arguments_.AppendSwitch(switches::kEnableNaCl); | 329 command_line->AppendSwitch(switches::kEnableNaCl); |
257 } | 330 } |
258 | 331 |
259 // Append the correct mode and testcase string | 332 // Append the correct mode and testcase string |
260 std::string BuildQuery(const std::string& base, | 333 std::string BuildQuery(const std::string& base, |
261 const std::string& test_case) { | 334 const std::string& test_case) { |
262 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), | 335 return StringPrintf("%smode=nacl&testcase=%s", base.c_str(), |
263 test_case.c_str()); | 336 test_case.c_str()); |
264 } | 337 } |
265 }; | 338 }; |
266 | 339 |
267 // This macro finesses macro expansion to do what we want. | 340 // This macro finesses macro expansion to do what we want. |
268 #define STRIP_PREFIXES(test_name) StripPrefixes(#test_name) | 341 #define STRIP_PREFIXES(test_name) StripPrefixes(#test_name) |
269 | 342 |
270 // Use these macros to run the tests for a specific interface. | 343 // Use these macros to run the tests for a specific interface. |
271 // Most interfaces should be tested with both macros. | 344 // Most interfaces should be tested with both macros. |
272 #define TEST_PPAPI_IN_PROCESS(test_name) \ | 345 #define TEST_PPAPI_IN_PROCESS(test_name) \ |
273 TEST_F(PPAPITest, test_name) { \ | 346 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \ |
274 RunTest(STRIP_PREFIXES(test_name)); \ | 347 RunTest(STRIP_PREFIXES(test_name)); \ |
275 } | 348 } |
276 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \ | 349 #define TEST_PPAPI_OUT_OF_PROCESS(test_name) \ |
277 TEST_F(OutOfProcessPPAPITest, test_name) { \ | 350 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \ |
278 RunTest(STRIP_PREFIXES(test_name)); \ | 351 RunTest(STRIP_PREFIXES(test_name)); \ |
279 } | 352 } |
280 | 353 |
281 // Similar macros that test over HTTP. | 354 // Similar macros that test over HTTP. |
282 #define TEST_PPAPI_IN_PROCESS_VIA_HTTP(test_name) \ | 355 #define TEST_PPAPI_IN_PROCESS_VIA_HTTP(test_name) \ |
283 TEST_F(PPAPITest, test_name) { \ | 356 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \ |
284 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ | 357 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ |
285 } | 358 } |
286 #define TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(test_name) \ | 359 #define TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(test_name) \ |
287 TEST_F(OutOfProcessPPAPITest, test_name) { \ | 360 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \ |
288 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ | 361 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ |
289 } | 362 } |
290 | 363 |
291 // Similar macros that test with WebSocket server | 364 // Similar macros that test with WebSocket server |
292 #define TEST_PPAPI_IN_PROCESS_WITH_WS(test_name) \ | 365 #define TEST_PPAPI_IN_PROCESS_WITH_WS(test_name) \ |
293 TEST_F(PPAPITest, test_name) { \ | 366 IN_PROC_BROWSER_TEST_F(PPAPITest, test_name) { \ |
294 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ | 367 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ |
295 } | 368 } |
296 #define TEST_PPAPI_OUT_OF_PROCESS_WITH_WS(test_name) \ | 369 #define TEST_PPAPI_OUT_OF_PROCESS_WITH_WS(test_name) \ |
297 TEST_F(OutOfProcessPPAPITest, test_name) { \ | 370 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, test_name) { \ |
298 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ | 371 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ |
299 } | 372 } |
300 | 373 |
301 | 374 |
302 #if defined(DISABLE_NACL) | 375 #if defined(DISABLE_NACL) |
303 #define TEST_PPAPI_NACL_VIA_HTTP(test_name) | 376 #define TEST_PPAPI_NACL_VIA_HTTP(test_name) |
304 #define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name) | 377 #define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name) |
305 #define TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(test_name) | 378 #define TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(test_name) |
306 #else | 379 #else |
307 | 380 |
308 // NaCl based PPAPI tests | 381 // NaCl based PPAPI tests |
309 #define TEST_PPAPI_NACL_VIA_HTTP(test_name) \ | 382 #define TEST_PPAPI_NACL_VIA_HTTP(test_name) \ |
310 TEST_F(PPAPINaClTest, test_name) { \ | 383 IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ |
311 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ | 384 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ |
312 } | 385 } |
313 | 386 |
314 // NaCl based PPAPI tests with disallowed socket API | 387 // NaCl based PPAPI tests with disallowed socket API |
315 #define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name) \ | 388 #define TEST_PPAPI_NACL_VIA_HTTP_DISALLOWED_SOCKETS(test_name) \ |
316 TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \ | 389 IN_PROC_BROWSER_TEST_F(PPAPINaClTestDisallowedSockets, test_name) { \ |
317 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ | 390 RunTestViaHTTP(STRIP_PREFIXES(test_name)); \ |
318 } | 391 } |
319 | 392 |
320 // NaCl based PPAPI tests with WebSocket server | 393 // NaCl based PPAPI tests with WebSocket server |
321 #define TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(test_name) \ | 394 #define TEST_PPAPI_NACL_VIA_HTTP_WITH_WS(test_name) \ |
322 TEST_F(PPAPINaClTest, test_name) { \ | 395 IN_PROC_BROWSER_TEST_F(PPAPINaClTest, test_name) { \ |
323 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ | 396 RunTestWithWebSocketServer(STRIP_PREFIXES(test_name)); \ |
324 } | 397 } |
325 #endif | 398 #endif |
326 | 399 |
327 | 400 |
328 // | 401 // |
329 // Interface tests. | 402 // Interface tests. |
330 // | 403 // |
331 | 404 |
332 // Disable tests under ASAN. http://crbug.com/104832. | 405 // Disable tests under ASAN. http://crbug.com/104832. |
(...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
493 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_Stress) | 566 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(URLRequest_Stress) |
494 TEST_PPAPI_NACL_VIA_HTTP(URLRequest_Stress) | 567 TEST_PPAPI_NACL_VIA_HTTP(URLRequest_Stress) |
495 | 568 |
496 TEST_PPAPI_IN_PROCESS(PaintAggregator) | 569 TEST_PPAPI_IN_PROCESS(PaintAggregator) |
497 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) | 570 TEST_PPAPI_OUT_OF_PROCESS(PaintAggregator) |
498 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) | 571 TEST_PPAPI_NACL_VIA_HTTP(PaintAggregator) |
499 | 572 |
500 // TODO(danakj): http://crbug.com/115286 | 573 // TODO(danakj): http://crbug.com/115286 |
501 TEST_PPAPI_IN_PROCESS(DISABLED_Scrollbar) | 574 TEST_PPAPI_IN_PROCESS(DISABLED_Scrollbar) |
502 // http://crbug.com/89961 | 575 // http://crbug.com/89961 |
503 TEST_F(OutOfProcessPPAPITest, FAILS_Scrollbar) { | 576 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, FAILS_Scrollbar) { |
504 RunTest("Scrollbar"); | 577 RunTest("Scrollbar"); |
505 } | 578 } |
506 // TODO(danakj): http://crbug.com/115286 | 579 // TODO(danakj): http://crbug.com/115286 |
507 TEST_PPAPI_NACL_VIA_HTTP(DISABLED_Scrollbar) | 580 TEST_PPAPI_NACL_VIA_HTTP(DISABLED_Scrollbar) |
508 | 581 |
509 TEST_PPAPI_IN_PROCESS(URLUtil) | 582 TEST_PPAPI_IN_PROCESS(URLUtil) |
510 TEST_PPAPI_OUT_OF_PROCESS(URLUtil) | 583 TEST_PPAPI_OUT_OF_PROCESS(URLUtil) |
511 | 584 |
512 TEST_PPAPI_IN_PROCESS(CharSet) | 585 TEST_PPAPI_IN_PROCESS(CharSet) |
513 TEST_PPAPI_OUT_OF_PROCESS(CharSet) | 586 TEST_PPAPI_OUT_OF_PROCESS(CharSet) |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
624 // aura: http://crbug.com/104384 | 697 // aura: http://crbug.com/104384 |
625 // async flakiness: http://crbug.com/108471 | 698 // async flakiness: http://crbug.com/108471 |
626 #if defined(OS_MACOSX) || defined(USE_AURA) | 699 #if defined(OS_MACOSX) || defined(USE_AURA) |
627 #define MAYBE_FlashFullscreen DISABLED_FlashFullscreen | 700 #define MAYBE_FlashFullscreen DISABLED_FlashFullscreen |
628 #define MAYBE_OutOfProcessFlashFullscreen DISABLED_FlashFullscreen | 701 #define MAYBE_OutOfProcessFlashFullscreen DISABLED_FlashFullscreen |
629 #else | 702 #else |
630 #define MAYBE_FlashFullscreen FlashFullscreen | 703 #define MAYBE_FlashFullscreen FlashFullscreen |
631 #define MAYBE_OutOfProcessFlashFullscreen FlashFullscreen | 704 #define MAYBE_OutOfProcessFlashFullscreen FlashFullscreen |
632 #endif | 705 #endif |
633 | 706 |
634 TEST_F(PPAPITest, MAYBE_FlashFullscreen) { | 707 IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_FlashFullscreen) { |
635 RunTestViaHTTP("FlashFullscreen"); | 708 RunTestViaHTTP("FlashFullscreen"); |
636 } | 709 } |
637 TEST_F(OutOfProcessPPAPITest, MAYBE_OutOfProcessFlashFullscreen) { | 710 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, MAYBE_OutOfProcessFlashFullscreen) { |
638 RunTestViaHTTP("FlashFullscreen"); | 711 RunTestViaHTTP("FlashFullscreen"); |
639 } | 712 } |
640 | 713 |
641 TEST_PPAPI_IN_PROCESS_VIA_HTTP(Fullscreen) | 714 TEST_PPAPI_IN_PROCESS_VIA_HTTP(Fullscreen) |
642 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(Fullscreen) | 715 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(Fullscreen) |
643 | 716 |
644 TEST_PPAPI_IN_PROCESS(FlashClipboard) | 717 TEST_PPAPI_IN_PROCESS(FlashClipboard) |
645 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard) | 718 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard) |
646 | 719 |
647 // http://crbug.com/63239 | 720 // http://crbug.com/63239 |
648 #if defined(OS_POSIX) | 721 #if defined(OS_POSIX) |
649 #define MAYBE_DirectoryReader DISABLED_DirectoryReader | 722 #define MAYBE_DirectoryReader DISABLED_DirectoryReader |
650 #else | 723 #else |
651 #define MAYBE_DirectoryReader DirectoryReader | 724 #define MAYBE_DirectoryReader DirectoryReader |
652 #endif | 725 #endif |
653 | 726 |
654 // Flaky on Mac + Linux, maybe http://codereview.chromium.org/7094008 | 727 // Flaky on Mac + Linux, maybe http://codereview.chromium.org/7094008 |
655 // Not implemented out of process: http://crbug.com/106129 | 728 // Not implemented out of process: http://crbug.com/106129 |
656 TEST_F(PPAPITest, MAYBE_DirectoryReader) { | 729 IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_DirectoryReader) { |
657 RunTestViaHTTP("DirectoryReader"); | 730 RunTestViaHTTP("DirectoryReader"); |
658 } | 731 } |
659 | 732 |
660 #if defined(ENABLE_P2P_APIS) | 733 #if defined(ENABLE_P2P_APIS) |
661 // Flaky. http://crbug.com/84294 | 734 // Flaky. http://crbug.com/84294 |
662 TEST_F(PPAPITest, DISABLED_Transport) { | 735 IN_PROC_BROWSER_TEST_F(PPAPITest, DISABLED_Transport) { |
663 RunTest("Transport"); | 736 RunTest("Transport"); |
664 } | 737 } |
665 // http://crbug.com/89961 | 738 // http://crbug.com/89961 |
666 TEST_F(OutOfProcessPPAPITest, DISABLED_Transport) { | 739 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_Transport) { |
667 RunTestViaHTTP("Transport"); | 740 RunTestViaHTTP("Transport"); |
668 } | 741 } |
669 #endif // ENABLE_P2P_APIS | 742 #endif // ENABLE_P2P_APIS |
670 | 743 |
671 // There is no proxy. This is used for PDF metrics reporting, and PDF only | 744 // There is no proxy. This is used for PDF metrics reporting, and PDF only |
672 // runs in process, so there's currently no need for a proxy. | 745 // runs in process, so there's currently no need for a proxy. |
673 TEST_PPAPI_IN_PROCESS(UMA) | 746 TEST_PPAPI_IN_PROCESS(UMA) |
674 | 747 |
675 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreEqual) | 748 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreEqual) |
676 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreHostsEqual) | 749 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreHostsEqual) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
711 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreEqual) | 784 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreEqual) |
712 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreHostsEqual) | 785 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreHostsEqual) |
713 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_Describe) | 786 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_Describe) |
714 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_ReplacePort) | 787 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_ReplacePort) |
715 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAnyAddress) | 788 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAnyAddress) |
716 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetFamily) | 789 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetFamily) |
717 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_GetPort) | 790 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_GetPort) |
718 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAddress) | 791 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAddress) |
719 | 792 |
720 // PPB_TCPSocket_Private currently isn't supported in-process. | 793 // PPB_TCPSocket_Private currently isn't supported in-process. |
721 TEST_F(OutOfProcessPPAPITest, TCPSocketPrivate) { | 794 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, TCPSocketPrivate) { |
722 RunTestViaHTTP("TCPSocketPrivate"); | 795 RunTestViaHTTP("TCPSocketPrivate"); |
723 } | 796 } |
724 | 797 |
725 TEST_PPAPI_IN_PROCESS(Flash_SetInstanceAlwaysOnTop) | 798 TEST_PPAPI_IN_PROCESS(Flash_SetInstanceAlwaysOnTop) |
726 TEST_PPAPI_IN_PROCESS(Flash_GetProxyForURL) | 799 TEST_PPAPI_IN_PROCESS(Flash_GetProxyForURL) |
727 TEST_PPAPI_IN_PROCESS(Flash_MessageLoop) | 800 TEST_PPAPI_IN_PROCESS(Flash_MessageLoop) |
728 TEST_PPAPI_IN_PROCESS(Flash_GetLocalTimeZoneOffset) | 801 TEST_PPAPI_IN_PROCESS(Flash_GetLocalTimeZoneOffset) |
729 TEST_PPAPI_IN_PROCESS(Flash_GetCommandLineArgs) | 802 TEST_PPAPI_IN_PROCESS(Flash_GetCommandLineArgs) |
730 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetInstanceAlwaysOnTop) | 803 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetInstanceAlwaysOnTop) |
731 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL) | 804 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
805 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_Audio_Creation) | 878 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_Audio_Creation) |
806 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) | 879 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) |
807 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) | 880 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) |
808 | 881 |
809 TEST_PPAPI_IN_PROCESS(View_CreateVisible); | 882 TEST_PPAPI_IN_PROCESS(View_CreateVisible); |
810 TEST_PPAPI_OUT_OF_PROCESS(View_CreateVisible); | 883 TEST_PPAPI_OUT_OF_PROCESS(View_CreateVisible); |
811 TEST_PPAPI_NACL_VIA_HTTP(View_CreateVisible); | 884 TEST_PPAPI_NACL_VIA_HTTP(View_CreateVisible); |
812 // This test ensures that plugins created in a background tab have their | 885 // This test ensures that plugins created in a background tab have their |
813 // initial visibility set to false. We don't bother testing in-process for this | 886 // initial visibility set to false. We don't bother testing in-process for this |
814 // custom test since the out of process code also exercises in-process. | 887 // custom test since the out of process code also exercises in-process. |
815 TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | 888 |
889 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | |
816 // Make a second tab in the foreground. | 890 // Make a second tab in the foreground. |
817 scoped_refptr<TabProxy> tab(GetActiveTab()); | |
818 ASSERT_TRUE(tab.get()); | |
819 scoped_refptr<BrowserProxy> browser(tab->GetParentBrowser()); | |
820 ASSERT_TRUE(browser.get()); | |
821 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 891 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
822 ASSERT_TRUE(browser->AppendBackgroundTab(url)); | 892 browser::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); |
893 params.disposition = NEW_BACKGROUND_TAB; | |
894 ui_test_utils::NavigateToURL(¶ms); | |
895 } | |
823 | 896 |
824 // Tab 1 will be the one we appended after the default tab 0. | |
825 RunTestURL(tab, url); | |
826 } | |
827 // This test messes with tab visibility so is custom. | 897 // This test messes with tab visibility so is custom. |
828 TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { | 898 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { |
829 GURL url = GetTestFileUrl("View_PageHideShow"); | 899 GURL url = GetTestFileUrl("View_PageHideShow"); |
830 scoped_refptr<TabProxy> tab = GetActiveTab(); | 900 ui_test_utils::NavigateToURL(browser(), url); |
831 ASSERT_TRUE(tab.get()); | |
832 ASSERT_TRUE(tab->NavigateToURLBlockUntilNavigationsComplete(url, 1)); | |
833 | 901 |
834 // The plugin will be loaded in the foreground tab and will set the | 902 // The plugin will be loaded in the foreground tab and will send us a message. |
835 // "created" cookie. | 903 TestFinishObserver observer( |
836 std::string true_str("TRUE"); | 904 browser()->GetSelectedWebContents()->GetRenderViewHost(), |
837 std::string progress = WaitUntilCookieNonEmpty(tab.get(), url, | 905 TestTimeouts::action_max_timeout_ms()); |
838 "TestPageHideShow:Created", | 906 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
839 TestTimeouts::action_max_timeout_ms()); | 907 EXPECT_STREQ("TestPageHideShow:Created", observer.result().c_str()); |
840 ASSERT_EQ(true_str, progress); | 908 observer.Reset(); |
841 | 909 |
842 // Make a new tab to cause the original one to hide, this should trigger the | 910 // Make a new tab to cause the original one to hide, this should trigger the |
843 // next phase of the test. | 911 // next phase of the test. |
844 scoped_refptr<BrowserProxy> browser(tab->GetParentBrowser()); | 912 browser::NavigateParams params( |
845 ASSERT_TRUE(browser.get()); | 913 browser(), GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_LINK); |
846 ASSERT_TRUE(browser->AppendTab(GURL(chrome::kAboutBlankURL))); | 914 params.disposition = NEW_FOREGROUND_TAB; |
915 ui_test_utils::NavigateToURL(¶ms); | |
847 | 916 |
848 // Wait until the test acks that it got hidden. | 917 // Wait until the test acks that it got hidden. |
849 progress = WaitUntilCookieNonEmpty(tab.get(), url, "TestPageHideShow:Hidden", | 918 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
850 TestTimeouts::action_max_timeout_ms()); | 919 EXPECT_STREQ("TestPageHideShow:Hidden", observer.result().c_str()); |
851 ASSERT_EQ(true_str, progress); | 920 |
921 // Wait for the test completion event. | |
922 observer.Reset(); | |
852 | 923 |
853 // Switch back to the test tab. | 924 // Switch back to the test tab. |
854 ASSERT_TRUE(browser->ActivateTab(0)); | 925 browser()->ActivateTabAt(0, true); |
855 | 926 |
856 // Wait for the test completion event. | 927 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
857 RunTestURL(tab, url); | 928 EXPECT_STREQ("PASS", observer.result().c_str()); |
858 } | 929 } |
930 | |
859 TEST_PPAPI_IN_PROCESS(View_SizeChange); | 931 TEST_PPAPI_IN_PROCESS(View_SizeChange); |
860 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange); | 932 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange); |
861 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange); | 933 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange); |
862 TEST_PPAPI_IN_PROCESS(View_ClipChange); | 934 TEST_PPAPI_IN_PROCESS(View_ClipChange); |
863 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange); | 935 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange); |
864 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange); | 936 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange); |
865 | 937 |
866 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics) | 938 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics) |
867 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess) | 939 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess) |
868 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray) | 940 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray) |
869 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement) | 941 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement) |
870 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics) | 942 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics) |
871 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) | 943 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) |
872 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) | 944 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) |
873 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) | 945 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) |
874 | 946 |
875 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) | 947 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) |
876 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) | 948 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) |
877 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) | 949 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) |
878 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) | 950 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) |
879 | 951 |
880 #endif // ADDRESS_SANITIZER | 952 #endif // ADDRESS_SANITIZER |
OLD | NEW |