| 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 // This file contains download browser tests that are known to be runnable | 5 // This file contains download browser tests that are known to be runnable |
| 6 // in a pure content context. Over time tests should be migrated here. | 6 // in a pure content context. Over time tests should be migrated here. |
| 7 | 7 |
| 8 #include <stddef.h> | 8 #include <stddef.h> |
| 9 #include <stdint.h> | 9 #include <stdint.h> |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 1053 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1064 EXPECT_EQ(parameters.etag, value); | 1064 EXPECT_EQ(parameters.etag, value); |
| 1065 | 1065 |
| 1066 ASSERT_TRUE(requests[1].request_headers.GetHeader( | 1066 ASSERT_TRUE(requests[1].request_headers.GetHeader( |
| 1067 net::HttpRequestHeaders::kRange, &value)); | 1067 net::HttpRequestHeaders::kRange, &value)); |
| 1068 EXPECT_EQ(base::StringPrintf("bytes=%" PRId64 "-", interruption.offset), | 1068 EXPECT_EQ(base::StringPrintf("bytes=%" PRId64 "-", interruption.offset), |
| 1069 value); | 1069 value); |
| 1070 } | 1070 } |
| 1071 | 1071 |
| 1072 // Resumption should only attempt to contact the final URL if the download has a | 1072 // Resumption should only attempt to contact the final URL if the download has a |
| 1073 // URL chain. | 1073 // URL chain. |
| 1074 IN_PROC_BROWSER_TEST_F(DownloadContentTest, RedirectBeforeResume) { | 1074 IN_PROC_BROWSER_TEST_F(DownloadContentTest, DISABLED_RedirectBeforeResume) { |
| 1075 TestDownloadRequestHandler request_handler_1( | 1075 TestDownloadRequestHandler request_handler_1( |
| 1076 GURL("http://example.com/first-url")); | 1076 GURL("http://example.com/first-url")); |
| 1077 request_handler_1.StartServingStaticResponse( | 1077 request_handler_1.StartServingStaticResponse( |
| 1078 "HTTP/1.1 302 Redirect\r\n" | 1078 "HTTP/1.1 302 Redirect\r\n" |
| 1079 "Location: http://example.com/second-url\r\n" | 1079 "Location: http://example.com/second-url\r\n" |
| 1080 "\r\n"); | 1080 "\r\n"); |
| 1081 | 1081 |
| 1082 TestDownloadRequestHandler request_handler_2( | 1082 TestDownloadRequestHandler request_handler_2( |
| 1083 GURL("http://example.com/second-url")); | 1083 GURL("http://example.com/second-url")); |
| 1084 request_handler_2.StartServingStaticResponse( | 1084 request_handler_2.StartServingStaticResponse( |
| (...skipping 1369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2454 | 2454 |
| 2455 std::vector<DownloadItem*> downloads; | 2455 std::vector<DownloadItem*> downloads; |
| 2456 DownloadManagerForShell(shell())->GetAllDownloads(&downloads); | 2456 DownloadManagerForShell(shell())->GetAllDownloads(&downloads); |
| 2457 ASSERT_EQ(1u, downloads.size()); | 2457 ASSERT_EQ(1u, downloads.size()); |
| 2458 | 2458 |
| 2459 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"), | 2459 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"), |
| 2460 downloads[0]->GetTargetFilePath().BaseName().value()); | 2460 downloads[0]->GetTargetFilePath().BaseName().value()); |
| 2461 } | 2461 } |
| 2462 | 2462 |
| 2463 } // namespace content | 2463 } // namespace content |
| OLD | NEW |