| 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 1839 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1850 int64 file_size = 0; | 1850 int64 file_size = 0; |
| 1851 file_util::GetFileSize(app_path, &file_size); | 1851 file_util::GetFileSize(app_path, &file_size); |
| 1852 | 1852 |
| 1853 EXPECT_FALSE(r.is_pending()); | 1853 EXPECT_FALSE(r.is_pending()); |
| 1854 EXPECT_EQ(1, d.response_started_count()); | 1854 EXPECT_EQ(1, d.response_started_count()); |
| 1855 EXPECT_FALSE(d.received_data_before_response()); | 1855 EXPECT_FALSE(d.received_data_before_response()); |
| 1856 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); | 1856 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); |
| 1857 } | 1857 } |
| 1858 } | 1858 } |
| 1859 | 1859 |
| 1860 // Needs more work, tracked in http://crbug.com/18036. | 1860 TEST_F(URLRequestTest, FTPCheckWrongPassword) { |
| 1861 TEST_F(URLRequestTest, DISABLED_FTPCheckWrongPassword) { | |
| 1862 scoped_refptr<FTPTestServer> server = | 1861 scoped_refptr<FTPTestServer> server = |
| 1863 FTPTestServer::CreateServer(L"", "chrome", "wrong_password"); | 1862 FTPTestServer::CreateServer(L"", "chrome", "wrong_password"); |
| 1864 ASSERT_TRUE(NULL != server.get()); | 1863 ASSERT_TRUE(NULL != server.get()); |
| 1865 FilePath app_path; | 1864 FilePath app_path; |
| 1866 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); | 1865 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); |
| 1867 app_path = app_path.AppendASCII("LICENSE"); | 1866 app_path = app_path.AppendASCII("LICENSE"); |
| 1868 TestDelegate d; | 1867 TestDelegate d; |
| 1869 { | 1868 { |
| 1870 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); | 1869 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); |
| 1871 r.Start(); | 1870 r.Start(); |
| 1872 EXPECT_TRUE(r.is_pending()); | 1871 EXPECT_TRUE(r.is_pending()); |
| 1873 | 1872 |
| 1874 MessageLoop::current()->Run(); | 1873 MessageLoop::current()->Run(); |
| 1875 | 1874 |
| 1876 int64 file_size = 0; | 1875 int64 file_size = 0; |
| 1877 file_util::GetFileSize(app_path, &file_size); | 1876 file_util::GetFileSize(app_path, &file_size); |
| 1878 | 1877 |
| 1879 EXPECT_FALSE(r.is_pending()); | 1878 EXPECT_FALSE(r.is_pending()); |
| 1880 EXPECT_EQ(1, d.response_started_count()); | 1879 EXPECT_EQ(1, d.response_started_count()); |
| 1881 EXPECT_FALSE(d.received_data_before_response()); | 1880 EXPECT_FALSE(d.received_data_before_response()); |
| 1882 EXPECT_EQ(d.bytes_received(), 0); | 1881 EXPECT_EQ(d.bytes_received(), 0); |
| 1883 } | 1882 } |
| 1884 } | 1883 } |
| 1885 | 1884 |
| 1886 // Needs more work, tracked in http://crbug.com/18036. | 1885 TEST_F(URLRequestTest, FTPCheckWrongUser) { |
| 1887 TEST_F(URLRequestTest, DISABLED_FTPCheckWrongUser) { | |
| 1888 scoped_refptr<FTPTestServer> server = | 1886 scoped_refptr<FTPTestServer> server = |
| 1889 FTPTestServer::CreateServer(L"", "wrong_user", "chrome"); | 1887 FTPTestServer::CreateServer(L"", "wrong_user", "chrome"); |
| 1890 ASSERT_TRUE(NULL != server.get()); | 1888 ASSERT_TRUE(NULL != server.get()); |
| 1891 FilePath app_path; | 1889 FilePath app_path; |
| 1892 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); | 1890 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); |
| 1893 app_path = app_path.AppendASCII("LICENSE"); | 1891 app_path = app_path.AppendASCII("LICENSE"); |
| 1894 TestDelegate d; | 1892 TestDelegate d; |
| 1895 { | 1893 { |
| 1896 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); | 1894 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); |
| 1897 r.Start(); | 1895 r.Start(); |
| 1898 EXPECT_TRUE(r.is_pending()); | 1896 EXPECT_TRUE(r.is_pending()); |
| 1899 | 1897 |
| 1900 MessageLoop::current()->Run(); | 1898 MessageLoop::current()->Run(); |
| 1901 | 1899 |
| 1902 int64 file_size = 0; | 1900 int64 file_size = 0; |
| 1903 file_util::GetFileSize(app_path, &file_size); | 1901 file_util::GetFileSize(app_path, &file_size); |
| 1904 | 1902 |
| 1905 EXPECT_FALSE(r.is_pending()); | 1903 EXPECT_FALSE(r.is_pending()); |
| 1906 EXPECT_EQ(1, d.response_started_count()); | 1904 EXPECT_EQ(1, d.response_started_count()); |
| 1907 EXPECT_FALSE(d.received_data_before_response()); | 1905 EXPECT_FALSE(d.received_data_before_response()); |
| 1908 EXPECT_EQ(d.bytes_received(), 0); | 1906 EXPECT_EQ(d.bytes_received(), 0); |
| 1909 } | 1907 } |
| 1910 } | 1908 } |
| OLD | NEW |