| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/test_runner/web_test_proxy.h" | 5 #include "content/shell/renderer/test_runner/web_test_proxy.h" |
| 6 | 6 |
| 7 #include <cctype> | 7 #include <cctype> |
| 8 | 8 |
| 9 #include "base/callback_helpers.h" | 9 #include "base/callback_helpers.h" |
| 10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| (...skipping 748 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 759 delegate_->printMessage(string("Loading URL externally - \"") + | 759 delegate_->printMessage(string("Loading URL externally - \"") + |
| 760 URLDescription(request.url()) + "\"\n"); | 760 URLDescription(request.url()) + "\"\n"); |
| 761 } | 761 } |
| 762 delegate_->testFinished(); | 762 delegate_->testFinished(); |
| 763 } | 763 } |
| 764 } | 764 } |
| 765 | 765 |
| 766 void WebTestProxyBase::DidStartProvisionalLoad(WebLocalFrame* frame) { | 766 void WebTestProxyBase::DidStartProvisionalLoad(WebLocalFrame* frame) { |
| 767 if (!test_interfaces_->testRunner()->topLoadingFrame()) | 767 if (!test_interfaces_->testRunner()->topLoadingFrame()) |
| 768 test_interfaces_->testRunner()->setTopLoadingFrame(frame, false); | 768 test_interfaces_->testRunner()->setTopLoadingFrame(frame, false); |
| 769 else |
| 770 LocationChangeDone(frame); |
| 769 | 771 |
| 770 if (test_interfaces_->testRunner()->shouldDumpFrameLoadCallbacks()) { | 772 if (test_interfaces_->testRunner()->shouldDumpFrameLoadCallbacks()) { |
| 771 printFrameDescription(delegate_, frame); | 773 printFrameDescription(delegate_, frame); |
| 772 delegate_->printMessage(" - didStartProvisionalLoadForFrame\n"); | 774 delegate_->printMessage(" - didStartProvisionalLoadForFrame\n"); |
| 773 } | 775 } |
| 774 | 776 |
| 775 if (test_interfaces_->testRunner() | 777 if (test_interfaces_->testRunner() |
| 776 ->shouldDumpUserGestureInFrameLoadCallbacks()) | 778 ->shouldDumpUserGestureInFrameLoadCallbacks()) |
| 777 printFrameUserGestureStatus(delegate_, frame, | 779 printFrameUserGestureStatus(delegate_, frame, |
| 778 " - in didStartProvisionalLoadForFrame\n"); | 780 " - in didStartProvisionalLoadForFrame\n"); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1060 } | 1062 } |
| 1061 delegate_->printMessage(string("\n")); | 1063 delegate_->printMessage(string("\n")); |
| 1062 } | 1064 } |
| 1063 | 1065 |
| 1064 void WebTestProxyBase::LocationChangeDone(WebFrame* frame) { | 1066 void WebTestProxyBase::LocationChangeDone(WebFrame* frame) { |
| 1065 if (frame != test_interfaces_->testRunner()->topLoadingFrame()) return; | 1067 if (frame != test_interfaces_->testRunner()->topLoadingFrame()) return; |
| 1066 test_interfaces_->testRunner()->setTopLoadingFrame(frame, true); | 1068 test_interfaces_->testRunner()->setTopLoadingFrame(frame, true); |
| 1067 } | 1069 } |
| 1068 | 1070 |
| 1069 WebNavigationPolicy WebTestProxyBase::DecidePolicyForNavigation( | 1071 WebNavigationPolicy WebTestProxyBase::DecidePolicyForNavigation( |
| 1070 WebLocalFrame*, WebDataSource::ExtraData*, const WebURLRequest& request, | 1072 WebLocalFrame* frame, WebDataSource::ExtraData*, const WebURLRequest& reques
t, |
| 1071 WebNavigationType type, WebNavigationPolicy defaultPolicy, | 1073 WebNavigationType type, WebNavigationPolicy defaultPolicy, |
| 1072 bool isRedirect) { | 1074 bool isRedirect) { |
| 1073 WebNavigationPolicy result; | 1075 WebNavigationPolicy result; |
| 1074 if (!test_interfaces_->testRunner()->policyDelegateEnabled()) | 1076 if (!test_interfaces_->testRunner()->policyDelegateEnabled()) |
| 1075 return defaultPolicy; | 1077 return defaultPolicy; |
| 1076 | 1078 |
| 1077 delegate_->printMessage(string("Policy delegate: attempt to load ") + | 1079 delegate_->printMessage(string("Policy delegate: attempt to load ") + |
| 1078 URLDescription(request.url()) + | 1080 URLDescription(request.url()) + |
| 1079 " with navigation type '" + | 1081 " with navigation type '" + |
| 1080 webNavigationTypeToString(type) + "'\n"); | 1082 webNavigationTypeToString(type) + "'\n"); |
| (...skipping 26 matching lines...) Expand all Loading... |
| 1107 } | 1109 } |
| 1108 } | 1110 } |
| 1109 | 1111 |
| 1110 void WebTestProxyBase::ResetInputMethod() { | 1112 void WebTestProxyBase::ResetInputMethod() { |
| 1111 // If a composition text exists, then we need to let the browser process | 1113 // If a composition text exists, then we need to let the browser process |
| 1112 // to cancel the input method's ongoing composition session. | 1114 // to cancel the input method's ongoing composition session. |
| 1113 if (web_widget_) web_widget_->confirmComposition(); | 1115 if (web_widget_) web_widget_->confirmComposition(); |
| 1114 } | 1116 } |
| 1115 | 1117 |
| 1116 } // namespace content | 1118 } // namespace content |
| OLD | NEW |