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 "content/shell/webkit_test_controller.h" | 5 #include "content/shell/webkit_test_controller.h" |
6 | 6 |
7 #include <iostream> | 7 #include <iostream> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (main_window_) { | 234 if (main_window_) { |
235 WebContentsObserver::Observe(NULL); | 235 WebContentsObserver::Observe(NULL); |
236 main_window_ = NULL; | 236 main_window_ = NULL; |
237 } | 237 } |
238 Shell::CloseAllWindows(); | 238 Shell::CloseAllWindows(); |
239 Send(new ShellViewMsg_ResetAll); | 239 Send(new ShellViewMsg_ResetAll); |
240 current_pid_ = base::kNullProcessId; | 240 current_pid_ = base::kNullProcessId; |
241 return true; | 241 return true; |
242 } | 242 } |
243 | 243 |
| 244 void WebKitTestController::SetTempPath(const base::FilePath& temp_path) { |
| 245 temp_path_ = temp_path; |
| 246 } |
| 247 |
244 void WebKitTestController::RendererUnresponsive() { | 248 void WebKitTestController::RendererUnresponsive() { |
245 DCHECK(CalledOnValidThread()); | 249 DCHECK(CalledOnValidThread()); |
246 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTimeout)) | 250 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kNoTimeout)) |
247 printer_->AddErrorMessage("#PROCESS UNRESPONSIVE - renderer"); | 251 printer_->AddErrorMessage("#PROCESS UNRESPONSIVE - renderer"); |
248 } | 252 } |
249 | 253 |
250 void WebKitTestController::OverrideWebkitPrefs( | 254 void WebKitTestController::OverrideWebkitPrefs( |
251 webkit_glue::WebPreferences* prefs) { | 255 webkit_glue::WebPreferences* prefs) { |
252 if (should_override_prefs_) { | 256 if (should_override_prefs_) { |
253 *prefs = prefs_; | 257 *prefs = prefs_; |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 } | 296 } |
293 | 297 |
294 void WebKitTestController::RenderViewCreated(RenderViewHost* render_view_host) { | 298 void WebKitTestController::RenderViewCreated(RenderViewHost* render_view_host) { |
295 DCHECK(CalledOnValidThread()); | 299 DCHECK(CalledOnValidThread()); |
296 // Might be kNullProcessHandle, in which case we will receive a notification | 300 // Might be kNullProcessHandle, in which case we will receive a notification |
297 // later when the RenderProcessHost was created. | 301 // later when the RenderProcessHost was created. |
298 if (render_view_host->GetProcess()->GetHandle() != base::kNullProcessHandle) | 302 if (render_view_host->GetProcess()->GetHandle() != base::kNullProcessHandle) |
299 current_pid_ = base::GetProcId(render_view_host->GetProcess()->GetHandle()); | 303 current_pid_ = base::GetProcId(render_view_host->GetProcess()->GetHandle()); |
300 ShellViewMsg_SetTestConfiguration_Params params; | 304 ShellViewMsg_SetTestConfiguration_Params params; |
301 params.current_working_directory = current_working_directory_; | 305 params.current_working_directory = current_working_directory_; |
| 306 params.temp_path = temp_path_; |
302 params.test_url = test_url_; | 307 params.test_url = test_url_; |
303 params.enable_pixel_dumping = enable_pixel_dumping_; | 308 params.enable_pixel_dumping = enable_pixel_dumping_; |
304 params.layout_test_timeout = kTestTimeoutMilliseconds; | 309 params.layout_test_timeout = kTestTimeoutMilliseconds; |
305 params.allow_external_pages = CommandLine::ForCurrentProcess()->HasSwitch( | 310 params.allow_external_pages = CommandLine::ForCurrentProcess()->HasSwitch( |
306 switches::kAllowExternalPages); | 311 switches::kAllowExternalPages); |
307 params.expected_pixel_hash = expected_pixel_hash_; | 312 params.expected_pixel_hash = expected_pixel_hash_; |
308 render_view_host->Send(new ShellViewMsg_SetTestConfiguration( | 313 render_view_host->Send(new ShellViewMsg_SetTestConfiguration( |
309 render_view_host->GetRoutingID(), params)); | 314 render_view_host->GetRoutingID(), params)); |
310 } | 315 } |
311 | 316 |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 | 444 |
440 void WebKitTestController::OnNotImplemented( | 445 void WebKitTestController::OnNotImplemented( |
441 const std::string& object_name, | 446 const std::string& object_name, |
442 const std::string& property_name) { | 447 const std::string& property_name) { |
443 printer_->AddErrorMessage( | 448 printer_->AddErrorMessage( |
444 std::string("FAIL: NOT IMPLEMENTED: ") + | 449 std::string("FAIL: NOT IMPLEMENTED: ") + |
445 object_name + "." + property_name); | 450 object_name + "." + property_name); |
446 } | 451 } |
447 | 452 |
448 } // namespace content | 453 } // namespace content |
OLD | NEW |