| 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 <string> | 5 #include <string> |
| 6 | 6 |
| 7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 585 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 596 BoundNetLog())); | 596 BoundNetLog())); |
| 597 auth_handler_factory_->AddMockHandler(mock_auth, HttpAuth::AUTH_SERVER); | 597 auth_handler_factory_->AddMockHandler(mock_auth, HttpAuth::AUTH_SERVER); |
| 598 | 598 |
| 599 HttpNetworkTransaction transaction(DEFAULT_PRIORITY, session_.get()); | 599 HttpNetworkTransaction transaction(DEFAULT_PRIORITY, session_.get()); |
| 600 EXPECT_EQ(ERR_IO_PENDING, | 600 EXPECT_EQ(ERR_IO_PENDING, |
| 601 transaction.Start(GetRequestInfo("one.html"), | 601 transaction.Start(GetRequestInfo("one.html"), |
| 602 callback_.callback(), | 602 callback_.callback(), |
| 603 BoundNetLog())); | 603 BoundNetLog())); |
| 604 EXPECT_EQ(OK, callback_.WaitForResult()); | 604 EXPECT_EQ(OK, callback_.WaitForResult()); |
| 605 | 605 |
| 606 AuthCredentials credentials(ASCIIToUTF16("user"), ASCIIToUTF16("pass")); | 606 AuthCredentials credentials(base::ASCIIToUTF16("user"), |
| 607 base::ASCIIToUTF16("pass")); |
| 607 EXPECT_EQ(OK, transaction.RestartWithAuth(credentials, callback_.callback())); | 608 EXPECT_EQ(OK, transaction.RestartWithAuth(credentials, callback_.callback())); |
| 608 | 609 |
| 609 ExpectResponse("one.html", transaction, SYNCHRONOUS); | 610 ExpectResponse("one.html", transaction, SYNCHRONOUS); |
| 610 } | 611 } |
| 611 | 612 |
| 612 TEST_F(HttpPipelinedNetworkTransactionTest, OldVersionDisablesPipelining) { | 613 TEST_F(HttpPipelinedNetworkTransactionTest, OldVersionDisablesPipelining) { |
| 613 Initialize(false); | 614 Initialize(false); |
| 614 | 615 |
| 615 MockWrite writes[] = { | 616 MockWrite writes[] = { |
| 616 MockWrite(SYNCHRONOUS, 0, "GET /pipelined.html HTTP/1.1\r\n" | 617 MockWrite(SYNCHRONOUS, 0, "GET /pipelined.html HTTP/1.1\r\n" |
| (...skipping 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1026 EXPECT_EQ(ERR_PIPELINE_EVICTION, two_callback.WaitForResult()); | 1027 EXPECT_EQ(ERR_PIPELINE_EVICTION, two_callback.WaitForResult()); |
| 1027 two_transaction.reset(); | 1028 two_transaction.reset(); |
| 1028 EXPECT_EQ(ERR_PIPELINE_EVICTION, three_callback.WaitForResult()); | 1029 EXPECT_EQ(ERR_PIPELINE_EVICTION, three_callback.WaitForResult()); |
| 1029 three_transaction.reset(); | 1030 three_transaction.reset(); |
| 1030 EXPECT_EQ(ERR_PIPELINE_EVICTION, four_callback.WaitForResult()); | 1031 EXPECT_EQ(ERR_PIPELINE_EVICTION, four_callback.WaitForResult()); |
| 1031 } | 1032 } |
| 1032 | 1033 |
| 1033 } // anonymous namespace | 1034 } // anonymous namespace |
| 1034 | 1035 |
| 1035 } // namespace net | 1036 } // namespace net |
| OLD | NEW |