| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "net/http/http_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 | 10 |
| (...skipping 10888 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 10899 // it gets it. This is needed since the auth handler may get destroyed | 10899 // it gets it. This is needed since the auth handler may get destroyed |
| 10900 // before we get a chance to query it. | 10900 // before we get a chance to query it. |
| 10901 class UrlRecordingHttpAuthHandlerMock : public HttpAuthHandlerMock { | 10901 class UrlRecordingHttpAuthHandlerMock : public HttpAuthHandlerMock { |
| 10902 public: | 10902 public: |
| 10903 explicit UrlRecordingHttpAuthHandlerMock(GURL* url) : url_(url) {} | 10903 explicit UrlRecordingHttpAuthHandlerMock(GURL* url) : url_(url) {} |
| 10904 | 10904 |
| 10905 ~UrlRecordingHttpAuthHandlerMock() override {} | 10905 ~UrlRecordingHttpAuthHandlerMock() override {} |
| 10906 | 10906 |
| 10907 protected: | 10907 protected: |
| 10908 int GenerateAuthTokenImpl(const AuthCredentials* credentials, | 10908 int GenerateAuthTokenImpl(const AuthCredentials* credentials, |
| 10909 const HttpRequestInfo* request, | 10909 const HttpRequestInfo& request, |
| 10910 const CompletionCallback& callback, | 10910 const CompletionCallback& callback, |
| 10911 std::string* auth_token) override { | 10911 std::string* auth_token) override { |
| 10912 *url_ = request->url; | 10912 *url_ = request.url; |
| 10913 return HttpAuthHandlerMock::GenerateAuthTokenImpl( | 10913 return HttpAuthHandlerMock::GenerateAuthTokenImpl( |
| 10914 credentials, request, callback, auth_token); | 10914 credentials, request, callback, auth_token); |
| 10915 } | 10915 } |
| 10916 | 10916 |
| 10917 private: | 10917 private: |
| 10918 GURL* url_; | 10918 GURL* url_; |
| 10919 }; | 10919 }; |
| 10920 | 10920 |
| 10921 // This test ensures that the URL passed into the proxy is upgraded to https | 10921 // This test ensures that the URL passed into the proxy is upgraded to https |
| 10922 // when doing an Alternate Protocol upgrade. | 10922 // when doing an Alternate Protocol upgrade. |
| (...skipping 3839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 14762 std::string response_data; | 14762 std::string response_data; |
| 14763 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); | 14763 EXPECT_EQ(OK, ReadTransaction(trans.get(), &response_data)); |
| 14764 | 14764 |
| 14765 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), | 14765 EXPECT_EQ(CountWriteBytes(data_writes, arraysize(data_writes)), |
| 14766 trans->GetTotalSentBytes()); | 14766 trans->GetTotalSentBytes()); |
| 14767 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), | 14767 EXPECT_EQ(CountReadBytes(data_reads, arraysize(data_reads)), |
| 14768 trans->GetTotalReceivedBytes()); | 14768 trans->GetTotalReceivedBytes()); |
| 14769 } | 14769 } |
| 14770 | 14770 |
| 14771 } // namespace net | 14771 } // namespace net |
| OLD | NEW |