| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include <vector> | 6 #include <vector> |
| 7 | 7 |
| 8 #include "net/base/auth.h" | 8 #include "net/base/auth.h" |
| 9 #include "net/base/net_log_unittest.h" | 9 #include "net/base/net_log_unittest.h" |
| 10 #include "net/http/http_network_session_peer.h" | 10 #include "net/http/http_network_session_peer.h" |
| 11 #include "net/http/http_transaction_unittest.h" | 11 #include "net/http/http_transaction_unittest.h" |
| (...skipping 2233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2245 d.set_quit_on_redirect(true); | 2245 d.set_quit_on_redirect(true); |
| 2246 r.Start(); | 2246 r.Start(); |
| 2247 MessageLoop::current()->Run(); | 2247 MessageLoop::current()->Run(); |
| 2248 | 2248 |
| 2249 EXPECT_EQ(1, d.received_redirect_count()); | 2249 EXPECT_EQ(1, d.received_redirect_count()); |
| 2250 | 2250 |
| 2251 r.FollowDeferredRedirect(); | 2251 r.FollowDeferredRedirect(); |
| 2252 MessageLoop::current()->Run(); | 2252 MessageLoop::current()->Run(); |
| 2253 EXPECT_EQ(1, d.response_started_count()); | 2253 EXPECT_EQ(1, d.response_started_count()); |
| 2254 EXPECT_FALSE(d.received_data_before_response()); | 2254 EXPECT_FALSE(d.received_data_before_response()); |
| 2255 EXPECT_EQ(URLRequestStatus::SUCCESS, r.status().status()); | 2255 EXPECT_EQ(net::URLRequestStatus::SUCCESS, r.status().status()); |
| 2256 std::string contents("hello!"); | 2256 std::string contents("hello!"); |
| 2257 EXPECT_EQ(contents, d.data_received()); | 2257 EXPECT_EQ(contents, d.data_received()); |
| 2258 } | 2258 } |
| 2259 EXPECT_TRUE(data->at_read_eof()); | 2259 EXPECT_TRUE(data->at_read_eof()); |
| 2260 EXPECT_TRUE(data->at_write_eof()); | 2260 EXPECT_TRUE(data->at_write_eof()); |
| 2261 EXPECT_TRUE(data2->at_read_eof()); | 2261 EXPECT_TRUE(data2->at_read_eof()); |
| 2262 EXPECT_TRUE(data2->at_write_eof()); | 2262 EXPECT_TRUE(data2->at_write_eof()); |
| 2263 } | 2263 } |
| 2264 | 2264 |
| 2265 // Send a spdy request to www.google.com. Get a pushed stream that redirects to | 2265 // Send a spdy request to www.google.com. Get a pushed stream that redirects to |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2383 | 2383 |
| 2384 d2.set_quit_on_redirect(true); | 2384 d2.set_quit_on_redirect(true); |
| 2385 r2.Start(); | 2385 r2.Start(); |
| 2386 MessageLoop::current()->Run(); | 2386 MessageLoop::current()->Run(); |
| 2387 EXPECT_EQ(1, d2.received_redirect_count()); | 2387 EXPECT_EQ(1, d2.received_redirect_count()); |
| 2388 | 2388 |
| 2389 r2.FollowDeferredRedirect(); | 2389 r2.FollowDeferredRedirect(); |
| 2390 MessageLoop::current()->Run(); | 2390 MessageLoop::current()->Run(); |
| 2391 EXPECT_EQ(1, d2.response_started_count()); | 2391 EXPECT_EQ(1, d2.response_started_count()); |
| 2392 EXPECT_FALSE(d2.received_data_before_response()); | 2392 EXPECT_FALSE(d2.received_data_before_response()); |
| 2393 EXPECT_EQ(URLRequestStatus::SUCCESS, r2.status().status()); | 2393 EXPECT_EQ(net::URLRequestStatus::SUCCESS, r2.status().status()); |
| 2394 std::string contents2("hello!"); | 2394 std::string contents2("hello!"); |
| 2395 EXPECT_EQ(contents2, d2.data_received()); | 2395 EXPECT_EQ(contents2, d2.data_received()); |
| 2396 } | 2396 } |
| 2397 data->CompleteRead(); | 2397 data->CompleteRead(); |
| 2398 data2->CompleteRead(); | 2398 data2->CompleteRead(); |
| 2399 EXPECT_TRUE(data->at_read_eof()); | 2399 EXPECT_TRUE(data->at_read_eof()); |
| 2400 EXPECT_TRUE(data->at_write_eof()); | 2400 EXPECT_TRUE(data->at_write_eof()); |
| 2401 EXPECT_TRUE(data2->at_read_eof()); | 2401 EXPECT_TRUE(data2->at_read_eof()); |
| 2402 EXPECT_TRUE(data2->at_write_eof()); | 2402 EXPECT_TRUE(data2->at_write_eof()); |
| 2403 } | 2403 } |
| (...skipping 3002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5406 | 5406 |
| 5407 VerifyStreamsClosed(helper); | 5407 VerifyStreamsClosed(helper); |
| 5408 | 5408 |
| 5409 // Verify the SYN_REPLY. | 5409 // Verify the SYN_REPLY. |
| 5410 EXPECT_TRUE(response.headers != NULL); | 5410 EXPECT_TRUE(response.headers != NULL); |
| 5411 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); | 5411 EXPECT_EQ("HTTP/1.1 200 OK", response.headers->GetStatusLine()); |
| 5412 } | 5412 } |
| 5413 } | 5413 } |
| 5414 | 5414 |
| 5415 } // namespace net | 5415 } // namespace net |
| OLD | NEW |