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

Side by Side Diff: content/shell/renderer/webkit_test_runner.cc

Issue 15702006: [content shell] add support for running headless on mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: updates Created 7 years, 6 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 | « no previous file | content/shell/shell.h » ('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) 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
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
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
OLDNEW
« no previous file with comments | « no previous file | content/shell/shell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698