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_.clear(); |
| 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_MODULE, &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 // http://crbug.com/107175. | 714 // http://crbug.com/107175. |
642 #if defined(OS_WIN) | 715 #if defined(OS_WIN) |
643 #define MAYBE_Fullscreen DISABLED_Fullscreen | 716 #define MAYBE_Fullscreen DISABLED_Fullscreen |
644 #else | 717 #else |
645 #define MAYBE_Fullscreen Fullscreen | 718 #define MAYBE_Fullscreen Fullscreen |
646 #endif | 719 #endif |
647 TEST_PPAPI_IN_PROCESS_VIA_HTTP(Fullscreen) | 720 TEST_PPAPI_IN_PROCESS_VIA_HTTP(Fullscreen) |
648 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_Fullscreen) | 721 TEST_PPAPI_OUT_OF_PROCESS_VIA_HTTP(MAYBE_Fullscreen) |
649 | 722 |
650 TEST_PPAPI_IN_PROCESS(FlashClipboard) | 723 TEST_PPAPI_IN_PROCESS(FlashClipboard) |
651 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard) | 724 TEST_PPAPI_OUT_OF_PROCESS(FlashClipboard) |
652 | 725 |
653 // http://crbug.com/63239 | 726 // http://crbug.com/63239 |
654 #if defined(OS_POSIX) | 727 #if defined(OS_POSIX) |
655 #define MAYBE_DirectoryReader DISABLED_DirectoryReader | 728 #define MAYBE_DirectoryReader DISABLED_DirectoryReader |
656 #else | 729 #else |
657 #define MAYBE_DirectoryReader DirectoryReader | 730 #define MAYBE_DirectoryReader DirectoryReader |
658 #endif | 731 #endif |
659 | 732 |
660 // Flaky on Mac + Linux, maybe http://codereview.chromium.org/7094008 | 733 // Flaky on Mac + Linux, maybe http://codereview.chromium.org/7094008 |
661 // Not implemented out of process: http://crbug.com/106129 | 734 // Not implemented out of process: http://crbug.com/106129 |
662 TEST_F(PPAPITest, MAYBE_DirectoryReader) { | 735 IN_PROC_BROWSER_TEST_F(PPAPITest, MAYBE_DirectoryReader) { |
663 RunTestViaHTTP("DirectoryReader"); | 736 RunTestViaHTTP("DirectoryReader"); |
664 } | 737 } |
665 | 738 |
666 #if defined(ENABLE_P2P_APIS) | 739 #if defined(ENABLE_P2P_APIS) |
667 // Flaky. http://crbug.com/84294 | 740 // Flaky. http://crbug.com/84294 |
668 TEST_F(PPAPITest, DISABLED_Transport) { | 741 IN_PROC_BROWSER_TEST_F(PPAPITest, DISABLED_Transport) { |
669 RunTest("Transport"); | 742 RunTest("Transport"); |
670 } | 743 } |
671 // http://crbug.com/89961 | 744 // http://crbug.com/89961 |
672 TEST_F(OutOfProcessPPAPITest, DISABLED_Transport) { | 745 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, DISABLED_Transport) { |
673 RunTestViaHTTP("Transport"); | 746 RunTestViaHTTP("Transport"); |
674 } | 747 } |
675 #endif // ENABLE_P2P_APIS | 748 #endif // ENABLE_P2P_APIS |
676 | 749 |
677 // There is no proxy. This is used for PDF metrics reporting, and PDF only | 750 // There is no proxy. This is used for PDF metrics reporting, and PDF only |
678 // runs in process, so there's currently no need for a proxy. | 751 // runs in process, so there's currently no need for a proxy. |
679 TEST_PPAPI_IN_PROCESS(UMA) | 752 TEST_PPAPI_IN_PROCESS(UMA) |
680 | 753 |
681 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreEqual) | 754 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreEqual) |
682 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreHostsEqual) | 755 TEST_PPAPI_IN_PROCESS(NetAddressPrivate_AreHostsEqual) |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
717 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreEqual) | 790 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreEqual) |
718 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreHostsEqual) | 791 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_AreHostsEqual) |
719 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_Describe) | 792 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_Describe) |
720 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_ReplacePort) | 793 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_ReplacePort) |
721 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAnyAddress) | 794 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAnyAddress) |
722 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetFamily) | 795 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetFamily) |
723 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_GetPort) | 796 TEST_PPAPI_NACL_VIA_HTTP(MAYBE_NetAddressPrivateUntrusted_GetPort) |
724 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAddress) | 797 TEST_PPAPI_NACL_VIA_HTTP(NetAddressPrivateUntrusted_GetAddress) |
725 | 798 |
726 // PPB_TCPSocket_Private currently isn't supported in-process. | 799 // PPB_TCPSocket_Private currently isn't supported in-process. |
727 TEST_F(OutOfProcessPPAPITest, TCPSocketPrivate) { | 800 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, TCPSocketPrivate) { |
728 RunTestViaHTTP("TCPSocketPrivate"); | 801 RunTestViaHTTP("TCPSocketPrivate"); |
729 } | 802 } |
730 | 803 |
731 TEST_PPAPI_IN_PROCESS(Flash_SetInstanceAlwaysOnTop) | 804 TEST_PPAPI_IN_PROCESS(Flash_SetInstanceAlwaysOnTop) |
732 TEST_PPAPI_IN_PROCESS(Flash_GetProxyForURL) | 805 TEST_PPAPI_IN_PROCESS(Flash_GetProxyForURL) |
733 TEST_PPAPI_IN_PROCESS(Flash_MessageLoop) | 806 TEST_PPAPI_IN_PROCESS(Flash_MessageLoop) |
734 TEST_PPAPI_IN_PROCESS(Flash_GetLocalTimeZoneOffset) | 807 TEST_PPAPI_IN_PROCESS(Flash_GetLocalTimeZoneOffset) |
735 TEST_PPAPI_IN_PROCESS(Flash_GetCommandLineArgs) | 808 TEST_PPAPI_IN_PROCESS(Flash_GetCommandLineArgs) |
736 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetInstanceAlwaysOnTop) | 809 TEST_PPAPI_OUT_OF_PROCESS(Flash_SetInstanceAlwaysOnTop) |
737 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL) | 810 TEST_PPAPI_OUT_OF_PROCESS(Flash_GetProxyForURL) |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_Audio_Creation) | 884 TEST_PPAPI_OUT_OF_PROCESS(MAYBE_Audio_Creation) |
812 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) | 885 TEST_PPAPI_OUT_OF_PROCESS(Audio_DestroyNoStop) |
813 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) | 886 TEST_PPAPI_OUT_OF_PROCESS(Audio_Failures) |
814 | 887 |
815 TEST_PPAPI_IN_PROCESS(View_CreateVisible); | 888 TEST_PPAPI_IN_PROCESS(View_CreateVisible); |
816 TEST_PPAPI_OUT_OF_PROCESS(View_CreateVisible); | 889 TEST_PPAPI_OUT_OF_PROCESS(View_CreateVisible); |
817 TEST_PPAPI_NACL_VIA_HTTP(View_CreateVisible); | 890 TEST_PPAPI_NACL_VIA_HTTP(View_CreateVisible); |
818 // This test ensures that plugins created in a background tab have their | 891 // This test ensures that plugins created in a background tab have their |
819 // initial visibility set to false. We don't bother testing in-process for this | 892 // initial visibility set to false. We don't bother testing in-process for this |
820 // custom test since the out of process code also exercises in-process. | 893 // custom test since the out of process code also exercises in-process. |
821 TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { | 894 |
| 895 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_CreateInvisible) { |
822 // Make a second tab in the foreground. | 896 // Make a second tab in the foreground. |
823 scoped_refptr<TabProxy> tab(GetActiveTab()); | |
824 ASSERT_TRUE(tab.get()); | |
825 scoped_refptr<BrowserProxy> browser(tab->GetParentBrowser()); | |
826 ASSERT_TRUE(browser.get()); | |
827 GURL url = GetTestFileUrl("View_CreatedInvisible"); | 897 GURL url = GetTestFileUrl("View_CreatedInvisible"); |
828 ASSERT_TRUE(browser->AppendBackgroundTab(url)); | 898 browser::NavigateParams params(browser(), url, content::PAGE_TRANSITION_LINK); |
| 899 params.disposition = NEW_BACKGROUND_TAB; |
| 900 ui_test_utils::NavigateToURL(¶ms); |
| 901 } |
829 | 902 |
830 // Tab 1 will be the one we appended after the default tab 0. | |
831 RunTestURL(tab, url); | |
832 } | |
833 // This test messes with tab visibility so is custom. | 903 // This test messes with tab visibility so is custom. |
834 TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { | 904 IN_PROC_BROWSER_TEST_F(OutOfProcessPPAPITest, View_PageHideShow) { |
| 905 // The plugin will be loaded in the foreground tab and will send us a message. |
| 906 TestFinishObserver observer( |
| 907 browser()->GetSelectedWebContents()->GetRenderViewHost(), |
| 908 TestTimeouts::action_max_timeout_ms()); |
| 909 |
835 GURL url = GetTestFileUrl("View_PageHideShow"); | 910 GURL url = GetTestFileUrl("View_PageHideShow"); |
836 scoped_refptr<TabProxy> tab = GetActiveTab(); | 911 ui_test_utils::NavigateToURL(browser(), url); |
837 ASSERT_TRUE(tab.get()); | |
838 ASSERT_TRUE(tab->NavigateToURLBlockUntilNavigationsComplete(url, 1)); | |
839 | 912 |
840 // The plugin will be loaded in the foreground tab and will set the | 913 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
841 // "created" cookie. | 914 EXPECT_STREQ("TestPageHideShow:Created", observer.result().c_str()); |
842 std::string true_str("TRUE"); | 915 observer.Reset(); |
843 std::string progress = WaitUntilCookieNonEmpty(tab.get(), url, | |
844 "TestPageHideShow:Created", | |
845 TestTimeouts::action_max_timeout_ms()); | |
846 ASSERT_EQ(true_str, progress); | |
847 | 916 |
848 // Make a new tab to cause the original one to hide, this should trigger the | 917 // Make a new tab to cause the original one to hide, this should trigger the |
849 // next phase of the test. | 918 // next phase of the test. |
850 scoped_refptr<BrowserProxy> browser(tab->GetParentBrowser()); | 919 browser::NavigateParams params( |
851 ASSERT_TRUE(browser.get()); | 920 browser(), GURL(chrome::kAboutBlankURL), content::PAGE_TRANSITION_LINK); |
852 ASSERT_TRUE(browser->AppendTab(GURL(chrome::kAboutBlankURL))); | 921 params.disposition = NEW_FOREGROUND_TAB; |
| 922 ui_test_utils::NavigateToURL(¶ms); |
853 | 923 |
854 // Wait until the test acks that it got hidden. | 924 // Wait until the test acks that it got hidden. |
855 progress = WaitUntilCookieNonEmpty(tab.get(), url, "TestPageHideShow:Hidden", | 925 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
856 TestTimeouts::action_max_timeout_ms()); | 926 EXPECT_STREQ("TestPageHideShow:Hidden", observer.result().c_str()); |
857 ASSERT_EQ(true_str, progress); | 927 |
| 928 // Wait for the test completion event. |
| 929 observer.Reset(); |
858 | 930 |
859 // Switch back to the test tab. | 931 // Switch back to the test tab. |
860 ASSERT_TRUE(browser->ActivateTab(0)); | 932 browser()->ActivateTabAt(0, true); |
861 | 933 |
862 // Wait for the test completion event. | 934 ASSERT_TRUE(observer.WaitForFinish()) << "Test timed out."; |
863 RunTestURL(tab, url); | 935 EXPECT_STREQ("PASS", observer.result().c_str()); |
864 } | 936 } |
| 937 |
865 TEST_PPAPI_IN_PROCESS(View_SizeChange); | 938 TEST_PPAPI_IN_PROCESS(View_SizeChange); |
866 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange); | 939 TEST_PPAPI_OUT_OF_PROCESS(View_SizeChange); |
867 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange); | 940 TEST_PPAPI_NACL_VIA_HTTP(View_SizeChange); |
868 TEST_PPAPI_IN_PROCESS(View_ClipChange); | 941 TEST_PPAPI_IN_PROCESS(View_ClipChange); |
869 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange); | 942 TEST_PPAPI_OUT_OF_PROCESS(View_ClipChange); |
870 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange); | 943 TEST_PPAPI_NACL_VIA_HTTP(View_ClipChange); |
871 | 944 |
872 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics) | 945 TEST_PPAPI_IN_PROCESS(ResourceArray_Basics) |
873 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess) | 946 TEST_PPAPI_IN_PROCESS(ResourceArray_OutOfRangeAccess) |
874 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray) | 947 TEST_PPAPI_IN_PROCESS(ResourceArray_EmptyArray) |
875 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement) | 948 TEST_PPAPI_IN_PROCESS(ResourceArray_InvalidElement) |
876 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics) | 949 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_Basics) |
877 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) | 950 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_OutOfRangeAccess) |
878 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) | 951 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_EmptyArray) |
879 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) | 952 TEST_PPAPI_OUT_OF_PROCESS(ResourceArray_InvalidElement) |
880 | 953 |
881 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) | 954 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_Basics) |
882 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) | 955 TEST_PPAPI_IN_PROCESS(FlashMessageLoop_RunWithoutQuit) |
883 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) | 956 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_Basics) |
884 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) | 957 TEST_PPAPI_OUT_OF_PROCESS(FlashMessageLoop_RunWithoutQuit) |
885 | 958 |
886 #endif // ADDRESS_SANITIZER | 959 #endif // ADDRESS_SANITIZER |
OLD | NEW |