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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1932 EXPECT_EQ(file.value(), item->GetTargetFilePath().BaseName().value()); | 1932 EXPECT_EQ(file.value(), item->GetTargetFilePath().BaseName().value()); |
1933 EXPECT_EQ(download_url, item->GetURL()); | 1933 EXPECT_EQ(download_url, item->GetURL()); |
1934 // The following are set by download-test1.lib.mock-http-headers. | 1934 // The following are set by download-test1.lib.mock-http-headers. |
1935 std::string etag = item->GetETag(); | 1935 std::string etag = item->GetETag(); |
1936 base::TrimWhitespaceASCII(etag, base::TRIM_ALL, &etag); | 1936 base::TrimWhitespaceASCII(etag, base::TRIM_ALL, &etag); |
1937 EXPECT_EQ("abracadabra", etag); | 1937 EXPECT_EQ("abracadabra", etag); |
1938 | 1938 |
1939 std::string last_modified = item->GetLastModifiedTime(); | 1939 std::string last_modified = item->GetLastModifiedTime(); |
1940 base::TrimWhitespaceASCII(last_modified, base::TRIM_ALL, &last_modified); | 1940 base::TrimWhitespaceASCII(last_modified, base::TRIM_ALL, &last_modified); |
1941 EXPECT_EQ("Mon, 13 Nov 2006 20:31:09 GMT", last_modified); | 1941 EXPECT_EQ("Mon, 13 Nov 2006 20:31:09 GMT", last_modified); |
| 1942 |
| 1943 // Downloads that were restored from history shouldn't cause the download |
| 1944 // shelf to be displayed. |
| 1945 EXPECT_FALSE(browser()->window()->IsDownloadShelfVisible()); |
1942 } | 1946 } |
1943 | 1947 |
1944 // Test for crbug.com/14505. This tests that chrome:// urls are still functional | 1948 // Test for crbug.com/14505. This tests that chrome:// urls are still functional |
1945 // after download of a file while viewing another chrome://. | 1949 // after download of a file while viewing another chrome://. |
1946 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { | 1950 IN_PROC_BROWSER_TEST_F(DownloadTest, ChromeURLAfterDownload) { |
1947 base::FilePath file(FILE_PATH_LITERAL("download-test1.lib")); | 1951 base::FilePath file(FILE_PATH_LITERAL("download-test1.lib")); |
1948 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file)); | 1952 GURL download_url(URLRequestMockHTTPJob::GetMockUrl(file)); |
1949 GURL flags_url(chrome::kChromeUIFlagsURL); | 1953 GURL flags_url(chrome::kChromeUIFlagsURL); |
1950 GURL extensions_url(chrome::kChromeUIExtensionsFrameURL); | 1954 GURL extensions_url(chrome::kChromeUIExtensionsFrameURL); |
1951 | 1955 |
(...skipping 1267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3219 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_GZipWithNoContent) { | 3223 IN_PROC_BROWSER_TEST_F(DownloadTest, DownloadTest_GZipWithNoContent) { |
3220 ASSERT_TRUE(test_server()->Start()); | 3224 ASSERT_TRUE(test_server()->Start()); |
3221 GURL url(test_server()->GetURL("files/downloads/empty.bin")); | 3225 GURL url(test_server()->GetURL("files/downloads/empty.bin")); |
3222 // Downloading the same URL twice causes the second request to be served from | 3226 // Downloading the same URL twice causes the second request to be served from |
3223 // cached (with a high probability). This test verifies that that doesn't | 3227 // cached (with a high probability). This test verifies that that doesn't |
3224 // happen regardless of whether the request is served via the cache or from | 3228 // happen regardless of whether the request is served via the cache or from |
3225 // the network. | 3229 // the network. |
3226 DownloadAndWait(browser(), url); | 3230 DownloadAndWait(browser(), url); |
3227 DownloadAndWait(browser(), url); | 3231 DownloadAndWait(browser(), url); |
3228 } | 3232 } |
OLD | NEW |