| 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 "net/spdy/spdy_proxy_client_socket.h" | 5 #include "net/spdy/spdy_proxy_client_socket.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
| 10 #include "net/base/address_list.h" | 10 #include "net/base/address_list.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 void AssertReadReturns(const char* data, int len); | 91 void AssertReadReturns(const char* data, int len); |
| 92 void AssertAsyncWriteSucceeds(const char* data, int len); | 92 void AssertAsyncWriteSucceeds(const char* data, int len); |
| 93 void AssertWriteReturns(const char* data, int len, int rv); | 93 void AssertWriteReturns(const char* data, int len, int rv); |
| 94 void AssertWriteLength(int len); | 94 void AssertWriteLength(int len); |
| 95 void AssertAsyncWriteWithReadsSucceeds(const char* data, int len, | 95 void AssertAsyncWriteWithReadsSucceeds(const char* data, int len, |
| 96 int num_reads); | 96 int num_reads); |
| 97 | 97 |
| 98 void AddAuthToCache() { | 98 void AddAuthToCache() { |
| 99 const base::string16 kFoo(base::ASCIIToUTF16("foo")); | 99 const base::string16 kFoo(base::ASCIIToUTF16("foo")); |
| 100 const base::string16 kBar(base::ASCIIToUTF16("bar")); | 100 const base::string16 kBar(base::ASCIIToUTF16("bar")); |
| 101 session_->http_auth_cache()->Add(GURL(kProxyUrl), | 101 session_->http_auth_cache()->Add(GURL(kProxyUrl), "MyRealm1", "basic", |
| 102 "MyRealm1", | |
| 103 HttpAuth::AUTH_SCHEME_BASIC, | |
| 104 "Basic realm=MyRealm1", | 102 "Basic realm=MyRealm1", |
| 105 AuthCredentials(kFoo, kBar), | 103 AuthCredentials(kFoo, kBar), "/"); |
| 106 "/"); | |
| 107 } | 104 } |
| 108 | 105 |
| 109 void Run(int steps) { | 106 void Run(int steps) { |
| 110 data_->StopAfter(steps); | 107 data_->StopAfter(steps); |
| 111 data_->Run(); | 108 data_->Run(); |
| 112 } | 109 } |
| 113 | 110 |
| 114 void CloseSpdySession(Error error, const std::string& description) { | 111 void CloseSpdySession(Error error, const std::string& description) { |
| 115 spdy_session_->CloseSessionOnError(error, description); | 112 spdy_session_->CloseSessionOnError(error, description); |
| 116 } | 113 } |
| (...skipping 1259 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 | 1373 |
| 1377 EXPECT_FALSE(sock_.get()); | 1374 EXPECT_FALSE(sock_.get()); |
| 1378 EXPECT_TRUE(read_callback.have_result()); | 1375 EXPECT_TRUE(read_callback.have_result()); |
| 1379 EXPECT_FALSE(write_callback_.have_result()); | 1376 EXPECT_FALSE(write_callback_.have_result()); |
| 1380 | 1377 |
| 1381 // Let the RST_STREAM write while |rst| is in-scope. | 1378 // Let the RST_STREAM write while |rst| is in-scope. |
| 1382 base::MessageLoop::current()->RunUntilIdle(); | 1379 base::MessageLoop::current()->RunUntilIdle(); |
| 1383 } | 1380 } |
| 1384 | 1381 |
| 1385 } // namespace net | 1382 } // namespace net |
| OLD | NEW |