| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 "components/test_runner/web_frame_test_client.h" | 5 #include "components/test_runner/web_frame_test_client.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/strings/string_piece.h" | 10 #include "base/strings/string_piece.h" |
| (...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 591 !main_document_url.SchemeIs(url::kHttpsScheme)) || | 591 !main_document_url.SchemeIs(url::kHttpsScheme)) || |
| 592 IsLocalHost(main_document_url.host())) && | 592 IsLocalHost(main_document_url.host())) && |
| 593 !delegate_->AllowExternalPages()) { | 593 !delegate_->AllowExternalPages()) { |
| 594 delegate_->PrintMessage(std::string("Blocked access to external URL ") + | 594 delegate_->PrintMessage(std::string("Blocked access to external URL ") + |
| 595 request_url + "\n"); | 595 request_url + "\n"); |
| 596 BlockRequest(request); | 596 BlockRequest(request); |
| 597 return; | 597 return; |
| 598 } | 598 } |
| 599 } | 599 } |
| 600 | 600 |
| 601 if (!test_runner_->did_request_after_reset()) { |
| 602 test_runner_->set_did_request_after_reset(); |
| 603 return; |
| 604 } |
| 601 // Set the new substituted URL. | 605 // Set the new substituted URL. |
| 602 request.setURL( | 606 request.setURL( |
| 603 delegate_->RewriteLayoutTestsURL(request.url().string().utf8())); | 607 delegate_->RewriteLayoutTestsURL(request.url().string().utf8())); |
| 604 } | 608 } |
| 605 | 609 |
| 606 void WebFrameTestClient::didReceiveResponse( | 610 void WebFrameTestClient::didReceiveResponse( |
| 607 unsigned identifier, | 611 unsigned identifier, |
| 608 const blink::WebURLResponse& response) { | 612 const blink::WebURLResponse& response) { |
| 609 if (test_runner_->shouldDumpResourceLoadCallbacks()) { | 613 if (test_runner_->shouldDumpResourceLoadCallbacks()) { |
| 610 if (resource_identifier_map_.find(identifier) == | 614 if (resource_identifier_map_.find(identifier) == |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 745 else | 749 else |
| 746 callback->onError(blink::WebSetSinkIdError::NotFound); | 750 callback->onError(blink::WebSetSinkIdError::NotFound); |
| 747 } | 751 } |
| 748 | 752 |
| 749 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { | 753 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { |
| 750 web_test_proxy_base_->test_interfaces()->BindTo(frame); | 754 web_test_proxy_base_->test_interfaces()->BindTo(frame); |
| 751 web_test_proxy_base_->BindTo(frame); | 755 web_test_proxy_base_->BindTo(frame); |
| 752 } | 756 } |
| 753 | 757 |
| 754 } // namespace test_runner | 758 } // namespace test_runner |
| OLD | NEW |