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

Unified Diff: content/browser/download/base_file_unittest.cc

Issue 8404049: Added member data to classes to support download resumption. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged with trunk. Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: content/browser/download/base_file_unittest.cc
diff --git a/content/browser/download/base_file_unittest.cc b/content/browser/download/base_file_unittest.cc
index 6d6edc74e1d6efb113358ba0c520ff1c8056ddf8..eda97dac7d1f07b0fcf9cf3cb3d0665c346f7154 100644
--- a/content/browser/download/base_file_unittest.cc
+++ b/content/browser/download/base_file_unittest.cc
@@ -251,8 +251,12 @@ TEST_F(BaseFileTest, MultipleWrites) {
// Write data to the file once and calculate its sha256 hash.
TEST_F(BaseFileTest, SingleWriteWithHash) {
+ std::string partial_hash;
ASSERT_EQ(net::OK, base_file_->Initialize(true));
+ // Can get partial hashes before Finish() is called.
+ EXPECT_TRUE(base_file_->GetSha256Hash(&partial_hash));
ASSERT_EQ(net::OK, AppendDataToFile(kTestData1));
+ EXPECT_TRUE(base_file_->GetSha256Hash(&partial_hash));
base_file_->Finish();
std::string hash;
@@ -269,8 +273,6 @@ TEST_F(BaseFileTest, MultipleWritesWithHash) {
ASSERT_EQ(net::OK, AppendDataToFile(kTestData1));
ASSERT_EQ(net::OK, AppendDataToFile(kTestData2));
ASSERT_EQ(net::OK, AppendDataToFile(kTestData3));
- // no hash before Finish() is called either.
- EXPECT_FALSE(base_file_->GetSha256Hash(&hash));
base_file_->Finish();
EXPECT_TRUE(base_file_->GetSha256Hash(&hash));

Powered by Google App Engine
This is Rietveld 408576698