| 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 2275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2286 ASSERT_TRUE(WaitFor(downloads::OnChanged::kEventName, | 2286 ASSERT_TRUE(WaitFor(downloads::OnChanged::kEventName, |
| 2287 base::StringPrintf( | 2287 base::StringPrintf( |
| 2288 "[{\"id\": %d," | 2288 "[{\"id\": %d," |
| 2289 " \"error\": {\"current\":\"USER_CANCELED\"}," | 2289 " \"error\": {\"current\":\"USER_CANCELED\"}," |
| 2290 " \"state\": {" | 2290 " \"state\": {" |
| 2291 " \"previous\": \"in_progress\"," | 2291 " \"previous\": \"in_progress\"," |
| 2292 " \"current\": \"interrupted\"}}]", | 2292 " \"current\": \"interrupted\"}}]", |
| 2293 result_id))); | 2293 result_id))); |
| 2294 } | 2294 } |
| 2295 | 2295 |
| 2296 // flaky on mac: crbug.com/392288 |
| 2297 #if defined(OS_MACOSX) |
| 2298 #define MAYBE_DownloadExtensionTest_Download_FileSystemURL \ |
| 2299 DISABLED_DownloadExtensionTest_Download_FileSystemURL |
| 2300 #else |
| 2301 #define MAYBE_DownloadExtensionTest_Download_FileSystemURL \ |
| 2302 DownloadExtensionTest_Download_FileSystemURL |
| 2303 #endif |
| 2304 |
| 2296 // Test downloading filesystem: URLs. | 2305 // Test downloading filesystem: URLs. |
| 2297 // NOTE: chrome disallows creating HTML5 FileSystem Files in incognito. | 2306 // NOTE: chrome disallows creating HTML5 FileSystem Files in incognito. |
| 2298 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, | 2307 IN_PROC_BROWSER_TEST_F(DownloadExtensionTest, |
| 2299 DownloadExtensionTest_Download_FileSystemURL) { | 2308 MAYBE_DownloadExtensionTest_Download_FileSystemURL) { |
| 2300 static const char* kPayloadData = "on the record\ndata"; | 2309 static const char* kPayloadData = "on the record\ndata"; |
| 2301 GoOnTheRecord(); | 2310 GoOnTheRecord(); |
| 2302 LoadExtension("downloads_split"); | 2311 LoadExtension("downloads_split"); |
| 2303 | 2312 |
| 2304 const std::string download_url = "filesystem:" + GetExtensionURL() + | 2313 const std::string download_url = "filesystem:" + GetExtensionURL() + |
| 2305 "temporary/on_record.txt"; | 2314 "temporary/on_record.txt"; |
| 2306 | 2315 |
| 2307 // Setup a file in the filesystem which we can download. | 2316 // Setup a file in the filesystem which we can download. |
| 2308 ASSERT_TRUE(HTML5FileWriter::CreateFileForTesting( | 2317 ASSERT_TRUE(HTML5FileWriter::CreateFileForTesting( |
| 2309 BrowserContext::GetDefaultStoragePartition(browser()->profile())-> | 2318 BrowserContext::GetDefaultStoragePartition(browser()->profile())-> |
| (...skipping 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4093 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 4102 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 4094 EXPECT_FALSE(warnings.empty()); | 4103 EXPECT_FALSE(warnings.empty()); |
| 4095 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict, | 4104 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict, |
| 4096 warnings.begin()->warning_type()); | 4105 warnings.begin()->warning_type()); |
| 4097 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 4106 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 4098 } | 4107 } |
| 4099 | 4108 |
| 4100 } // namespace extensions | 4109 } // namespace extensions |
| 4101 | 4110 |
| 4102 #endif // http://crbug.com/3061144 | 4111 #endif // http://crbug.com/3061144 |
| OLD | NEW |