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 // Disable everything on windows only. http://crbug.com/306144 | 5 // Disable everything on windows only. http://crbug.com/306144 |
6 #ifndef OS_WIN | 6 #ifndef OS_WIN |
7 | 7 |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
(...skipping 1960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1971 ASSERT_TRUE(result.get()); | 1971 ASSERT_TRUE(result.get()); |
1972 int result_id = -1; | 1972 int result_id = -1; |
1973 ASSERT_TRUE(result->GetAsInteger(&result_id)); | 1973 ASSERT_TRUE(result->GetAsInteger(&result_id)); |
1974 DownloadItem* item = GetCurrentManager()->GetDownload(result_id); | 1974 DownloadItem* item = GetCurrentManager()->GetDownload(result_id); |
1975 ASSERT_TRUE(item); | 1975 ASSERT_TRUE(item); |
1976 ScopedCancellingItem canceller(item); | 1976 ScopedCancellingItem canceller(item); |
1977 ASSERT_EQ(download_url, item->GetOriginalUrl().spec()); | 1977 ASSERT_EQ(download_url, item->GetOriginalUrl().spec()); |
1978 | 1978 |
1979 ASSERT_TRUE(WaitForInterruption( | 1979 ASSERT_TRUE(WaitForInterruption( |
1980 item, | 1980 item, |
1981 content::DOWNLOAD_INTERRUPT_REASON_SERVER_FAILED, | 1981 content::DOWNLOAD_INTERRUPT_REASON_SERVER_UNAUTHORIZED, |
1982 base::StringPrintf("[{\"danger\": \"safe\"," | 1982 base::StringPrintf("[{\"danger\": \"safe\"," |
1983 " \"incognito\": false," | 1983 " \"incognito\": false," |
1984 " \"mime\": \"text/html\"," | 1984 " \"mime\": \"text/html\"," |
1985 " \"paused\": false," | 1985 " \"paused\": false," |
1986 " \"url\": \"%s\"}]", | 1986 " \"url\": \"%s\"}]", |
1987 download_url.c_str()))); | 1987 download_url.c_str()))); |
1988 } | 1988 } |
1989 | 1989 |
1990 // Test that DownloadsDownloadFunction propagates |headers| to the URLRequest. | 1990 // Test that DownloadsDownloadFunction propagates |headers| to the URLRequest. |
1991 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, | 1991 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
(...skipping 2126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4118 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4118 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
4119 EXPECT_FALSE(warnings.empty()); | 4119 EXPECT_FALSE(warnings.empty()); |
4120 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict, | 4120 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict, |
4121 warnings.begin()->warning_type()); | 4121 warnings.begin()->warning_type()); |
4122 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4122 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
4123 } | 4123 } |
4124 | 4124 |
4125 } // namespace extensions | 4125 } // namespace extensions |
4126 | 4126 |
4127 #endif // http://crbug.com/3061144 | 4127 #endif // http://crbug.com/3061144 |
OLD | NEW |