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/renderer/webkit_test_runner.h" | 5 #include "content/shell/renderer/webkit_test_runner.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <clocale> | 8 #include <clocale> |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
561 } | 561 } |
562 | 562 |
563 void WebKitTestRunner::Navigate(const GURL& url) { | 563 void WebKitTestRunner::Navigate(const GURL& url) { |
564 focus_on_next_commit_ = true; | 564 focus_on_next_commit_ = true; |
565 if (!is_main_window_ && | 565 if (!is_main_window_ && |
566 ShellRenderProcessObserver::GetInstance()->main_test_runner() == this) { | 566 ShellRenderProcessObserver::GetInstance()->main_test_runner() == this) { |
567 WebTestInterfaces* interfaces = | 567 WebTestInterfaces* interfaces = |
568 ShellRenderProcessObserver::GetInstance()->test_interfaces(); | 568 ShellRenderProcessObserver::GetInstance()->test_interfaces(); |
569 interfaces->setTestIsRunning(true); | 569 interfaces->setTestIsRunning(true); |
570 interfaces->configureForTestWithURL(GURL(), false); | 570 interfaces->configureForTestWithURL(GURL(), false); |
| 571 ForceResizeRenderView(render_view(), WebSize(800, 600)); |
571 } | 572 } |
572 } | 573 } |
573 | 574 |
574 void WebKitTestRunner::DidCommitProvisionalLoad(WebFrame* frame, | 575 void WebKitTestRunner::DidCommitProvisionalLoad(WebFrame* frame, |
575 bool is_new_navigation) { | 576 bool is_new_navigation) { |
576 if (!focus_on_next_commit_) | 577 if (!focus_on_next_commit_) |
577 return; | 578 return; |
578 focus_on_next_commit_ = false; | 579 focus_on_next_commit_ = false; |
579 render_view()->GetWebView()->setFocusedFrame(frame); | 580 render_view()->GetWebView()->setFocusedFrame(frame); |
580 } | 581 } |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 ->loadRequest(WebURLRequest(GURL("about:blank"))); | 710 ->loadRequest(WebURLRequest(GURL("about:blank"))); |
710 Send(new ShellViewHostMsg_ResetDone(routing_id())); | 711 Send(new ShellViewHostMsg_ResetDone(routing_id())); |
711 } | 712 } |
712 | 713 |
713 void WebKitTestRunner::OnNotifyDone() { | 714 void WebKitTestRunner::OnNotifyDone() { |
714 render_view()->GetWebView()->mainFrame()->executeScript( | 715 render_view()->GetWebView()->mainFrame()->executeScript( |
715 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); | 716 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); |
716 } | 717 } |
717 | 718 |
718 } // namespace content | 719 } // namespace content |
OLD | NEW |