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

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

Issue 14697023: downloads: Improve download rate estimation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Comment typo Created 7 years, 7 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 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 7b53c4dbd27f567c39fa0ee8fa4dab71d33b9ee8..1d5a25d9f03f0adcf5fee42ad4371b2341110015 100644
--- a/content/browser/download/base_file_unittest.cc
+++ b/content/browser/download/base_file_unittest.cc
@@ -612,46 +612,6 @@ TEST_F(BaseFileTest, IsEmptyHash) {
EXPECT_FALSE(BaseFile::IsEmptyHash(std::string()));
}
-// Test that calculating speed after no writes.
-TEST_F(BaseFileTest, SpeedWithoutWrite) {
- ASSERT_TRUE(InitializeFile());
- base::TimeTicks current = StartTick() + kElapsedTimeDelta;
- ASSERT_EQ(0, CurrentSpeedAtTime(current));
- base_file_->Finish();
-}
-
-// Test that calculating speed after a single write.
-TEST_F(BaseFileTest, SpeedAfterSingleWrite) {
- ASSERT_TRUE(InitializeFile());
- ASSERT_TRUE(AppendDataToFile(kTestData1));
- base::TimeTicks current = StartTick() + kElapsedTimeDelta;
- int64 expected_speed = kTestDataLength1 / kElapsedTimeSeconds;
- ASSERT_EQ(expected_speed, CurrentSpeedAtTime(current));
- base_file_->Finish();
-}
-
-// Test that calculating speed after a multiple writes.
-TEST_F(BaseFileTest, SpeedAfterMultipleWrite) {
- ASSERT_TRUE(InitializeFile());
- ASSERT_TRUE(AppendDataToFile(kTestData1));
- ASSERT_TRUE(AppendDataToFile(kTestData2));
- ASSERT_TRUE(AppendDataToFile(kTestData3));
- ASSERT_TRUE(AppendDataToFile(kTestData4));
- base::TimeTicks current = StartTick() + kElapsedTimeDelta;
- int64 expected_speed = (kTestDataLength1 + kTestDataLength2 +
- kTestDataLength3 + kTestDataLength4) / kElapsedTimeSeconds;
- ASSERT_EQ(expected_speed, CurrentSpeedAtTime(current));
- base_file_->Finish();
-}
-
-// Test that calculating speed after no delay - should not divide by 0.
-TEST_F(BaseFileTest, SpeedAfterNoElapsedTime) {
- ASSERT_TRUE(InitializeFile());
- ASSERT_TRUE(AppendDataToFile(kTestData1));
- ASSERT_EQ(0, CurrentSpeedAtTime(StartTick()));
- base_file_->Finish();
-}
-
// Test that a temporary file is created in the default download directory.
TEST_F(BaseFileTest, CreatedInDefaultDirectory) {
ASSERT_TRUE(base_file_->full_path().empty());

Powered by Google App Engine
This is Rietveld 408576698