Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(298)

Side by Side Diff: chrome/test/ui/npapi_uitest.cc

Issue 6354005: Remove action_max_timeout_ms and fix all the callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 9 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/test/ui/layout_plugin_uitest.cc ('k') | chrome/test/ui/omnibox_uitest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 // windows headers 8 // windows headers
9 #include <comutil.h> 9 #include <comutil.h>
10 #include <shellapi.h> 10 #include <shellapi.h>
(...skipping 24 matching lines...) Expand all
35 using npapi_test::kTestCompleteSuccess; 35 using npapi_test::kTestCompleteSuccess;
36 36
37 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi"); 37 static const FilePath::CharType* kTestDir = FILE_PATH_LITERAL("npapi");
38 38
39 // Test passing arguments to a plugin. 39 // Test passing arguments to a plugin.
40 TEST_F(NPAPITesterBase, Arguments) { 40 TEST_F(NPAPITesterBase, Arguments) {
41 const FilePath test_case(FILE_PATH_LITERAL("arguments.html")); 41 const FilePath test_case(FILE_PATH_LITERAL("arguments.html"));
42 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 42 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
43 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 43 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
44 WaitForFinish("arguments", "1", url, kTestCompleteCookie, 44 WaitForFinish("arguments", "1", url, kTestCompleteCookie,
45 kTestCompleteSuccess, action_max_timeout_ms()); 45 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
46 } 46 }
47 47
48 // Test invoking many plugins within a single page. 48 // Test invoking many plugins within a single page.
49 TEST_F(NPAPITesterBase, ManyPlugins) { 49 TEST_F(NPAPITesterBase, ManyPlugins) {
50 const FilePath test_case(FILE_PATH_LITERAL("many_plugins.html")); 50 const FilePath test_case(FILE_PATH_LITERAL("many_plugins.html"));
51 GURL url(ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case)); 51 GURL url(ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case));
52 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 52 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
53 53
54 for (int i = 1; i <= 15; i++) { 54 for (int i = 1; i <= 15; i++) {
55 SCOPED_TRACE(StringPrintf("Waiting for plugin #%d", i)); 55 SCOPED_TRACE(StringPrintf("Waiting for plugin #%d", i));
56 ASSERT_NO_FATAL_FAILURE(WaitForFinish("arguments", base::IntToString(i), 56 ASSERT_NO_FATAL_FAILURE(WaitForFinish(
57 url, kTestCompleteCookie, 57 "arguments",
58 kTestCompleteSuccess, 58 base::IntToString(i),
59 action_max_timeout_ms())); 59 url,
60 kTestCompleteCookie,
61 kTestCompleteSuccess,
62 TestTimeouts::action_max_timeout_ms()));
60 } 63 }
61 } 64 }
62 65
63 // Test various calls to GetURL from a plugin. 66 // Test various calls to GetURL from a plugin.
64 TEST_F(NPAPITesterBase, GetURL) { 67 TEST_F(NPAPITesterBase, GetURL) {
65 const FilePath test_case(FILE_PATH_LITERAL("geturl.html")); 68 const FilePath test_case(FILE_PATH_LITERAL("geturl.html"));
66 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 69 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
67 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 70 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
68 WaitForFinish("geturl", "1", url, kTestCompleteCookie, 71 WaitForFinish("geturl", "1", url, kTestCompleteCookie,
69 kTestCompleteSuccess, action_max_timeout_ms()); 72 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
70 } 73 }
71 74
72 // Test various calls to GetURL for javascript URLs with 75 // Test various calls to GetURL for javascript URLs with
73 // non NULL targets from a plugin. 76 // non NULL targets from a plugin.
74 TEST_F(NPAPITesterBase, GetJavaScriptURL) { 77 TEST_F(NPAPITesterBase, GetJavaScriptURL) {
75 const FilePath test_case(FILE_PATH_LITERAL("get_javascript_url.html")); 78 const FilePath test_case(FILE_PATH_LITERAL("get_javascript_url.html"));
76 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 79 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
77 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 80 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
78 WaitForFinish("getjavascripturl", "1", url, kTestCompleteCookie, 81 WaitForFinish("getjavascripturl", "1", url, kTestCompleteCookie,
79 kTestCompleteSuccess, action_max_timeout_ms()); 82 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
80 } 83 }
81 84
82 // Test that calling GetURL with a javascript URL and target=_self 85 // Test that calling GetURL with a javascript URL and target=_self
83 // works properly when the plugin is embedded in a subframe. 86 // works properly when the plugin is embedded in a subframe.
84 TEST_F(NPAPITesterBase, GetJavaScriptURL2) { 87 TEST_F(NPAPITesterBase, GetJavaScriptURL2) {
85 const FilePath test_case(FILE_PATH_LITERAL("get_javascript_url2.html")); 88 const FilePath test_case(FILE_PATH_LITERAL("get_javascript_url2.html"));
86 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 89 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
87 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 90 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
88 WaitForFinish("getjavascripturl2", "1", url, kTestCompleteCookie, 91 WaitForFinish("getjavascripturl2", "1", url, kTestCompleteCookie,
89 kTestCompleteSuccess, action_max_timeout_ms()); 92 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
90 } 93 }
91 94
92 TEST_F(NPAPITesterBase, GetURLRedirectNotification) { 95 TEST_F(NPAPITesterBase, GetURLRedirectNotification) {
93 const FilePath test_case(FILE_PATH_LITERAL("geturl_redirect_notify.html")); 96 const FilePath test_case(FILE_PATH_LITERAL("geturl_redirect_notify.html"));
94 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 97 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
95 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 98 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
96 WaitForFinish("geturlredirectnotify", "1", url, kTestCompleteCookie, 99 WaitForFinish("geturlredirectnotify", "1", url, kTestCompleteCookie,
97 kTestCompleteSuccess, action_max_timeout_ms()); 100 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
98 } 101 }
99 102
100 // Tests that if an NPObject is proxies back to its original process, the 103 // Tests that if an NPObject is proxies back to its original process, the
101 // original pointer is returned and not a proxy. If this fails the plugin 104 // original pointer is returned and not a proxy. If this fails the plugin
102 // will crash. 105 // will crash.
103 TEST_F(NPAPITesterBase, NPObjectProxy) { 106 TEST_F(NPAPITesterBase, NPObjectProxy) {
104 const FilePath test_case(FILE_PATH_LITERAL("npobject_proxy.html")); 107 const FilePath test_case(FILE_PATH_LITERAL("npobject_proxy.html"));
105 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 108 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
106 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 109 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
107 WaitForFinish("npobject_proxy", "1", url, kTestCompleteCookie, 110 WaitForFinish("npobject_proxy", "1", url, kTestCompleteCookie,
108 kTestCompleteSuccess, action_max_timeout_ms()); 111 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
109 } 112 }
110 113
111 #if defined(OS_WIN) || defined(OS_MACOSX) 114 #if defined(OS_WIN) || defined(OS_MACOSX)
112 // Tests if a plugin executing a self deleting script in the context of 115 // Tests if a plugin executing a self deleting script in the context of
113 // a synchronous paint event works correctly 116 // a synchronous paint event works correctly
114 // http://crbug.com/44960 117 // http://crbug.com/44960
115 TEST_F(NPAPIVisiblePluginTester, 118 TEST_F(NPAPIVisiblePluginTester,
116 FLAKY_SelfDeletePluginInvokeInSynchronousPaint) { 119 FLAKY_SelfDeletePluginInvokeInSynchronousPaint) {
117 if (ProxyLauncher::in_process_renderer()) 120 if (ProxyLauncher::in_process_renderer())
118 return; 121 return;
119 122
120 show_window_ = true; 123 show_window_ = true;
121 const FilePath test_case( 124 const FilePath test_case(
122 FILE_PATH_LITERAL("execute_script_delete_in_paint.html")); 125 FILE_PATH_LITERAL("execute_script_delete_in_paint.html"));
123 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 126 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
124 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 127 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
125 WaitForFinish("execute_script_delete_in_paint", "1", url, 128 WaitForFinish("execute_script_delete_in_paint", "1", url,
126 kTestCompleteCookie, kTestCompleteSuccess, 129 kTestCompleteCookie, kTestCompleteSuccess,
127 action_max_timeout_ms()); 130 TestTimeouts::action_max_timeout_ms());
128 } 131 }
129 #endif 132 #endif
130 133
131 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) { 134 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNewStream) {
132 if (ProxyLauncher::in_process_renderer()) 135 if (ProxyLauncher::in_process_renderer())
133 return; 136 return;
134 137
135 show_window_ = true; 138 show_window_ = true;
136 const FilePath test_case(FILE_PATH_LITERAL("self_delete_plugin_stream.html")); 139 const FilePath test_case(FILE_PATH_LITERAL("self_delete_plugin_stream.html"));
137 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 140 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
138 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 141 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
139 WaitForFinish("self_delete_plugin_stream", "1", url, 142 WaitForFinish("self_delete_plugin_stream", "1", url,
140 kTestCompleteCookie, kTestCompleteSuccess, 143 kTestCompleteCookie, kTestCompleteSuccess,
141 action_max_timeout_ms()); 144 TestTimeouts::action_max_timeout_ms());
142 } 145 }
143 146
144 #if defined(OS_WIN) 147 #if defined(OS_WIN)
145 // Tests if a plugin has a non zero window rect. 148 // Tests if a plugin has a non zero window rect.
146 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) { 149 TEST_F(NPAPIVisiblePluginTester, VerifyPluginWindowRect) {
147 show_window_ = true; 150 show_window_ = true;
148 const FilePath test_case(FILE_PATH_LITERAL("verify_plugin_window_rect.html")); 151 const FilePath test_case(FILE_PATH_LITERAL("verify_plugin_window_rect.html"));
149 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 152 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
150 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 153 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
151 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie, 154 WaitForFinish("checkwindowrect", "1", url, kTestCompleteCookie,
152 kTestCompleteSuccess, action_max_timeout_ms()); 155 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
153 } 156 }
154 157
155 // Tests that creating a new instance of a plugin while another one is handling 158 // Tests that creating a new instance of a plugin while another one is handling
156 // a paint message doesn't cause deadlock. 159 // a paint message doesn't cause deadlock.
157 TEST_F(NPAPIVisiblePluginTester, CreateInstanceInPaint) { 160 TEST_F(NPAPIVisiblePluginTester, CreateInstanceInPaint) {
158 show_window_ = true; 161 show_window_ = true;
159 const FilePath test_case(FILE_PATH_LITERAL("create_instance_in_paint.html")); 162 const FilePath test_case(FILE_PATH_LITERAL("create_instance_in_paint.html"));
160 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 163 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
161 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 164 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
162 WaitForFinish("create_instance_in_paint", "2", url, kTestCompleteCookie, 165 WaitForFinish("create_instance_in_paint", "2", url, kTestCompleteCookie,
163 kTestCompleteSuccess, action_max_timeout_ms()); 166 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
164 } 167 }
165 168
166 // Tests that putting up an alert in response to a paint doesn't deadlock. 169 // Tests that putting up an alert in response to a paint doesn't deadlock.
167 TEST_F(NPAPIVisiblePluginTester, AlertInWindowMessage) { 170 TEST_F(NPAPIVisiblePluginTester, AlertInWindowMessage) {
168 show_window_ = true; 171 show_window_ = true;
169 const FilePath test_case(FILE_PATH_LITERAL("alert_in_window_message.html")); 172 const FilePath test_case(FILE_PATH_LITERAL("alert_in_window_message.html"));
170 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 173 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
171 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 174 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
172 175
173 bool modal_dialog_showing = false; 176 bool modal_dialog_showing = false;
(...skipping 19 matching lines...) Expand all
193 TEST_F(NPAPIVisiblePluginTester, VerifyNPObjectLifetimeTest) { 196 TEST_F(NPAPIVisiblePluginTester, VerifyNPObjectLifetimeTest) {
194 if (ProxyLauncher::in_process_renderer()) 197 if (ProxyLauncher::in_process_renderer())
195 return; 198 return;
196 199
197 show_window_ = true; 200 show_window_ = true;
198 const FilePath test_case(FILE_PATH_LITERAL("npobject_lifetime_test.html")); 201 const FilePath test_case(FILE_PATH_LITERAL("npobject_lifetime_test.html"));
199 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 202 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
200 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 203 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
201 WaitForFinish("npobject_lifetime_test", "1", url, 204 WaitForFinish("npobject_lifetime_test", "1", url,
202 kTestCompleteCookie, kTestCompleteSuccess, 205 kTestCompleteCookie, kTestCompleteSuccess,
203 action_max_timeout_ms()); 206 TestTimeouts::action_max_timeout_ms());
204 } 207 }
205 208
206 // Tests that we don't crash or assert if NPP_New fails 209 // Tests that we don't crash or assert if NPP_New fails
207 TEST_F(NPAPIVisiblePluginTester, NewFails) { 210 TEST_F(NPAPIVisiblePluginTester, NewFails) {
208 const FilePath test_case(FILE_PATH_LITERAL("new_fails.html")); 211 const FilePath test_case(FILE_PATH_LITERAL("new_fails.html"));
209 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 212 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
210 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 213 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
211 WaitForFinish("new_fails", "1", url, kTestCompleteCookie, 214 WaitForFinish("new_fails", "1", url, kTestCompleteCookie,
212 kTestCompleteSuccess, action_max_timeout_ms()); 215 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
213 } 216 }
214 217
215 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNPNEvaluate) { 218 TEST_F(NPAPIVisiblePluginTester, SelfDeletePluginInNPNEvaluate) {
216 if (ProxyLauncher::in_process_renderer()) 219 if (ProxyLauncher::in_process_renderer())
217 return; 220 return;
218 221
219 const FilePath test_case( 222 const FilePath test_case(
220 FILE_PATH_LITERAL("execute_script_delete_in_npn_evaluate.html")); 223 FILE_PATH_LITERAL("execute_script_delete_in_npn_evaluate.html"));
221 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 224 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
222 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 225 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
223 WaitForFinish("npobject_delete_plugin_in_evaluate", "1", url, 226 WaitForFinish("npobject_delete_plugin_in_evaluate", "1", url,
224 kTestCompleteCookie, kTestCompleteSuccess, 227 kTestCompleteCookie, kTestCompleteSuccess,
225 action_max_timeout_ms()); 228 TestTimeouts::action_max_timeout_ms());
226 } 229 }
227 230
228 TEST_F(NPAPIVisiblePluginTester, SelfDeleteCreatePluginInNPNEvaluate) { 231 TEST_F(NPAPIVisiblePluginTester, SelfDeleteCreatePluginInNPNEvaluate) {
229 if (ProxyLauncher::in_process_renderer()) 232 if (ProxyLauncher::in_process_renderer())
230 return; 233 return;
231 234
232 const FilePath test_case( 235 const FilePath test_case(
233 FILE_PATH_LITERAL("npn_plugin_delete_create_in_evaluate.html")); 236 FILE_PATH_LITERAL("npn_plugin_delete_create_in_evaluate.html"));
234 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 237 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
235 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 238 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
236 WaitForFinish("npobject_delete_create_plugin_in_evaluate", "1", url, 239 WaitForFinish("npobject_delete_create_plugin_in_evaluate", "1", url,
237 kTestCompleteCookie, kTestCompleteSuccess, 240 kTestCompleteCookie, kTestCompleteSuccess,
238 action_max_timeout_ms()); 241 TestTimeouts::action_max_timeout_ms());
239 } 242 }
240 243
241 #endif 244 #endif
242 245
243 // FLAKY. See bug http://crbug.com/17645. This bug report indicates that this 246 // FLAKY. See bug http://crbug.com/17645. This bug report indicates that this
244 // test is crashy. I could not repro the crash on my local setup. Leaving this 247 // test is crashy. I could not repro the crash on my local setup. Leaving this
245 // marked as FLAKY for now while we watch this on the builders. 248 // marked as FLAKY for now while we watch this on the builders.
246 TEST_F(NPAPIVisiblePluginTester, FLAKY_OpenPopupWindowWithPlugin) { 249 TEST_F(NPAPIVisiblePluginTester, FLAKY_OpenPopupWindowWithPlugin) {
247 if (ProxyLauncher::in_process_renderer()) 250 if (ProxyLauncher::in_process_renderer())
248 return; 251 return;
249 252
250 const FilePath test_case( 253 const FilePath test_case(
251 FILE_PATH_LITERAL("get_javascript_open_popup_with_plugin.html")); 254 FILE_PATH_LITERAL("get_javascript_open_popup_with_plugin.html"));
252 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 255 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
253 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 256 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
254 WaitForFinish("plugin_popup_with_plugin_target", "1", url, 257 WaitForFinish("plugin_popup_with_plugin_target", "1", url,
255 kTestCompleteCookie, kTestCompleteSuccess, 258 kTestCompleteCookie, kTestCompleteSuccess,
256 TestTimeouts::action_timeout_ms()); 259 TestTimeouts::action_timeout_ms());
257 } 260 }
258 261
259 // Test checking the privacy mode is off. 262 // Test checking the privacy mode is off.
260 TEST_F(NPAPITesterBase, PrivateDisabled) { 263 TEST_F(NPAPITesterBase, PrivateDisabled) {
261 if (ProxyLauncher::in_process_renderer()) 264 if (ProxyLauncher::in_process_renderer())
262 return; 265 return;
263 266
264 const FilePath test_case(FILE_PATH_LITERAL("private.html")); 267 const FilePath test_case(FILE_PATH_LITERAL("private.html"));
265 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 268 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
266 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 269 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
267 WaitForFinish("private", "1", url, kTestCompleteCookie, 270 WaitForFinish("private", "1", url, kTestCompleteCookie,
268 kTestCompleteSuccess, action_max_timeout_ms()); 271 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
269 } 272 }
270 273
271 TEST_F(NPAPITesterBase, ScheduleTimer) { 274 TEST_F(NPAPITesterBase, ScheduleTimer) {
272 const FilePath test_case(FILE_PATH_LITERAL("schedule_timer.html")); 275 const FilePath test_case(FILE_PATH_LITERAL("schedule_timer.html"));
273 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 276 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
274 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 277 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
275 WaitForFinish("schedule_timer", "1", url, kTestCompleteCookie, 278 WaitForFinish("schedule_timer", "1", url, kTestCompleteCookie,
276 kTestCompleteSuccess, action_max_timeout_ms()); 279 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
277 } 280 }
278 281
279 TEST_F(NPAPITesterBase, PluginThreadAsyncCall) { 282 TEST_F(NPAPITesterBase, PluginThreadAsyncCall) {
280 const FilePath test_case(FILE_PATH_LITERAL("plugin_thread_async_call.html")); 283 const FilePath test_case(FILE_PATH_LITERAL("plugin_thread_async_call.html"));
281 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 284 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
282 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 285 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
283 WaitForFinish("plugin_thread_async_call", "1", url, kTestCompleteCookie, 286 WaitForFinish("plugin_thread_async_call", "1", url, kTestCompleteCookie,
284 kTestCompleteSuccess, action_max_timeout_ms()); 287 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
285 } 288 }
286 289
287 // Test checking the privacy mode is on. 290 // Test checking the privacy mode is on.
288 TEST_F(NPAPIIncognitoTester, PrivateEnabled) { 291 TEST_F(NPAPIIncognitoTester, PrivateEnabled) {
289 if (ProxyLauncher::in_process_renderer()) 292 if (ProxyLauncher::in_process_renderer())
290 return; 293 return;
291 294
292 const FilePath test_case(FILE_PATH_LITERAL("private.html?private")); 295 const FilePath test_case(FILE_PATH_LITERAL("private.html?private"));
293 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 296 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
294 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 297 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
295 WaitForFinish("private", "1", url, kTestCompleteCookie, 298 WaitForFinish("private", "1", url, kTestCompleteCookie,
296 kTestCompleteSuccess, action_max_timeout_ms()); 299 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
297 } 300 }
298 301
299 #if defined(OS_WIN) || defined(OS_MACOSX) 302 #if defined(OS_WIN) || defined(OS_MACOSX)
300 // Test a browser hang due to special case of multiple 303 // Test a browser hang due to special case of multiple
301 // plugin instances indulged in sync calls across renderer. 304 // plugin instances indulged in sync calls across renderer.
302 TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) { 305 TEST_F(NPAPIVisiblePluginTester, MultipleInstancesSyncCalls) {
303 if (ProxyLauncher::in_process_renderer()) 306 if (ProxyLauncher::in_process_renderer())
304 return; 307 return;
305 308
306 const FilePath test_case( 309 const FilePath test_case(
307 FILE_PATH_LITERAL("multiple_instances_sync_calls.html")); 310 FILE_PATH_LITERAL("multiple_instances_sync_calls.html"));
308 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 311 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
309 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 312 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
310 WaitForFinish("multiple_instances_sync_calls", "1", url, kTestCompleteCookie, 313 WaitForFinish("multiple_instances_sync_calls", "1", url, kTestCompleteCookie,
311 kTestCompleteSuccess, action_max_timeout_ms()); 314 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
312 } 315 }
313 #endif 316 #endif
314 317
315 TEST_F(NPAPIVisiblePluginTester, GetURLRequestFailWrite) { 318 TEST_F(NPAPIVisiblePluginTester, GetURLRequestFailWrite) {
316 if (ProxyLauncher::in_process_renderer()) 319 if (ProxyLauncher::in_process_renderer())
317 return; 320 return;
318 321
319 GURL url(URLRequestMockHTTPJob::GetMockUrl( 322 GURL url(URLRequestMockHTTPJob::GetMockUrl(
320 FilePath(FILE_PATH_LITERAL( 323 FilePath(FILE_PATH_LITERAL(
321 "npapi/plugin_url_request_fail_write.html")))); 324 "npapi/plugin_url_request_fail_write.html"))));
322 325
323 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 326 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
324 327
325 WaitForFinish("geturl_fail_write", "1", url, kTestCompleteCookie, 328 WaitForFinish("geturl_fail_write", "1", url, kTestCompleteCookie,
326 kTestCompleteSuccess, action_max_timeout_ms()); 329 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
327 } 330 }
328 331
329 #if defined(OS_WIN) 332 #if defined(OS_WIN)
330 TEST_F(NPAPITesterBase, EnsureScriptingWorksInDestroy) { 333 TEST_F(NPAPITesterBase, EnsureScriptingWorksInDestroy) {
331 if (ProxyLauncher::in_process_renderer()) 334 if (ProxyLauncher::in_process_renderer())
332 return; 335 return;
333 336
334 const FilePath test_case( 337 const FilePath test_case(
335 FILE_PATH_LITERAL("ensure_scripting_works_in_destroy.html")); 338 FILE_PATH_LITERAL("ensure_scripting_works_in_destroy.html"));
336 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 339 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
337 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 340 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
338 WaitForFinish("ensure_scripting_works_in_destroy", "1", url, 341 WaitForFinish("ensure_scripting_works_in_destroy", "1", url,
339 kTestCompleteCookie, kTestCompleteSuccess, 342 kTestCompleteCookie, kTestCompleteSuccess,
340 action_max_timeout_ms()); 343 TestTimeouts::action_max_timeout_ms());
341 } 344 }
342 345
343 // This test uses a Windows Event to signal to the plugin that it should crash 346 // This test uses a Windows Event to signal to the plugin that it should crash
344 // on NP_Initialize. 347 // on NP_Initialize.
345 TEST_F(NPAPITesterBase, NoHangIfInitCrashes) { 348 TEST_F(NPAPITesterBase, NoHangIfInitCrashes) {
346 if (ProxyLauncher::in_process_renderer()) 349 if (ProxyLauncher::in_process_renderer())
347 return; 350 return;
348 351
349 // Only Windows implements the crash service for now. 352 // Only Windows implements the crash service for now.
350 #if defined(OS_WIN) 353 #if defined(OS_WIN)
351 expected_crashes_ = 1; 354 expected_crashes_ = 1;
352 #endif 355 #endif
353 356
354 HANDLE crash_event = CreateEvent(NULL, TRUE, FALSE, L"TestPluginCrashOnInit"); 357 HANDLE crash_event = CreateEvent(NULL, TRUE, FALSE, L"TestPluginCrashOnInit");
355 SetEvent(crash_event); 358 SetEvent(crash_event);
356 const FilePath test_case(FILE_PATH_LITERAL("no_hang_if_init_crashes.html")); 359 const FilePath test_case(FILE_PATH_LITERAL("no_hang_if_init_crashes.html"));
357 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case); 360 GURL url = ui_test_utils::GetTestUrl(FilePath(kTestDir), test_case);
358 NavigateToURL(url); 361 NavigateToURL(url);
359 WaitForFinish("no_hang_if_init_crashes", "1", url, 362 WaitForFinish("no_hang_if_init_crashes", "1", url,
360 kTestCompleteCookie, kTestCompleteSuccess, 363 kTestCompleteCookie, kTestCompleteSuccess,
361 action_max_timeout_ms()); 364 TestTimeouts::action_max_timeout_ms());
362 CloseHandle(crash_event); 365 CloseHandle(crash_event);
363 } 366 }
364 367
365 #endif 368 #endif
366 369
367 TEST_F(NPAPIVisiblePluginTester, PluginReferrerTest) { 370 TEST_F(NPAPIVisiblePluginTester, PluginReferrerTest) {
368 if (ProxyLauncher::in_process_renderer()) 371 if (ProxyLauncher::in_process_renderer())
369 return; 372 return;
370 373
371 GURL url(URLRequestMockHTTPJob::GetMockUrl( 374 GURL url(URLRequestMockHTTPJob::GetMockUrl(
372 FilePath(FILE_PATH_LITERAL( 375 FilePath(FILE_PATH_LITERAL(
373 "npapi/plugin_url_request_referrer_test.html")))); 376 "npapi/plugin_url_request_referrer_test.html"))));
374 377
375 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 378 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
376 379
377 WaitForFinish("plugin_referrer_test", "1", url, kTestCompleteCookie, 380 WaitForFinish("plugin_referrer_test", "1", url, kTestCompleteCookie,
378 kTestCompleteSuccess, action_max_timeout_ms()); 381 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
379 } 382 }
380 383
381 #if defined(OS_MACOSX) 384 #if defined(OS_MACOSX)
382 TEST_F(NPAPIVisiblePluginTester, PluginConvertPointTest) { 385 TEST_F(NPAPIVisiblePluginTester, PluginConvertPointTest) {
383 if (ProxyLauncher::in_process_renderer()) 386 if (ProxyLauncher::in_process_renderer())
384 return; 387 return;
385 388
386 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 389 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
387 ASSERT_TRUE(browser.get()); 390 ASSERT_TRUE(browser.get());
388 scoped_refptr<WindowProxy> window(browser->GetWindow()); 391 scoped_refptr<WindowProxy> window(browser->GetWindow());
389 ASSERT_TRUE(window.get()); 392 ASSERT_TRUE(window.get());
390 window->SetBounds(gfx::Rect(50, 50, 400, 400)); 393 window->SetBounds(gfx::Rect(50, 50, 400, 400));
391 394
392 GURL url(URLRequestMockHTTPJob::GetMockUrl( 395 GURL url(URLRequestMockHTTPJob::GetMockUrl(
393 FilePath(FILE_PATH_LITERAL("npapi/convert_point.html")))); 396 FilePath(FILE_PATH_LITERAL("npapi/convert_point.html"))));
394 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 397 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
395 398
396 // TODO(stuartmorgan): When the automation system supports sending clicks, 399 // TODO(stuartmorgan): When the automation system supports sending clicks,
397 // change the test to trigger on mouse-down rather than window focus. 400 // change the test to trigger on mouse-down rather than window focus.
398 ASSERT_TRUE(browser->BringToFront()); 401 ASSERT_TRUE(browser->BringToFront());
399 WaitForFinish("convert_point", "1", url, kTestCompleteCookie, 402 WaitForFinish("convert_point", "1", url, kTestCompleteCookie,
400 kTestCompleteSuccess, action_max_timeout_ms()); 403 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
401 } 404 }
402 #endif 405 #endif
403 406
404 TEST_F(NPAPIVisiblePluginTester, ClickToPlay) { 407 TEST_F(NPAPIVisiblePluginTester, ClickToPlay) {
405 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0)); 408 scoped_refptr<BrowserProxy> browser(automation()->GetBrowserWindow(0));
406 ASSERT_TRUE(browser.get()); 409 ASSERT_TRUE(browser.get());
407 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS, 410 ASSERT_TRUE(browser->SetDefaultContentSetting(CONTENT_SETTINGS_TYPE_PLUGINS,
408 CONTENT_SETTING_BLOCK)); 411 CONTENT_SETTING_BLOCK));
409 412
410 GURL url(URLRequestMockHTTPJob::GetMockUrl( 413 GURL url(URLRequestMockHTTPJob::GetMockUrl(
411 FilePath(FILE_PATH_LITERAL("npapi/click_to_play.html")))); 414 FilePath(FILE_PATH_LITERAL("npapi/click_to_play.html"))));
412 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url)); 415 ASSERT_NO_FATAL_FAILURE(NavigateToURL(url));
413 416
414 scoped_refptr<TabProxy> tab(browser->GetTab(0)); 417 scoped_refptr<TabProxy> tab(browser->GetTab(0));
415 ASSERT_TRUE(tab.get()); 418 ASSERT_TRUE(tab.get());
416 419
417 ASSERT_TRUE(tab->LoadBlockedPlugins()); 420 ASSERT_TRUE(tab->LoadBlockedPlugins());
418 421
419 WaitForFinish("setup", "1", url, kTestCompleteCookie, 422 WaitForFinish("setup", "1", url, kTestCompleteCookie,
420 kTestCompleteSuccess, action_max_timeout_ms()); 423 kTestCompleteSuccess, TestTimeouts::action_max_timeout_ms());
421 } 424 }
OLDNEW
« no previous file with comments | « chrome/test/ui/layout_plugin_uitest.cc ('k') | chrome/test/ui/omnibox_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698