Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: chrome/browser/extensions/api/downloads/downloads_api_browsertest.cc

Issue 319703002: Add mime type information to the download database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix DownloadUIController_HistoryDownload test failure Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 GetOnRecordManager()->GetAllDownloads(items); 415 GetOnRecordManager()->GetAllDownloads(items);
416 CHECK_EQ(0, static_cast<int>(items->size())); 416 CHECK_EQ(0, static_cast<int>(items->size()));
417 std::vector<GURL> url_chain; 417 std::vector<GURL> url_chain;
418 url_chain.push_back(GURL()); 418 url_chain.push_back(GURL());
419 for (size_t i = 0; i < count; ++i) { 419 for (size_t i = 0; i < count; ++i) {
420 DownloadItem* item = GetOnRecordManager()->CreateDownloadItem( 420 DownloadItem* item = GetOnRecordManager()->CreateDownloadItem(
421 content::DownloadItem::kInvalidId + 1 + i, 421 content::DownloadItem::kInvalidId + 1 + i,
422 downloads_directory().Append(history_info[i].filename), 422 downloads_directory().Append(history_info[i].filename),
423 downloads_directory().Append(history_info[i].filename), 423 downloads_directory().Append(history_info[i].filename),
424 url_chain, GURL(), // URL Chain, referrer 424 url_chain, GURL(), // URL Chain, referrer
425 std::string(), std::string(), // mime_type, original_mime_type
425 current, current, // start_time, end_time 426 current, current, // start_time, end_time
426 std::string(), std::string(), // etag, last_modified 427 std::string(), std::string(), // etag, last_modified
427 1, 1, // received_bytes, total_bytes 428 1, 1, // received_bytes, total_bytes
428 history_info[i].state, // state 429 history_info[i].state, // state
429 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS, 430 content::DOWNLOAD_DANGER_TYPE_NOT_DANGEROUS,
430 content::DOWNLOAD_INTERRUPT_REASON_NONE, 431 content::DOWNLOAD_INTERRUPT_REASON_NONE,
431 false); // opened 432 false); // opened
432 items->push_back(item); 433 items->push_back(item);
433 } 434 }
434 435
(...skipping 3657 matching lines...) Expand 10 before | Expand all | Expand 10 after
4092 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); 4093 EXPECT_EQ(downloads::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action);
4093 EXPECT_FALSE(warnings.empty()); 4094 EXPECT_FALSE(warnings.empty());
4094 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict, 4095 EXPECT_EQ(ExtensionWarning::kDownloadFilenameConflict,
4095 warnings.begin()->warning_type()); 4096 warnings.begin()->warning_type());
4096 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); 4097 EXPECT_EQ("incumbent", warnings.begin()->extension_id());
4097 } 4098 }
4098 4099
4099 } // namespace extensions 4100 } // namespace extensions
4100 4101
4101 #endif // http://crbug.com/3061144 4102 #endif // http://crbug.com/3061144
OLDNEW
« no previous file with comments | « chrome/browser/download/download_ui_controller_unittest.cc ('k') | chrome/browser/history/download_database.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698