| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_network_transaction.h" | 5 #include "net/http/http_network_transaction.h" |
| 6 | 6 |
| 7 #include <math.h> // ceil | 7 #include <math.h> // ceil |
| 8 #include <stdarg.h> | 8 #include <stdarg.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1824 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1835 const char* const kStatusLines[] = { | 1835 const char* const kStatusLines[] = { |
| 1836 "HTTP/1.1 204 No Content", | 1836 "HTTP/1.1 204 No Content", |
| 1837 "HTTP/1.1 205 Reset Content", | 1837 "HTTP/1.1 205 Reset Content", |
| 1838 "HTTP/1.1 304 Not Modified", | 1838 "HTTP/1.1 304 Not Modified", |
| 1839 "HTTP/1.1 302 Found", | 1839 "HTTP/1.1 302 Found", |
| 1840 "HTTP/1.1 302 Found", | 1840 "HTTP/1.1 302 Found", |
| 1841 "HTTP/1.1 301 Moved Permanently", | 1841 "HTTP/1.1 301 Moved Permanently", |
| 1842 "HTTP/1.1 301 Moved Permanently", | 1842 "HTTP/1.1 301 Moved Permanently", |
| 1843 }; | 1843 }; |
| 1844 | 1844 |
| 1845 COMPILE_ASSERT(kNumUnreadBodies == arraysize(kStatusLines), | 1845 static_assert(kNumUnreadBodies == arraysize(kStatusLines), |
| 1846 forgot_to_update_kStatusLines); | 1846 "forgot to update kStatusLines"); |
| 1847 | 1847 |
| 1848 for (int i = 0; i < kNumUnreadBodies; ++i) | 1848 for (int i = 0; i < kNumUnreadBodies; ++i) |
| 1849 EXPECT_EQ(kStatusLines[i], response_lines[i]); | 1849 EXPECT_EQ(kStatusLines[i], response_lines[i]); |
| 1850 | 1850 |
| 1851 TestCompletionCallback callback; | 1851 TestCompletionCallback callback; |
| 1852 scoped_ptr<HttpTransaction> trans( | 1852 scoped_ptr<HttpTransaction> trans( |
| 1853 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); | 1853 new HttpNetworkTransaction(DEFAULT_PRIORITY, session.get())); |
| 1854 int rv = trans->Start(&request, callback.callback(), BoundNetLog()); | 1854 int rv = trans->Start(&request, callback.callback(), BoundNetLog()); |
| 1855 EXPECT_EQ(ERR_IO_PENDING, rv); | 1855 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 1856 rv = callback.WaitForResult(); | 1856 rv = callback.WaitForResult(); |
| (...skipping 11328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 13185 EXPECT_EQ(ERR_IO_PENDING, rv); | 13185 EXPECT_EQ(ERR_IO_PENDING, rv); |
| 13186 | 13186 |
| 13187 rv = callback.WaitForResult(); | 13187 rv = callback.WaitForResult(); |
| 13188 EXPECT_EQ(ERR_CONNECTION_RESET, rv); | 13188 EXPECT_EQ(ERR_CONNECTION_RESET, rv); |
| 13189 | 13189 |
| 13190 const HttpResponseInfo* response = trans->GetResponseInfo(); | 13190 const HttpResponseInfo* response = trans->GetResponseInfo(); |
| 13191 EXPECT_TRUE(response == NULL); | 13191 EXPECT_TRUE(response == NULL); |
| 13192 } | 13192 } |
| 13193 | 13193 |
| 13194 } // namespace net | 13194 } // namespace net |
| OLD | NEW |