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

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

Issue 102683004: Add mime type information to the download database (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review fixes Created 7 years 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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 std::string(), std::string(), // 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 3191 matching lines...) Expand 10 before | Expand all | Expand 10 after
3631 EXPECT_EQ("suggester", winner_id); 3632 EXPECT_EQ("suggester", winner_id);
3632 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value()); 3633 EXPECT_EQ(FILE_PATH_LITERAL("b"), filename.value());
3633 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action); 3634 EXPECT_EQ(api::FILENAME_CONFLICT_ACTION_PROMPT, conflict_action);
3634 EXPECT_FALSE(warnings.empty()); 3635 EXPECT_FALSE(warnings.empty());
3635 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict, 3636 EXPECT_EQ(extensions::ExtensionWarning::kDownloadFilenameConflict,
3636 warnings.begin()->warning_type()); 3637 warnings.begin()->warning_type());
3637 EXPECT_EQ("incumbent", warnings.begin()->extension_id()); 3638 EXPECT_EQ("incumbent", warnings.begin()->extension_id());
3638 } 3639 }
3639 3640
3640 #endif // http://crbug.com/3061144 3641 #endif // http://crbug.com/3061144
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698