| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shlobj.h> | 9 #include <shlobj.h> |
| 10 #endif | 10 #endif |
| (...skipping 991 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1002 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); | 1002 path = path.Append(FILE_PATH_LITERAL("url_request_unittest")); |
| 1003 | 1003 |
| 1004 TestDelegate d; | 1004 TestDelegate d; |
| 1005 URLRequest req( | 1005 URLRequest req( |
| 1006 FilePathToFileURL(path), DEFAULT_PRIORITY, &d, &default_context_); | 1006 FilePathToFileURL(path), DEFAULT_PRIORITY, &d, &default_context_); |
| 1007 req.Start(); | 1007 req.Start(); |
| 1008 base::RunLoop().Run(); | 1008 base::RunLoop().Run(); |
| 1009 | 1009 |
| 1010 // Generate entry for the sentinel file. | 1010 // Generate entry for the sentinel file. |
| 1011 base::FilePath sentinel_path = path.AppendASCII(sentinel_name); | 1011 base::FilePath sentinel_path = path.AppendASCII(sentinel_name); |
| 1012 base::PlatformFileInfo info; | 1012 base::File::Info info; |
| 1013 EXPECT_TRUE(base::GetFileInfo(sentinel_path, &info)); | 1013 EXPECT_TRUE(base::GetFileInfo(sentinel_path, &info)); |
| 1014 EXPECT_GT(info.size, 0); | 1014 EXPECT_GT(info.size, 0); |
| 1015 std::string sentinel_output = GetDirectoryListingEntry( | 1015 std::string sentinel_output = GetDirectoryListingEntry( |
| 1016 base::string16(sentinel_name, sentinel_name + strlen(sentinel_name)), | 1016 base::string16(sentinel_name, sentinel_name + strlen(sentinel_name)), |
| 1017 std::string(sentinel_name), | 1017 std::string(sentinel_name), |
| 1018 false /* is_dir */, | 1018 false /* is_dir */, |
| 1019 info.size, | 1019 info.size, |
| 1020 info.last_modified); | 1020 info.last_modified); |
| 1021 | 1021 |
| 1022 ASSERT_LT(0, d.bytes_received()); | 1022 ASSERT_LT(0, d.bytes_received()); |
| (...skipping 6458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 7481 | 7481 |
| 7482 EXPECT_FALSE(r.is_pending()); | 7482 EXPECT_FALSE(r.is_pending()); |
| 7483 EXPECT_EQ(1, d->response_started_count()); | 7483 EXPECT_EQ(1, d->response_started_count()); |
| 7484 EXPECT_FALSE(d->received_data_before_response()); | 7484 EXPECT_FALSE(d->received_data_before_response()); |
| 7485 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); | 7485 EXPECT_EQ(d->bytes_received(), static_cast<int>(file_size)); |
| 7486 } | 7486 } |
| 7487 } | 7487 } |
| 7488 #endif // !defined(DISABLE_FTP_SUPPORT) | 7488 #endif // !defined(DISABLE_FTP_SUPPORT) |
| 7489 | 7489 |
| 7490 } // namespace net | 7490 } // namespace net |
| OLD | NEW |