Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(45)

Side by Side Diff: net/http/http_network_transaction_unittest.cc

Issue 1383613002: [net/http auth] Cleanup. Method names, and constness. Base URL: https://chromium.googlesource.com/chromium/src.git@mock-auth-handler-generalization
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/http/http_auth_unittest.cc ('k') | net/url_request/url_request_context_builder_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « net/http/http_auth_unittest.cc ('k') | net/url_request/url_request_context_builder_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698