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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
302 } | 302 } |
303 | 303 |
304 void WebKitTestController::OpenURL(const GURL& url) { | 304 void WebKitTestController::OpenURL(const GURL& url) { |
305 Shell::CreateNewWindow(main_window_->web_contents()->GetBrowserContext(), | 305 Shell::CreateNewWindow(main_window_->web_contents()->GetBrowserContext(), |
306 url, | 306 url, |
307 main_window_->web_contents()->GetSiteInstance(), | 307 main_window_->web_contents()->GetSiteInstance(), |
308 MSG_ROUTING_NONE, | 308 MSG_ROUTING_NONE, |
309 gfx::Size()); | 309 gfx::Size()); |
310 } | 310 } |
311 | 311 |
| 312 void WebKitTestController::TestFinishedInSecondaryWindow() { |
| 313 RenderViewHost* render_view_host = |
| 314 main_window_->web_contents()->GetRenderViewHost(); |
| 315 render_view_host->Send( |
| 316 new ShellViewMsg_NotifyDone(render_view_host->GetRoutingID())); |
| 317 } |
| 318 |
312 bool WebKitTestController::OnMessageReceived(const IPC::Message& message) { | 319 bool WebKitTestController::OnMessageReceived(const IPC::Message& message) { |
313 DCHECK(CalledOnValidThread()); | 320 DCHECK(CalledOnValidThread()); |
314 bool handled = true; | 321 bool handled = true; |
315 IPC_BEGIN_MESSAGE_MAP(WebKitTestController, message) | 322 IPC_BEGIN_MESSAGE_MAP(WebKitTestController, message) |
316 IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) | 323 IPC_MESSAGE_HANDLER(ShellViewHostMsg_PrintMessage, OnPrintMessage) |
317 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) | 324 IPC_MESSAGE_HANDLER(ShellViewHostMsg_TextDump, OnTextDump) |
318 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) | 325 IPC_MESSAGE_HANDLER(ShellViewHostMsg_ImageDump, OnImageDump) |
319 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) | 326 IPC_MESSAGE_HANDLER(ShellViewHostMsg_AudioDump, OnAudioDump) |
320 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, | 327 IPC_MESSAGE_HANDLER(ShellViewHostMsg_OverridePreferences, |
321 OnOverridePreferences) | 328 OnOverridePreferences) |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
609 open_windows[i]->Close(); | 616 open_windows[i]->Close(); |
610 } | 617 } |
611 MessageLoop::current()->RunUntilIdle(); | 618 MessageLoop::current()->RunUntilIdle(); |
612 } | 619 } |
613 | 620 |
614 void WebKitTestController::OnResetDone() { | 621 void WebKitTestController::OnResetDone() { |
615 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); | 622 MessageLoop::current()->PostTask(FROM_HERE, MessageLoop::QuitClosure()); |
616 } | 623 } |
617 | 624 |
618 } // namespace content | 625 } // namespace content |
OLD | NEW |