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 1180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1191 delegate_->printMessage(std::string("\n")); | 1191 delegate_->printMessage(std::string("\n")); |
1192 } | 1192 } |
1193 | 1193 |
1194 void WebTestProxyBase::LocationChangeDone(blink::WebFrame* frame) { | 1194 void WebTestProxyBase::LocationChangeDone(blink::WebFrame* frame) { |
1195 if (frame != test_interfaces_->testRunner()->topLoadingFrame()) | 1195 if (frame != test_interfaces_->testRunner()->topLoadingFrame()) |
1196 return; | 1196 return; |
1197 test_interfaces_->testRunner()->setTopLoadingFrame(frame, true); | 1197 test_interfaces_->testRunner()->setTopLoadingFrame(frame, true); |
1198 } | 1198 } |
1199 | 1199 |
1200 blink::WebNavigationPolicy WebTestProxyBase::DecidePolicyForNavigation( | 1200 blink::WebNavigationPolicy WebTestProxyBase::DecidePolicyForNavigation( |
1201 blink::WebLocalFrame* frame, | 1201 const blink::WebFrameClient::NavigationPolicyInfo& info) { |
1202 blink::WebDataSource::ExtraData* data, | |
1203 const blink::WebURLRequest& request, | |
1204 blink::WebNavigationType type, | |
1205 blink::WebNavigationPolicy default_policy, | |
1206 bool is_redirect) { | |
1207 blink::WebNavigationPolicy result; | 1202 blink::WebNavigationPolicy result; |
1208 if (!test_interfaces_->testRunner()->policyDelegateEnabled()) | 1203 if (!test_interfaces_->testRunner()->policyDelegateEnabled()) |
1209 return default_policy; | 1204 return info.defaultPolicy; |
1210 | 1205 |
1211 delegate_->printMessage(std::string("Policy delegate: attempt to load ") + | 1206 delegate_->printMessage(std::string("Policy delegate: attempt to load ") + |
1212 URLDescription(request.url()) + | 1207 URLDescription(info.urlRequest.url()) + |
1213 " with navigation type '" + | 1208 " with navigation type '" + |
1214 WebNavigationTypeToString(type) + "'\n"); | 1209 WebNavigationTypeToString(info.navigationType) + "'\n"
); |
1215 if (test_interfaces_->testRunner()->policyDelegateIsPermissive()) | 1210 if (test_interfaces_->testRunner()->policyDelegateIsPermissive()) |
1216 result = blink::WebNavigationPolicyCurrentTab; | 1211 result = blink::WebNavigationPolicyCurrentTab; |
1217 else | 1212 else |
1218 result = blink::WebNavigationPolicyIgnore; | 1213 result = blink::WebNavigationPolicyIgnore; |
1219 | 1214 |
1220 if (test_interfaces_->testRunner()->policyDelegateShouldNotifyDone()) | 1215 if (test_interfaces_->testRunner()->policyDelegateShouldNotifyDone()) |
1221 test_interfaces_->testRunner()->policyDelegateDone(); | 1216 test_interfaces_->testRunner()->policyDelegateDone(); |
1222 return result; | 1217 return result; |
1223 } | 1218 } |
1224 | 1219 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1257 if (!push_client_.get()) | 1252 if (!push_client_.get()) |
1258 push_client_.reset(new MockWebPushClient); | 1253 push_client_.reset(new MockWebPushClient); |
1259 return push_client_.get(); | 1254 return push_client_.get(); |
1260 } | 1255 } |
1261 | 1256 |
1262 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { | 1257 blink::WebPushClient* WebTestProxyBase::GetWebPushClient() { |
1263 return GetPushClientMock(); | 1258 return GetPushClientMock(); |
1264 } | 1259 } |
1265 | 1260 |
1266 } // namespace content | 1261 } // namespace content |
OLD | NEW |