| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/url_request/url_request_unittest.h" | 5 #include "net/url_request/url_request_unittest.h" |
| 6 | 6 |
| 7 #include "build/build_config.h" | 7 #include "build/build_config.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <windows.h> | 10 #include <windows.h> |
| (...skipping 1790 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1801 | 1801 |
| 1802 // Check the interceptor got called as expected | 1802 // Check the interceptor got called as expected |
| 1803 EXPECT_TRUE(interceptor.did_cancel_then_restart_main_); | 1803 EXPECT_TRUE(interceptor.did_cancel_then_restart_main_); |
| 1804 EXPECT_FALSE(interceptor.did_intercept_final_); | 1804 EXPECT_FALSE(interceptor.did_intercept_final_); |
| 1805 | 1805 |
| 1806 // Check we see a canceled request | 1806 // Check we see a canceled request |
| 1807 EXPECT_FALSE(req.status().is_success()); | 1807 EXPECT_FALSE(req.status().is_success()); |
| 1808 EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); | 1808 EXPECT_EQ(URLRequestStatus::CANCELED, req.status().status()); |
| 1809 } | 1809 } |
| 1810 | 1810 |
| 1811 TEST_F(URLRequestTest, FTPGetTestAnonymous) { | 1811 // Needs more work, tracked in http://crbug.com/18036. |
| 1812 TEST_F(URLRequestTest, DISABLED_FTPGetTestAnonymous) { |
| 1812 scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L""); | 1813 scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L""); |
| 1813 ASSERT_TRUE(NULL != server.get()); | 1814 ASSERT_TRUE(NULL != server.get()); |
| 1814 FilePath app_path; | 1815 FilePath app_path; |
| 1815 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); | 1816 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); |
| 1816 app_path = app_path.AppendASCII("LICENSE"); | 1817 app_path = app_path.AppendASCII("LICENSE"); |
| 1817 TestDelegate d; | 1818 TestDelegate d; |
| 1818 { | 1819 { |
| 1819 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); | 1820 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); |
| 1820 r.Start(); | 1821 r.Start(); |
| 1821 EXPECT_TRUE(r.is_pending()); | 1822 EXPECT_TRUE(r.is_pending()); |
| 1822 | 1823 |
| 1823 MessageLoop::current()->Run(); | 1824 MessageLoop::current()->Run(); |
| 1824 | 1825 |
| 1825 int64 file_size = 0; | 1826 int64 file_size = 0; |
| 1826 file_util::GetFileSize(app_path, &file_size); | 1827 file_util::GetFileSize(app_path, &file_size); |
| 1827 | 1828 |
| 1828 EXPECT_FALSE(r.is_pending()); | 1829 EXPECT_FALSE(r.is_pending()); |
| 1829 EXPECT_EQ(1, d.response_started_count()); | 1830 EXPECT_EQ(1, d.response_started_count()); |
| 1830 EXPECT_FALSE(d.received_data_before_response()); | 1831 EXPECT_FALSE(d.received_data_before_response()); |
| 1831 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); | 1832 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); |
| 1832 } | 1833 } |
| 1833 } | 1834 } |
| 1834 | 1835 |
| 1835 TEST_F(URLRequestTest, FTPGetTest) { | 1836 // Needs more work, tracked in http://crbug.com/18036. |
| 1837 TEST_F(URLRequestTest, DISABLED_FTPGetTest) { |
| 1836 scoped_refptr<FTPTestServer> server = | 1838 scoped_refptr<FTPTestServer> server = |
| 1837 FTPTestServer::CreateServer(L"", "chrome", "chrome"); | 1839 FTPTestServer::CreateServer(L"", "chrome", "chrome"); |
| 1838 ASSERT_TRUE(NULL != server.get()); | 1840 ASSERT_TRUE(NULL != server.get()); |
| 1839 FilePath app_path; | 1841 FilePath app_path; |
| 1840 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); | 1842 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); |
| 1841 app_path = app_path.AppendASCII("LICENSE"); | 1843 app_path = app_path.AppendASCII("LICENSE"); |
| 1842 TestDelegate d; | 1844 TestDelegate d; |
| 1843 { | 1845 { |
| 1844 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); | 1846 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); |
| 1845 r.Start(); | 1847 r.Start(); |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1901 | 1903 |
| 1902 int64 file_size = 0; | 1904 int64 file_size = 0; |
| 1903 file_util::GetFileSize(app_path, &file_size); | 1905 file_util::GetFileSize(app_path, &file_size); |
| 1904 | 1906 |
| 1905 EXPECT_FALSE(r.is_pending()); | 1907 EXPECT_FALSE(r.is_pending()); |
| 1906 EXPECT_EQ(1, d.response_started_count()); | 1908 EXPECT_EQ(1, d.response_started_count()); |
| 1907 EXPECT_FALSE(d.received_data_before_response()); | 1909 EXPECT_FALSE(d.received_data_before_response()); |
| 1908 EXPECT_EQ(d.bytes_received(), 0); | 1910 EXPECT_EQ(d.bytes_received(), 0); |
| 1909 } | 1911 } |
| 1910 } | 1912 } |
| OLD | NEW |