| 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/http/http_proxy_client_socket_pool.h" | 5 #include "net/http/http_proxy_client_socket_pool.h" | 
| 6 | 6 | 
| 7 #include "base/callback.h" | 7 #include "base/callback.h" | 
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" | 
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" | 
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" | 
| (...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 289     MockRead(ASYNC, 4, "0123456789"), | 289     MockRead(ASYNC, 4, "0123456789"), | 
| 290   }; | 290   }; | 
| 291   scoped_ptr<SpdyFrame> req( | 291   scoped_ptr<SpdyFrame> req( | 
| 292       spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOW)); | 292       spdy_util_.ConstructSpdyConnect(NULL, 0, 1, LOW)); | 
| 293   scoped_ptr<SpdyFrame> rst( | 293   scoped_ptr<SpdyFrame> rst( | 
| 294       spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); | 294       spdy_util_.ConstructSpdyRstStream(1, RST_STREAM_CANCEL)); | 
| 295   MockWrite spdy_writes[] = { | 295   MockWrite spdy_writes[] = { | 
| 296     CreateMockWrite(*req, 0, ASYNC), | 296     CreateMockWrite(*req, 0, ASYNC), | 
| 297     CreateMockWrite(*rst, 2, ASYNC), | 297     CreateMockWrite(*rst, 2, ASYNC), | 
| 298   }; | 298   }; | 
| 299   const char* const kAuthChallenge[] = { | 299   SpdyHeaderBlock resp_block; | 
| 300     spdy_util_.GetStatusKey(), "407 Proxy Authentication Required", | 300   resp_block[spdy_util_.GetStatusKey()] = "407"; | 
| 301     spdy_util_.GetVersionKey(), "HTTP/1.1", | 301   resp_block["proxy-authenticate"] = "Basic realm=\"MyRealm1\""; | 
| 302     "proxy-authenticate", "Basic realm=\"MyRealm1\"", | 302   spdy_util_.MaybeAddVersionHeader(&resp_block); | 
| 303   }; | 303 | 
| 304   scoped_ptr<SpdyFrame> resp( | 304   scoped_ptr<SpdyFrame> resp(spdy_util_.ConstructSpdyReply(1, resp_block)); | 
| 305       spdy_util_.ConstructSpdyControlFrame(NULL, |  | 
| 306                                            0, |  | 
| 307                                            false, |  | 
| 308                                            1, |  | 
| 309                                            LOW, |  | 
| 310                                            SYN_REPLY, |  | 
| 311                                            CONTROL_FLAG_NONE, |  | 
| 312                                            kAuthChallenge, |  | 
| 313                                            arraysize(kAuthChallenge), |  | 
| 314                                            0)); |  | 
| 315   MockRead spdy_reads[] = { | 305   MockRead spdy_reads[] = { | 
| 316     CreateMockRead(*resp, 1, ASYNC), | 306     CreateMockRead(*resp, 1, ASYNC), | 
| 317     MockRead(ASYNC, 0, 3) | 307     MockRead(ASYNC, 0, 3) | 
| 318   }; | 308   }; | 
| 319 | 309 | 
| 320   Initialize(reads, arraysize(reads), writes, arraysize(writes), | 310   Initialize(reads, arraysize(reads), writes, arraysize(writes), | 
| 321              spdy_reads, arraysize(spdy_reads), spdy_writes, | 311              spdy_reads, arraysize(spdy_reads), spdy_writes, | 
| 322              arraysize(spdy_writes)); | 312              arraysize(spdy_writes)); | 
| 323 | 313 | 
| 324   data_->StopAfter(4); | 314   data_->StopAfter(4); | 
| (...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 722     EXPECT_TRUE(headers->IsRedirect(&location)); | 712     EXPECT_TRUE(headers->IsRedirect(&location)); | 
| 723     EXPECT_EQ(location, redirectTarget); | 713     EXPECT_EQ(location, redirectTarget); | 
| 724   } | 714   } | 
| 725 } | 715 } | 
| 726 | 716 | 
| 727 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 717 // It would be nice to also test the timeouts in HttpProxyClientSocketPool. | 
| 728 | 718 | 
| 729 }  // namespace | 719 }  // namespace | 
| 730 | 720 | 
| 731 }  // namespace net | 721 }  // namespace net | 
| OLD | NEW | 
|---|