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_runner_host.h" | 5 #include "content/shell/webkit_test_runner_host.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/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 printer_->PrintImageFooter(); | 174 printer_->PrintImageFooter(); |
175 enable_pixel_dumping_ = false; | 175 enable_pixel_dumping_ = false; |
176 expected_pixel_hash_.clear(); | 176 expected_pixel_hash_.clear(); |
177 captured_dump_ = false; | 177 captured_dump_ = false; |
178 dump_as_text_ = false; | 178 dump_as_text_ = false; |
179 dump_child_frames_ = false; | 179 dump_child_frames_ = false; |
180 is_printing_ = false; | 180 is_printing_ = false; |
181 should_stay_on_page_after_handling_before_unload_ = false; | 181 should_stay_on_page_after_handling_before_unload_ = false; |
182 wait_until_done_ = false; | 182 wait_until_done_ = false; |
183 prefs_ = ShellWebPreferences(); | 183 prefs_ = ShellWebPreferences(); |
| 184 can_open_windows_ = false; |
184 watchdog_.Cancel(); | 185 watchdog_.Cancel(); |
185 if (main_window_) { | 186 if (main_window_) { |
186 Observe(NULL); | 187 Observe(NULL); |
187 main_window_ = NULL; | 188 main_window_ = NULL; |
188 } | 189 } |
189 Shell::CloseAllWindows(); | 190 Shell::CloseAllWindows(); |
190 Send(new ShellViewMsg_ResetAll); | 191 Send(new ShellViewMsg_ResetAll); |
191 return true; | 192 return true; |
192 } | 193 } |
193 | 194 |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
373 IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotifyDone, OnNotifyDone) | 374 IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotifyDone, OnNotifyDone) |
374 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DumpAsText, OnDumpAsText) | 375 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DumpAsText, OnDumpAsText) |
375 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DumpChildFramesAsText, | 376 IPC_MESSAGE_HANDLER(ShellViewHostMsg_DumpChildFramesAsText, |
376 OnDumpChildFramesAsText) | 377 OnDumpChildFramesAsText) |
377 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetPrinting, OnSetPrinting) | 378 IPC_MESSAGE_HANDLER(ShellViewHostMsg_SetPrinting, OnSetPrinting) |
378 IPC_MESSAGE_HANDLER( | 379 IPC_MESSAGE_HANDLER( |
379 ShellViewHostMsg_SetShouldStayOnPageAfterHandlingBeforeUnload, | 380 ShellViewHostMsg_SetShouldStayOnPageAfterHandlingBeforeUnload, |
380 OnSetShouldStayOnPageAfterHandlingBeforeUnload) | 381 OnSetShouldStayOnPageAfterHandlingBeforeUnload) |
381 IPC_MESSAGE_HANDLER(ShellViewHostMsg_WaitUntilDone, OnWaitUntilDone) | 382 IPC_MESSAGE_HANDLER(ShellViewHostMsg_WaitUntilDone, OnWaitUntilDone) |
382 IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotImplemented, OnNotImplemented) | 383 IPC_MESSAGE_HANDLER(ShellViewHostMsg_NotImplemented, OnNotImplemented) |
| 384 IPC_MESSAGE_HANDLER(ShellViewHostMsg_CanOpenWindows, OnCanOpenWindows) |
383 IPC_MESSAGE_UNHANDLED(handled = false) | 385 IPC_MESSAGE_UNHANDLED(handled = false) |
384 IPC_END_MESSAGE_MAP() | 386 IPC_END_MESSAGE_MAP() |
385 | 387 |
386 return handled; | 388 return handled; |
387 } | 389 } |
388 | 390 |
389 void WebKitTestRunnerHost::OnNotifyDone() { | 391 void WebKitTestRunnerHost::OnNotifyDone() { |
390 WebKitTestController::Get()->NotifyDone(); | 392 WebKitTestController::Get()->NotifyDone(); |
391 } | 393 } |
392 | 394 |
(...skipping 19 matching lines...) Expand all Loading... |
412 void WebKitTestRunnerHost::OnWaitUntilDone() { | 414 void WebKitTestRunnerHost::OnWaitUntilDone() { |
413 WebKitTestController::Get()->WaitUntilDone(); | 415 WebKitTestController::Get()->WaitUntilDone(); |
414 } | 416 } |
415 | 417 |
416 void WebKitTestRunnerHost::OnNotImplemented( | 418 void WebKitTestRunnerHost::OnNotImplemented( |
417 const std::string& object_name, | 419 const std::string& object_name, |
418 const std::string& property_name) { | 420 const std::string& property_name) { |
419 WebKitTestController::Get()->NotImplemented(object_name, property_name); | 421 WebKitTestController::Get()->NotImplemented(object_name, property_name); |
420 } | 422 } |
421 | 423 |
| 424 void WebKitTestRunnerHost::OnCanOpenWindows() { |
| 425 WebKitTestController::Get()->set_can_open_windows(true); |
| 426 } |
| 427 |
422 } // namespace content | 428 } // namespace content |
OLD | NEW |