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

Side by Side Diff: content/browser/download/download_file_unittest.cc

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 #include "base/files/file.h" 5 #include "base/files/file.h"
6 #include "base/files/file_util.h" 6 #include "base/files/file_util.h"
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/test/test_file_util.h" 10 #include "base/test/test_file_util.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 : DownloadFileImpl(save_info.Pass(), 80 : DownloadFileImpl(save_info.Pass(),
81 default_downloads_directory, 81 default_downloads_directory,
82 url, 82 url,
83 referrer_url, 83 referrer_url,
84 calculate_hash, 84 calculate_hash,
85 stream.Pass(), 85 stream.Pass(),
86 bound_net_log, 86 bound_net_log,
87 observer) {} 87 observer) {}
88 88
89 protected: 89 protected:
90 virtual base::TimeDelta GetRetryDelayForFailedRename( 90 base::TimeDelta GetRetryDelayForFailedRename(int attempt_count) override {
91 int attempt_count) override {
92 return base::TimeDelta::FromMilliseconds(0); 91 return base::TimeDelta::FromMilliseconds(0);
93 } 92 }
94 93
95 #if !defined(OS_WIN) 94 #if !defined(OS_WIN)
96 // On Posix, we don't encounter transient errors during renames, except 95 // On Posix, we don't encounter transient errors during renames, except
97 // possibly EAGAIN, which is difficult to replicate reliably. So we resort to 96 // possibly EAGAIN, which is difficult to replicate reliably. So we resort to
98 // simulating a transient error using ACCESS_DENIED instead. 97 // simulating a transient error using ACCESS_DENIED instead.
99 virtual bool ShouldRetryFailedRename( 98 bool ShouldRetryFailedRename(DownloadInterruptReason reason) override {
100 DownloadInterruptReason reason) override {
101 return reason == DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED; 99 return reason == DOWNLOAD_INTERRUPT_REASON_FILE_ACCESS_DENIED;
102 } 100 }
103 #endif 101 #endif
104 }; 102 };
105 103
106 } // namespace 104 } // namespace
107 105
108 class DownloadFileTest : public testing::Test { 106 class DownloadFileTest : public testing::Test {
109 public: 107 public:
110 108
(...skipping 674 matching lines...) Expand 10 before | Expand all | Expand 10 after
785 783
786 EXPECT_EQ(static_cast<int64>(strlen(kTestData1) + strlen(kTestData2)), 784 EXPECT_EQ(static_cast<int64>(strlen(kTestData1) + strlen(kTestData2)),
787 bytes_); 785 bytes_);
788 EXPECT_EQ(download_file_->GetHashState(), hash_state_); 786 EXPECT_EQ(download_file_->GetHashState(), hash_state_);
789 787
790 FinishStream(DOWNLOAD_INTERRUPT_REASON_NONE, true); 788 FinishStream(DOWNLOAD_INTERRUPT_REASON_NONE, true);
791 DestroyDownloadFile(0); 789 DestroyDownloadFile(0);
792 } 790 }
793 791
794 } // namespace content 792 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/download/download_file_impl.h ('k') | content/browser/download/download_item_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698