| 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 420 GetOnRecordManager()->GetAllDownloads(items); | 420 GetOnRecordManager()->GetAllDownloads(items); |
| 421 CHECK_EQ(0, static_cast<int>(items->size())); | 421 CHECK_EQ(0, static_cast<int>(items->size())); |
| 422 std::vector<GURL> url_chain; | 422 std::vector<GURL> url_chain; |
| 423 url_chain.push_back(GURL()); | 423 url_chain.push_back(GURL()); |
| 424 for (size_t i = 0; i < count; ++i) { | 424 for (size_t i = 0; i < count; ++i) { |
| 425 DownloadItem* item = GetOnRecordManager()->CreateDownloadItem( | 425 DownloadItem* item = GetOnRecordManager()->CreateDownloadItem( |
| 426 content::DownloadItem::kInvalidId + 1 + i, | 426 content::DownloadItem::kInvalidId + 1 + i, |
| 427 downloads_directory().Append(history_info[i].filename), | 427 downloads_directory().Append(history_info[i].filename), |
| 428 downloads_directory().Append(history_info[i].filename), | 428 downloads_directory().Append(history_info[i].filename), |
| 429 url_chain, GURL(), // URL Chain, referrer | 429 url_chain, GURL(), // URL Chain, referrer |
| 430 "", "", // mime_type, original_mime_type |
| 430 current, current, // start_time, end_time | 431 current, current, // start_time, end_time |
| 431 std::string(), std::string(), // etag, last_modified | 432 std::string(), std::string(), // etag, last_modified |
| 432 1, 1, // received_bytes, total_bytes | 433 1, 1, // received_bytes, total_bytes |
| 433 history_info[i].state, // state | 434 history_info[i].state, // state |
| 434 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, | 435 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, |
| 435 content::DOWNLOAD_INTERRUPT_REASON_NONE, | 436 content::DOWNLOAD_INTERRUPT_REASON_NONE, |
| 436 false); // opened | 437 false); // opened |
| 437 items->push_back(item); | 438 items->push_back(item); |
| 438 } | 439 } |
| 439 | 440 |
| (...skipping 3184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3624 EXPECT_EQ("suggester", winner_id); | 3625 EXPECT_EQ("suggester", winner_id); |
| 3625 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); | 3626 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); |
| 3626 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); | 3627 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); |
| 3627 EXPECT_FALSE(warnings.empty()); | 3628 EXPECT_FALSE(warnings.empty()); |
| 3628 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, | 3629 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, |
| 3629 warnings.begin()->warning_type()); | 3630 warnings.begin()->warning_type()); |
| 3630 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); | 3631 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); |
| 3631 } | 3632 } |
| 3632 | 3633 |
| 3633 #endif // http://crbug.com/3061144 | 3634 #endif // http://crbug.com/3061144 |
| OLD | NEW |