Chromium Code Reviews| Index: chrome/browser/download/download_history_unittest.cc |
| diff --git a/chrome/browser/download/download_history_unittest.cc b/chrome/browser/download/download_history_unittest.cc |
| index 0316883af53315d071c2e778266ce085da25f2e0..607ffa2eaa3f1463d99d5272f1c1a296ebd5d53e 100644 |
| --- a/chrome/browser/download/download_history_unittest.cc |
| +++ b/chrome/browser/download/download_history_unittest.cc |
| @@ -2,7 +2,6 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include <set> |
| #include <vector> |
| #include "base/rand_util.h" |
| @@ -42,6 +41,8 @@ void CheckInfoEqual(const history::DownloadRow& left, |
| EXPECT_EQ(left.url_chain[i].spec(), right.url_chain[i].spec()); |
| } |
| EXPECT_EQ(left.referrer_url.spec(), right.referrer_url.spec()); |
| + EXPECT_EQ(left.mime_type, right.mime_type); |
| + EXPECT_EQ(left.original_mime_type, right.original_mime_type); |
| EXPECT_EQ(left.start_time.ToTimeT(), right.start_time.ToTimeT()); |
| EXPECT_EQ(left.end_time.ToTimeT(), right.end_time.ToTimeT()); |
| EXPECT_EQ(left.etag, right.etag); |
| @@ -243,6 +244,8 @@ class DownloadHistoryTest : public testing::Test { |
| infos->at(index).target_path, |
| infos->at(index).url_chain, |
| infos->at(index).referrer_url, |
| + infos->at(index).mime_type, |
| + infos->at(index).original_mime_type, |
| infos->at(index).start_time, |
| infos->at(index).end_time, |
| infos->at(index).etag, |
| @@ -340,6 +343,8 @@ class DownloadHistoryTest : public testing::Test { |
| base::FilePath(path), |
| url_chain, |
| referrer, |
| + "application/octet-stream", |
| + "application/octet-stream", |
| (base::Time::Now() - base::TimeDelta::FromMinutes(10)), |
| (base::Time::Now() - base::TimeDelta::FromMinutes(1)), |
| "Etag", |
| @@ -361,6 +366,8 @@ class DownloadHistoryTest : public testing::Test { |
| const base::FilePath& target_path, |
| const std::vector<GURL>& url_chain, |
| const GURL& referrer, |
| + const std::string& mime_type, |
| + const std::string& original_mime_type, |
| const base::Time& start_time, |
| const base::Time& end_time, |
| const std::string& etag, |
| @@ -384,6 +391,8 @@ class DownloadHistoryTest : public testing::Test { |
| info->target_path = target_path; |
| info->url_chain = url_chain; |
| info->referrer_url = referrer; |
| + info->mime_type = mime_type; |
| + info->original_mime_type = original_mime_type; |
| info->start_time = start_time; |
| info->end_time = end_time; |
| info->etag = etag; |
| @@ -408,8 +417,9 @@ class DownloadHistoryTest : public testing::Test { |
| .WillRepeatedly(ReturnRefOfCopy(url_chain[0])); |
| EXPECT_CALL(item(index), GetUrlChain()) |
| .WillRepeatedly(ReturnRefOfCopy(url_chain)); |
| - EXPECT_CALL(item(index), GetMimeType()) |
| - .WillRepeatedly(Return("application/octet-stream")); |
| + EXPECT_CALL(item(index), GetMimeType()).WillRepeatedly(Return(mime_type)); |
| + EXPECT_CALL(item(index), GetOriginalMimeType()).WillRepeatedly(Return( |
| + original_mime_type)); |
| EXPECT_CALL(item(index), GetReferrerUrl()) |
| .WillRepeatedly(ReturnRefOfCopy(referrer)); |
| EXPECT_CALL(item(index), GetStartTime()).WillRepeatedly(Return(start_time)); |
| @@ -463,7 +473,7 @@ class DownloadHistoryTest : public testing::Test { |
| DISALLOW_COPY_AND_ASSIGN(DownloadHistoryTest); |
| }; |
| -} // anonymous namespace |
| +} // anonymous namespace |
|
Randy Smith (Not in Mondays)
2013/12/17 18:48:58
very nit: I'm not completely clear why, but I beli
|
| // Test loading an item from the database, changing it, saving it back, removing |
| // it. |