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

Side by Side Diff: content/shell/renderer/layout_test/blink_test_runner.cc

Issue 1886103002: Move DumpBackForwardLists out of WebTestProxyBase. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@separate-layout-and-paint-async-then
Patch Set: Rebasing... Created 4 years, 8 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
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | no next file » | 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/layout_test/blink_test_runner.h" 5 #include "content/shell/renderer/layout_test/blink_test_runner.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <clocale> 10 #include <clocale>
(...skipping 574 matching lines...) Expand 10 before | Expand all | Expand 10 after
585 void BlinkTestRunner::LoadURLForFrame(const WebURL& url, 585 void BlinkTestRunner::LoadURLForFrame(const WebURL& url,
586 const std::string& frame_name) { 586 const std::string& frame_name) {
587 Send(new ShellViewHostMsg_LoadURLForFrame( 587 Send(new ShellViewHostMsg_LoadURLForFrame(
588 routing_id(), url, frame_name)); 588 routing_id(), url, frame_name));
589 } 589 }
590 590
591 bool BlinkTestRunner::AllowExternalPages() { 591 bool BlinkTestRunner::AllowExternalPages() {
592 return test_config_.allow_external_pages; 592 return test_config_.allow_external_pages;
593 } 593 }
594 594
595 std::string BlinkTestRunner::DumpHistoryForWindow( 595 std::string BlinkTestRunner::DumpHistoryForWindow(blink::WebView* web_view) {
596 test_runner::WebTestProxyBase* proxy) {
597 size_t pos = 0; 596 size_t pos = 0;
598 std::vector<int>::iterator id; 597 std::vector<int>::iterator id;
599 for (id = routing_ids_.begin(); id != routing_ids_.end(); ++id, ++pos) { 598 for (id = routing_ids_.begin(); id != routing_ids_.end(); ++id, ++pos) {
600 RenderView* render_view = RenderView::FromRoutingID(*id); 599 RenderView* render_view = RenderView::FromRoutingID(*id);
601 if (!render_view) { 600 if (!render_view) {
602 NOTREACHED(); 601 NOTREACHED();
603 continue; 602 continue;
604 } 603 }
605 if (BlinkTestRunner::Get(render_view)->proxy() == proxy) 604 if (render_view->GetWebView() == web_view)
606 break; 605 break;
607 } 606 }
608 607
609 if (id == routing_ids_.end()) { 608 if (id == routing_ids_.end()) {
610 NOTREACHED(); 609 NOTREACHED();
611 return std::string(); 610 return std::string();
612 } 611 }
613 return DumpBackForwardList(session_histories_[pos], 612 return DumpBackForwardList(session_histories_[pos],
614 current_entry_indexes_[pos]); 613 current_entry_indexes_[pos]);
615 } 614 }
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
823 } 822 }
824 823
825 Send(new ShellViewHostMsg_InitiateLayoutDump(routing_id())); 824 Send(new ShellViewHostMsg_InitiateLayoutDump(routing_id()));
826 // OnLayoutDumpCompleted will be eventually called by an IPC from the browser. 825 // OnLayoutDumpCompleted will be eventually called by an IPC from the browser.
827 } 826 }
828 827
829 void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) { 828 void BlinkTestRunner::OnLayoutDumpCompleted(std::string completed_layout_dump) {
830 test_runner::WebTestInterfaces* interfaces = 829 test_runner::WebTestInterfaces* interfaces =
831 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); 830 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces();
832 if (interfaces->TestRunner()->ShouldDumpBackForwardList()) { 831 if (interfaces->TestRunner()->ShouldDumpBackForwardList()) {
833 completed_layout_dump.append(proxy()->DumpBackForwardLists()); 832 for (WebView* web_view : interfaces->GetWindowList())
833 completed_layout_dump.append(DumpHistoryForWindow(web_view));
834 } 834 }
835 835
836 Send(new ShellViewHostMsg_TextDump(routing_id(), completed_layout_dump)); 836 Send(new ShellViewHostMsg_TextDump(routing_id(), completed_layout_dump));
837 837
838 CaptureDumpContinued(); 838 CaptureDumpContinued();
839 } 839 }
840 840
841 void BlinkTestRunner::CaptureDumpContinued() { 841 void BlinkTestRunner::CaptureDumpContinued() {
842 test_runner::WebTestInterfaces* interfaces = 842 test_runner::WebTestInterfaces* interfaces =
843 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces(); 843 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces();
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
971 get_bluetooth_events_callbacks_.pop_front(); 971 get_bluetooth_events_callbacks_.pop_front();
972 callback.Run(events); 972 callback.Run(events);
973 } 973 }
974 974
975 void BlinkTestRunner::ReportLeakDetectionResult( 975 void BlinkTestRunner::ReportLeakDetectionResult(
976 const LeakDetectionResult& report) { 976 const LeakDetectionResult& report) {
977 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 977 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
978 } 978 }
979 979
980 } // namespace content 980 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/renderer/layout_test/blink_test_runner.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698