| 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 } | |
| 605 // Set the new substituted URL. | 601 // Set the new substituted URL. |
| 606 request.setURL( | 602 request.setURL(delegate_->RewriteLayoutTestsURL( |
| 607 delegate_->RewriteLayoutTestsURL(request.url().string().utf8())); | 603 request.url().string().utf8(), |
| 604 test_runner_->is_web_platform_tests_mode())); |
| 608 } | 605 } |
| 609 | 606 |
| 610 void WebFrameTestClient::didReceiveResponse( | 607 void WebFrameTestClient::didReceiveResponse( |
| 611 unsigned identifier, | 608 unsigned identifier, |
| 612 const blink::WebURLResponse& response) { | 609 const blink::WebURLResponse& response) { |
| 613 if (test_runner_->shouldDumpResourceLoadCallbacks()) { | 610 if (test_runner_->shouldDumpResourceLoadCallbacks()) { |
| 614 if (resource_identifier_map_.find(identifier) == | 611 if (resource_identifier_map_.find(identifier) == |
| 615 resource_identifier_map_.end()) | 612 resource_identifier_map_.end()) |
| 616 delegate_->PrintMessage("<unknown>"); | 613 delegate_->PrintMessage("<unknown>"); |
| 617 else | 614 else |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 749 else | 746 else |
| 750 callback->onError(blink::WebSetSinkIdError::NotFound); | 747 callback->onError(blink::WebSetSinkIdError::NotFound); |
| 751 } | 748 } |
| 752 | 749 |
| 753 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { | 750 void WebFrameTestClient::didClearWindowObject(blink::WebLocalFrame* frame) { |
| 754 web_test_proxy_base_->test_interfaces()->BindTo(frame); | 751 web_test_proxy_base_->test_interfaces()->BindTo(frame); |
| 755 web_test_proxy_base_->BindTo(frame); | 752 web_test_proxy_base_->BindTo(frame); |
| 756 } | 753 } |
| 757 | 754 |
| 758 } // namespace test_runner | 755 } // namespace test_runner |
| OLD | NEW |