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

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

Issue 1685003002: Plumb the correct owner document through DocumentInit::m_owner. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Trim thingie Created 4 years, 10 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
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 #include <algorithm> 8 #include <algorithm>
9 #include <clocale> 9 #include <clocale>
10 #include <cmath> 10 #include <cmath>
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after
834 render_view()->GetWebView()->setFocusedFrame(frame); 834 render_view()->GetWebView()->setFocusedFrame(frame);
835 } 835 }
836 836
837 void BlinkTestRunner::DidFailProvisionalLoad(WebLocalFrame* frame, 837 void BlinkTestRunner::DidFailProvisionalLoad(WebLocalFrame* frame,
838 const WebURLError& error) { 838 const WebURLError& error) {
839 focus_on_next_commit_ = false; 839 focus_on_next_commit_ = false;
840 } 840 }
841 841
842 // Public methods - ----------------------------------------------------------- 842 // Public methods - -----------------------------------------------------------
843 843
844 void BlinkTestRunner::Reset() { 844 void BlinkTestRunner::Reset(bool for_new_test) {
845 // The proxy_ is always non-NULL, it is set right after construction. 845 // The proxy_ is always non-NULL, it is set right after construction.
846 proxy_->set_widget(render_view()->GetWebView()); 846 proxy_->set_widget(render_view()->GetWebView());
847 proxy_->Reset(); 847 proxy_->Reset();
848 prefs_.Reset(); 848 prefs_.Reset();
849 routing_ids_.clear(); 849 routing_ids_.clear();
850 session_histories_.clear(); 850 session_histories_.clear();
851 current_entry_indexes_.clear(); 851 current_entry_indexes_.clear();
852 852
853 render_view()->ClearEditCommands(); 853 render_view()->ClearEditCommands();
854 if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame()) 854 if (for_new_test) {
dcheng 2016/02/23 00:11:32 I'm not quite sure what the right thing to do here
855 render_view()->GetWebView()->mainFrame()->setName(WebString()); 855 if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame())
856 render_view()->GetWebView()->mainFrame()->clearOpener(); 856 render_view()->GetWebView()->mainFrame()->setName(WebString());
857 render_view()->GetWebView()->mainFrame()->clearOpener();
858 }
857 859
858 // Resetting the internals object also overrides the WebPreferences, so we 860 // Resetting the internals object also overrides the WebPreferences, so we
859 // have to sync them to WebKit again. 861 // have to sync them to WebKit again.
860 if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame()) { 862 if (render_view()->GetWebView()->mainFrame()->isWebLocalFrame()) {
861 WebTestingSupport::resetInternalsObject( 863 WebTestingSupport::resetInternalsObject(
862 render_view()->GetWebView()->mainFrame()->toWebLocalFrame()); 864 render_view()->GetWebView()->mainFrame()->toWebLocalFrame());
863 render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences()); 865 render_view()->SetWebkitPreferences(render_view()->GetWebkitPreferences());
864 } 866 }
865 } 867 }
866 868
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
994 const std::vector<std::vector<PageState>>& session_histories, 996 const std::vector<std::vector<PageState>>& session_histories,
995 const std::vector<unsigned>& current_entry_indexes) { 997 const std::vector<unsigned>& current_entry_indexes) {
996 routing_ids_ = routing_ids; 998 routing_ids_ = routing_ids;
997 session_histories_ = session_histories; 999 session_histories_ = session_histories;
998 current_entry_indexes_ = current_entry_indexes; 1000 current_entry_indexes_ = current_entry_indexes;
999 CaptureDump(); 1001 CaptureDump();
1000 } 1002 }
1001 1003
1002 void BlinkTestRunner::OnReset() { 1004 void BlinkTestRunner::OnReset() {
1003 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->ResetAll(); 1005 LayoutTestRenderProcessObserver::GetInstance()->test_interfaces()->ResetAll();
1004 Reset(); 1006 Reset(true /* for_new_test */);
1005 // Navigating to about:blank will make sure that no new loads are initiated 1007 // Navigating to about:blank will make sure that no new loads are initiated
1006 // by the renderer. 1008 // by the renderer.
1007 render_view()->GetWebView()->mainFrame()->loadRequest( 1009 render_view()->GetWebView()->mainFrame()->loadRequest(
1008 WebURLRequest(GURL(url::kAboutBlankURL))); 1010 WebURLRequest(GURL(url::kAboutBlankURL)));
1009 Send(new ShellViewHostMsg_ResetDone(routing_id())); 1011 Send(new ShellViewHostMsg_ResetDone(routing_id()));
1010 } 1012 }
1011 1013
1012 void BlinkTestRunner::OnNotifyDone() { 1014 void BlinkTestRunner::OnNotifyDone() {
1013 render_view()->GetWebView()->mainFrame()->executeScript( 1015 render_view()->GetWebView()->mainFrame()->executeScript(
1014 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();"))); 1016 WebScriptSource(WebString::fromUTF8("testRunner.notifyDone();")));
(...skipping 16 matching lines...) Expand all
1031 get_bluetooth_events_callbacks_.pop_front(); 1033 get_bluetooth_events_callbacks_.pop_front();
1032 callback.Run(events); 1034 callback.Run(events);
1033 } 1035 }
1034 1036
1035 void BlinkTestRunner::ReportLeakDetectionResult( 1037 void BlinkTestRunner::ReportLeakDetectionResult(
1036 const LeakDetectionResult& report) { 1038 const LeakDetectionResult& report) {
1037 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report)); 1039 Send(new ShellViewHostMsg_LeakDetectionDone(routing_id(), report));
1038 } 1040 }
1039 1041
1040 } // namespace content 1042 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698