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

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

Issue 1439053002: Change ProxyResolver::GetProxyForURL() to take a scoped_ptr<Request>* rather than a RequestHandle* (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: ToT Created 4 years, 11 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
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 #include <limits> 10 #include <limits>
(...skipping 10823 matching lines...) Expand 10 before | Expand all | Expand 10 after
10834 } 10834 }
10835 10835
10836 class CapturingProxyResolver : public ProxyResolver { 10836 class CapturingProxyResolver : public ProxyResolver {
10837 public: 10837 public:
10838 CapturingProxyResolver() {} 10838 CapturingProxyResolver() {}
10839 ~CapturingProxyResolver() override {} 10839 ~CapturingProxyResolver() override {}
10840 10840
10841 int GetProxyForURL(const GURL& url, 10841 int GetProxyForURL(const GURL& url,
10842 ProxyInfo* results, 10842 ProxyInfo* results,
10843 const CompletionCallback& callback, 10843 const CompletionCallback& callback,
10844 RequestHandle* request, 10844 scoped_ptr<Request>* request,
10845 const BoundNetLog& net_log) override { 10845 const BoundNetLog& net_log) override {
10846 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP, 10846 ProxyServer proxy_server(ProxyServer::SCHEME_HTTP,
10847 HostPortPair("myproxy", 80)); 10847 HostPortPair("myproxy", 80));
10848 results->UseProxyServer(proxy_server); 10848 results->UseProxyServer(proxy_server);
10849 resolved_.push_back(url); 10849 resolved_.push_back(url);
10850 return OK; 10850 return OK;
10851 } 10851 }
10852 10852
10853 void CancelRequest(RequestHandle request) override { NOTREACHED(); }
10854
10855 LoadState GetLoadState(RequestHandle request) const override {
10856 NOTREACHED();
10857 return LOAD_STATE_IDLE;
10858 }
10859
10860 const std::vector<GURL>& resolved() const { return resolved_; } 10853 const std::vector<GURL>& resolved() const { return resolved_; }
10861 10854
10862 private: 10855 private:
10863 std::vector<GURL> resolved_; 10856 std::vector<GURL> resolved_;
10864 10857
10865 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver); 10858 DISALLOW_COPY_AND_ASSIGN(CapturingProxyResolver);
10866 }; 10859 };
10867 10860
10868 class CapturingProxyResolverFactory : public ProxyResolverFactory { 10861 class CapturingProxyResolverFactory : public ProxyResolverFactory {
10869 public: 10862 public:
(...skipping 4926 matching lines...) Expand 10 before | Expand all | Expand 10 after
15796 15789
15797 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_)); 15790 scoped_ptr<HttpNetworkSession> session(CreateSession(&session_deps_));
15798 HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get()); 15791 HttpNetworkTransaction trans(DEFAULT_PRIORITY, session.get());
15799 15792
15800 EXPECT_THAT(trans.server_ssl_config_.alpn_protos, 15793 EXPECT_THAT(trans.server_ssl_config_.alpn_protos,
15801 testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11)); 15794 testing::ElementsAre(kProtoHTTP2, kProtoSPDY31, kProtoHTTP11));
15802 EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty()); 15795 EXPECT_TRUE(trans.server_ssl_config_.npn_protos.empty());
15803 } 15796 }
15804 15797
15805 } // namespace net 15798 } // namespace net
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698