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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 void AssertAsyncReadEquals(const char* data, int len); | 86 void AssertAsyncReadEquals(const char* data, int len); |
87 void AssertReadStarts(const char* data, int len); | 87 void AssertReadStarts(const char* data, int len); |
88 void AssertReadReturns(const char* data, int len); | 88 void AssertReadReturns(const char* data, int len); |
89 void AssertAsyncWriteSucceeds(const char* data, int len); | 89 void AssertAsyncWriteSucceeds(const char* data, int len); |
90 void AssertWriteReturns(const char* data, int len, int rv); | 90 void AssertWriteReturns(const char* data, int len, int rv); |
91 void AssertWriteLength(int len); | 91 void AssertWriteLength(int len); |
92 void AssertAsyncWriteWithReadsSucceeds(const char* data, int len, | 92 void AssertAsyncWriteWithReadsSucceeds(const char* data, int len, |
93 int num_reads); | 93 int num_reads); |
94 | 94 |
95 void AddAuthToCache() { | 95 void AddAuthToCache() { |
96 const base::string16 kFoo(ASCIIToUTF16("foo")); | 96 const base::string16 kFoo(base::ASCIIToUTF16("foo")); |
97 const base::string16 kBar(ASCIIToUTF16("bar")); | 97 const base::string16 kBar(base::ASCIIToUTF16("bar")); |
98 session_->http_auth_cache()->Add(GURL(kProxyUrl), | 98 session_->http_auth_cache()->Add(GURL(kProxyUrl), |
99 "MyRealm1", | 99 "MyRealm1", |
100 HttpAuth::AUTH_SCHEME_BASIC, | 100 HttpAuth::AUTH_SCHEME_BASIC, |
101 "Basic realm=MyRealm1", | 101 "Basic realm=MyRealm1", |
102 AuthCredentials(kFoo, kBar), | 102 AuthCredentials(kFoo, kBar), |
103 "/"); | 103 "/"); |
104 } | 104 } |
105 | 105 |
106 void Run(int steps) { | 106 void Run(int steps) { |
107 data_->StopAfter(steps); | 107 data_->StopAfter(steps); |
(...skipping 1319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1427 write_buf.get(), write_buf->size(), write_callback_.callback())); | 1427 write_buf.get(), write_buf->size(), write_callback_.callback())); |
1428 | 1428 |
1429 Run(1); | 1429 Run(1); |
1430 | 1430 |
1431 EXPECT_FALSE(sock_.get()); | 1431 EXPECT_FALSE(sock_.get()); |
1432 EXPECT_TRUE(read_callback.have_result()); | 1432 EXPECT_TRUE(read_callback.have_result()); |
1433 EXPECT_FALSE(write_callback_.have_result()); | 1433 EXPECT_FALSE(write_callback_.have_result()); |
1434 } | 1434 } |
1435 | 1435 |
1436 } // namespace net | 1436 } // namespace net |
OLD | NEW |