| OLD | NEW |
| 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 <memory> | 5 #include <memory> |
| 6 #include <utility> | 6 #include <utility> |
| 7 | 7 |
| 8 #include "base/memory/ptr_util.h" | 8 #include "base/memory/ptr_util.h" |
| 9 #include "build/build_config.h" | 9 #include "build/build_config.h" |
| 10 | 10 |
| (...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 652 TestURLRequestContextWithProxy(const std::string& proxy, | 652 TestURLRequestContextWithProxy(const std::string& proxy, |
| 653 NetworkDelegate* delegate) | 653 NetworkDelegate* delegate) |
| 654 : TestURLRequestContext(true) { | 654 : TestURLRequestContext(true) { |
| 655 context_storage_.set_proxy_service(ProxyService::CreateFixed(proxy)); | 655 context_storage_.set_proxy_service(ProxyService::CreateFixed(proxy)); |
| 656 set_network_delegate(delegate); | 656 set_network_delegate(delegate); |
| 657 Init(); | 657 Init(); |
| 658 } | 658 } |
| 659 ~TestURLRequestContextWithProxy() override {} | 659 ~TestURLRequestContextWithProxy() override {} |
| 660 }; | 660 }; |
| 661 | 661 |
| 662 // A mock ReportSender that just remembers the latest report | 662 // A mock ReportSenderInterface that just remembers the latest report |
| 663 // URI and report to be sent. | 663 // URI and report to be sent. |
| 664 class MockCertificateReportSender | 664 class MockCertificateReportSender |
| 665 : public TransportSecurityState::ReportSender { | 665 : public TransportSecurityState::ReportSenderInterface { |
| 666 public: | 666 public: |
| 667 MockCertificateReportSender() {} | 667 MockCertificateReportSender() {} |
| 668 ~MockCertificateReportSender() override {} | 668 ~MockCertificateReportSender() override {} |
| 669 | 669 |
| 670 void Send(const GURL& report_uri, const std::string& report) override { | 670 void Send(const GURL& report_uri, const std::string& report) override { |
| 671 latest_report_uri_ = report_uri; | 671 latest_report_uri_ = report_uri; |
| 672 latest_report_ = report; | 672 latest_report_ = report; |
| 673 } | 673 } |
| 674 | 674 |
| 675 void SetErrorCallback( | 675 void SetErrorCallback( |
| (...skipping 9365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10041 AddTestInterceptor()->set_main_intercept_job(std::move(job)); | 10041 AddTestInterceptor()->set_main_intercept_job(std::move(job)); |
| 10042 | 10042 |
| 10043 req->Start(); | 10043 req->Start(); |
| 10044 req->Cancel(); | 10044 req->Cancel(); |
| 10045 base::RunLoop().RunUntilIdle(); | 10045 base::RunLoop().RunUntilIdle(); |
| 10046 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); | 10046 EXPECT_EQ(URLRequestStatus::CANCELED, req->status().status()); |
| 10047 EXPECT_EQ(0, d.received_redirect_count()); | 10047 EXPECT_EQ(0, d.received_redirect_count()); |
| 10048 } | 10048 } |
| 10049 | 10049 |
| 10050 } // namespace net | 10050 } // namespace net |
| OLD | NEW |