Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1628)

Side by Side Diff: net/url_request/url_request_unittest.cc

Issue 160537: Correctly handle multiple control responses for RETR command. (Closed)
Patch Set: Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 // Needs more work, tracked in http://crbug.com/18036. 1811 TEST_F(URLRequestTest, FTPGetTestAnonymous) {
1812 TEST_F(URLRequestTest, DISABLED_FTPGetTestAnonymous) {
1813 scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L""); 1812 scoped_refptr<FTPTestServer> server = FTPTestServer::CreateServer(L"");
1814 ASSERT_TRUE(NULL != server.get()); 1813 ASSERT_TRUE(NULL != server.get());
1815 FilePath app_path; 1814 FilePath app_path;
1816 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); 1815 PathService::Get(base::DIR_SOURCE_ROOT, &app_path);
1817 app_path = app_path.AppendASCII("LICENSE"); 1816 app_path = app_path.AppendASCII("LICENSE");
1818 TestDelegate d; 1817 TestDelegate d;
1819 { 1818 {
1820 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); 1819 TestURLRequest r(server->TestServerPage("/LICENSE"), &d);
1821 r.Start(); 1820 r.Start();
1822 EXPECT_TRUE(r.is_pending()); 1821 EXPECT_TRUE(r.is_pending());
1823 1822
1824 MessageLoop::current()->Run(); 1823 MessageLoop::current()->Run();
1825 1824
1826 int64 file_size = 0; 1825 int64 file_size = 0;
1827 file_util::GetFileSize(app_path, &file_size); 1826 file_util::GetFileSize(app_path, &file_size);
1828 1827
1829 EXPECT_FALSE(r.is_pending()); 1828 EXPECT_FALSE(r.is_pending());
1830 EXPECT_EQ(1, d.response_started_count()); 1829 EXPECT_EQ(1, d.response_started_count());
1831 EXPECT_FALSE(d.received_data_before_response()); 1830 EXPECT_FALSE(d.received_data_before_response());
1832 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size)); 1831 EXPECT_EQ(d.bytes_received(), static_cast<int>(file_size));
1833 } 1832 }
1834 } 1833 }
1835 1834
1836 // Needs more work, tracked in http://crbug.com/18036. 1835 TEST_F(URLRequestTest, FTPGetTest) {
1837 TEST_F(URLRequestTest, DISABLED_FTPGetTest) {
1838 scoped_refptr<FTPTestServer> server = 1836 scoped_refptr<FTPTestServer> server =
1839 FTPTestServer::CreateServer(L"", "chrome", "chrome"); 1837 FTPTestServer::CreateServer(L"", "chrome", "chrome");
1840 ASSERT_TRUE(NULL != server.get()); 1838 ASSERT_TRUE(NULL != server.get());
1841 FilePath app_path; 1839 FilePath app_path;
1842 PathService::Get(base::DIR_SOURCE_ROOT, &app_path); 1840 PathService::Get(base::DIR_SOURCE_ROOT, &app_path);
1843 app_path = app_path.AppendASCII("LICENSE"); 1841 app_path = app_path.AppendASCII("LICENSE");
1844 TestDelegate d; 1842 TestDelegate d;
1845 { 1843 {
1846 TestURLRequest r(server->TestServerPage("/LICENSE"), &d); 1844 TestURLRequest r(server->TestServerPage("/LICENSE"), &d);
1847 r.Start(); 1845 r.Start();
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
1903 1901
1904 int64 file_size = 0; 1902 int64 file_size = 0;
1905 file_util::GetFileSize(app_path, &file_size); 1903 file_util::GetFileSize(app_path, &file_size);
1906 1904
1907 EXPECT_FALSE(r.is_pending()); 1905 EXPECT_FALSE(r.is_pending());
1908 EXPECT_EQ(1, d.response_started_count()); 1906 EXPECT_EQ(1, d.response_started_count());
1909 EXPECT_FALSE(d.received_data_before_response()); 1907 EXPECT_FALSE(d.received_data_before_response());
1910 EXPECT_EQ(d.bytes_received(), 0); 1908 EXPECT_EQ(d.bytes_received(), 0);
1911 } 1909 }
1912 } 1910 }
OLDNEW
« net/ftp/ftp_network_transaction.cc ('K') | « net/ftp/ftp_network_transaction_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698