| 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 1805 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1816 const int kIntermediateSize = 1331; | 1816 const int kIntermediateSize = 1331; |
| 1817 url_chain.push_back(request_handler.url()); | 1817 url_chain.push_back(request_handler.url()); |
| 1818 | 1818 |
| 1819 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 1819 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 1820 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 1820 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 1821 1, | 1821 1, |
| 1822 intermediate_file_path, | 1822 intermediate_file_path, |
| 1823 base::FilePath(), | 1823 base::FilePath(), |
| 1824 url_chain, | 1824 url_chain, |
| 1825 GURL(), | 1825 GURL(), |
| 1826 GURL(), |
| 1827 GURL(), |
| 1826 "application/octet-stream", | 1828 "application/octet-stream", |
| 1827 "application/octet-stream", | 1829 "application/octet-stream", |
| 1828 base::Time::Now(), | 1830 base::Time::Now(), |
| 1829 base::Time(), | 1831 base::Time(), |
| 1830 parameters.etag, | 1832 parameters.etag, |
| 1831 std::string(), | 1833 std::string(), |
| 1832 kIntermediateSize, | 1834 kIntermediateSize, |
| 1833 parameters.size, | 1835 parameters.size, |
| 1834 std::string(), | 1836 std::string(), |
| 1835 DownloadItem::INTERRUPTED, | 1837 DownloadItem::INTERRUPTED, |
| (...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1888 | 1890 |
| 1889 url_chain.push_back(request_handler.url()); | 1891 url_chain.push_back(request_handler.url()); |
| 1890 | 1892 |
| 1891 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 1893 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 1892 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 1894 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 1893 1, | 1895 1, |
| 1894 intermediate_file_path, | 1896 intermediate_file_path, |
| 1895 base::FilePath(), | 1897 base::FilePath(), |
| 1896 url_chain, | 1898 url_chain, |
| 1897 GURL(), | 1899 GURL(), |
| 1900 GURL(), |
| 1901 GURL(), |
| 1898 "application/octet-stream", | 1902 "application/octet-stream", |
| 1899 "application/octet-stream", | 1903 "application/octet-stream", |
| 1900 base::Time::Now(), | 1904 base::Time::Now(), |
| 1901 base::Time(), | 1905 base::Time(), |
| 1902 parameters.etag, | 1906 parameters.etag, |
| 1903 std::string(), | 1907 std::string(), |
| 1904 kIntermediateSize, | 1908 kIntermediateSize, |
| 1905 parameters.size, | 1909 parameters.size, |
| 1906 std::string(), | 1910 std::string(), |
| 1907 DownloadItem::INTERRUPTED, | 1911 DownloadItem::INTERRUPTED, |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1947 | 1951 |
| 1948 url_chain.push_back(request_handler.url()); | 1952 url_chain.push_back(request_handler.url()); |
| 1949 | 1953 |
| 1950 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 1954 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 1951 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 1955 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 1952 1, | 1956 1, |
| 1953 intermediate_file_path, | 1957 intermediate_file_path, |
| 1954 base::FilePath(), | 1958 base::FilePath(), |
| 1955 url_chain, | 1959 url_chain, |
| 1956 GURL(), | 1960 GURL(), |
| 1961 GURL(), |
| 1962 GURL(), |
| 1957 "application/octet-stream", | 1963 "application/octet-stream", |
| 1958 "application/octet-stream", | 1964 "application/octet-stream", |
| 1959 base::Time::Now(), | 1965 base::Time::Now(), |
| 1960 base::Time(), | 1966 base::Time(), |
| 1961 "fake-etag", | 1967 "fake-etag", |
| 1962 std::string(), | 1968 std::string(), |
| 1963 kIntermediateSize, | 1969 kIntermediateSize, |
| 1964 parameters.size, | 1970 parameters.size, |
| 1965 std::string(), | 1971 std::string(), |
| 1966 DownloadItem::INTERRUPTED, | 1972 DownloadItem::INTERRUPTED, |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2011 | 2017 |
| 2012 url_chain.push_back(request_handler.url()); | 2018 url_chain.push_back(request_handler.url()); |
| 2013 | 2019 |
| 2014 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 2020 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 2015 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 2021 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 2016 1, | 2022 1, |
| 2017 intermediate_file_path, | 2023 intermediate_file_path, |
| 2018 base::FilePath(), | 2024 base::FilePath(), |
| 2019 url_chain, | 2025 url_chain, |
| 2020 GURL(), | 2026 GURL(), |
| 2027 GURL(), |
| 2028 GURL(), |
| 2021 "application/octet-stream", | 2029 "application/octet-stream", |
| 2022 "application/octet-stream", | 2030 "application/octet-stream", |
| 2023 base::Time::Now(), | 2031 base::Time::Now(), |
| 2024 base::Time(), | 2032 base::Time(), |
| 2025 parameters.etag, | 2033 parameters.etag, |
| 2026 std::string(), | 2034 std::string(), |
| 2027 kIntermediateSize, | 2035 kIntermediateSize, |
| 2028 parameters.size, | 2036 parameters.size, |
| 2029 std::string(std::begin(kPartialHash), std::end(kPartialHash)), | 2037 std::string(std::begin(kPartialHash), std::end(kPartialHash)), |
| 2030 DownloadItem::INTERRUPTED, | 2038 DownloadItem::INTERRUPTED, |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2081 | 2089 |
| 2082 url_chain.push_back(request_handler.url()); | 2090 url_chain.push_back(request_handler.url()); |
| 2083 | 2091 |
| 2084 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 2092 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 2085 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 2093 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 2086 1, | 2094 1, |
| 2087 intermediate_file_path, | 2095 intermediate_file_path, |
| 2088 base::FilePath(), | 2096 base::FilePath(), |
| 2089 url_chain, | 2097 url_chain, |
| 2090 GURL(), | 2098 GURL(), |
| 2099 GURL(), |
| 2100 GURL(), |
| 2091 "application/octet-stream", | 2101 "application/octet-stream", |
| 2092 "application/octet-stream", | 2102 "application/octet-stream", |
| 2093 base::Time::Now(), | 2103 base::Time::Now(), |
| 2094 base::Time(), | 2104 base::Time(), |
| 2095 parameters.etag, | 2105 parameters.etag, |
| 2096 std::string(), | 2106 std::string(), |
| 2097 kIntermediateSize, | 2107 kIntermediateSize, |
| 2098 parameters.size, | 2108 parameters.size, |
| 2099 std::string(std::begin(kPartialHash), std::end(kPartialHash)), | 2109 std::string(std::begin(kPartialHash), std::end(kPartialHash)), |
| 2100 DownloadItem::INTERRUPTED, | 2110 DownloadItem::INTERRUPTED, |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2160 base::WriteFile(intermediate_file_path, buffer.data(), buffer.size())); | 2170 base::WriteFile(intermediate_file_path, buffer.data(), buffer.size())); |
| 2161 url_chain.push_back(request_handler.url()); | 2171 url_chain.push_back(request_handler.url()); |
| 2162 | 2172 |
| 2163 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( | 2173 DownloadItem* download = DownloadManagerForShell(shell())->CreateDownloadItem( |
| 2164 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", | 2174 "F7FB1F59-7DE1-4845-AFDB-8A688F70F583", |
| 2165 1, | 2175 1, |
| 2166 intermediate_file_path, | 2176 intermediate_file_path, |
| 2167 base::FilePath(), | 2177 base::FilePath(), |
| 2168 url_chain, | 2178 url_chain, |
| 2169 GURL(), | 2179 GURL(), |
| 2180 GURL(), |
| 2181 GURL(), |
| 2170 "application/octet-stream", | 2182 "application/octet-stream", |
| 2171 "application/octet-stream", | 2183 "application/octet-stream", |
| 2172 base::Time::Now(), | 2184 base::Time::Now(), |
| 2173 base::Time(), | 2185 base::Time(), |
| 2174 parameters.etag, | 2186 parameters.etag, |
| 2175 std::string(), | 2187 std::string(), |
| 2176 kIntermediateSize, | 2188 kIntermediateSize, |
| 2177 parameters.size, | 2189 parameters.size, |
| 2178 std::string(), | 2190 std::string(), |
| 2179 DownloadItem::INTERRUPTED, | 2191 DownloadItem::INTERRUPTED, |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2457 | 2469 |
| 2458 std::vector<DownloadItem*> downloads; | 2470 std::vector<DownloadItem*> downloads; |
| 2459 DownloadManagerForShell(shell())->GetAllDownloads(&downloads); | 2471 DownloadManagerForShell(shell())->GetAllDownloads(&downloads); |
| 2460 ASSERT_EQ(1u, downloads.size()); | 2472 ASSERT_EQ(1u, downloads.size()); |
| 2461 | 2473 |
| 2462 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"), | 2474 EXPECT_EQ(FILE_PATH_LITERAL("Jumboshrimp.txt"), |
| 2463 downloads[0]->GetTargetFilePath().BaseName().value()); | 2475 downloads[0]->GetTargetFilePath().BaseName().value()); |
| 2464 } | 2476 } |
| 2465 | 2477 |
| 2466 } // namespace content | 2478 } // namespace content |
| OLD | NEW |