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

Side by Side Diff: chrome/browser/safe_browsing/download_feedback_unittest.cc

Issue 657373004: Standardize usage of virtual/override/final in chrome/browser/safe_browsing/ (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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "chrome/browser/safe_browsing/download_feedback.h" 5 #include "chrome/browser/safe_browsing/download_feedback.h"
6 6
7 #include "base/files/file_util.h" 7 #include "base/files/file_util.h"
8 #include "base/files/scoped_temp_dir.h" 8 #include "base/files/scoped_temp_dir.h"
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/run_loop.h" 10 #include "base/run_loop.h"
(...skipping 11 matching lines...) Expand all
22 22
23 class FakeUploader : public TwoPhaseUploader { 23 class FakeUploader : public TwoPhaseUploader {
24 public: 24 public:
25 FakeUploader(net::URLRequestContextGetter* url_request_context_getter, 25 FakeUploader(net::URLRequestContextGetter* url_request_context_getter,
26 base::TaskRunner* file_task_runner, 26 base::TaskRunner* file_task_runner,
27 const GURL& base_url, 27 const GURL& base_url,
28 const std::string& metadata, 28 const std::string& metadata,
29 const base::FilePath& file_path, 29 const base::FilePath& file_path,
30 const ProgressCallback& progress_callback, 30 const ProgressCallback& progress_callback,
31 const FinishCallback& finish_callback); 31 const FinishCallback& finish_callback);
32 virtual ~FakeUploader() {} 32 ~FakeUploader() override {}
33 33
34 virtual void Start() override { 34 void Start() override { start_called_ = true; }
35 start_called_ = true;
36 }
37 35
38 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_; 36 scoped_refptr<net::URLRequestContextGetter> url_request_context_getter_;
39 scoped_refptr<base::TaskRunner> file_task_runner_; 37 scoped_refptr<base::TaskRunner> file_task_runner_;
40 GURL base_url_; 38 GURL base_url_;
41 std::string metadata_; 39 std::string metadata_;
42 base::FilePath file_path_; 40 base::FilePath file_path_;
43 ProgressCallback progress_callback_; 41 ProgressCallback progress_callback_;
44 FinishCallback finish_callback_; 42 FinishCallback finish_callback_;
45 43
46 bool start_called_; 44 bool start_called_;
(...skipping 13 matching lines...) Expand all
60 metadata_(metadata), 58 metadata_(metadata),
61 file_path_(file_path), 59 file_path_(file_path),
62 progress_callback_(progress_callback), 60 progress_callback_(progress_callback),
63 finish_callback_(finish_callback), 61 finish_callback_(finish_callback),
64 start_called_(false) { 62 start_called_(false) {
65 } 63 }
66 64
67 class FakeUploaderFactory : public TwoPhaseUploaderFactory { 65 class FakeUploaderFactory : public TwoPhaseUploaderFactory {
68 public: 66 public:
69 FakeUploaderFactory() : uploader_(NULL) {} 67 FakeUploaderFactory() : uploader_(NULL) {}
70 virtual ~FakeUploaderFactory() {} 68 ~FakeUploaderFactory() override {}
71 69
72 virtual TwoPhaseUploader* CreateTwoPhaseUploader( 70 TwoPhaseUploader* CreateTwoPhaseUploader(
73 net::URLRequestContextGetter* url_request_context_getter, 71 net::URLRequestContextGetter* url_request_context_getter,
74 base::TaskRunner* file_task_runner, 72 base::TaskRunner* file_task_runner,
75 const GURL& base_url, 73 const GURL& base_url,
76 const std::string& metadata, 74 const std::string& metadata,
77 const base::FilePath& file_path, 75 const base::FilePath& file_path,
78 const TwoPhaseUploader::ProgressCallback& progress_callback, 76 const TwoPhaseUploader::ProgressCallback& progress_callback,
79 const TwoPhaseUploader::FinishCallback& finish_callback) override; 77 const TwoPhaseUploader::FinishCallback& finish_callback) override;
80 78
81 FakeUploader* uploader_; 79 FakeUploader* uploader_;
82 }; 80 };
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 EXPECT_TRUE(base::PathExists(upload_file_path_)); 225 EXPECT_TRUE(base::PathExists(upload_file_path_));
228 226
229 delete feedback; 227 delete feedback;
230 EXPECT_FALSE(feedback_finish_called_); 228 EXPECT_FALSE(feedback_finish_called_);
231 229
232 base::RunLoop().RunUntilIdle(); 230 base::RunLoop().RunUntilIdle();
233 EXPECT_FALSE(base::PathExists(upload_file_path_)); 231 EXPECT_FALSE(base::PathExists(upload_file_path_));
234 } 232 }
235 233
236 } // namespace safe_browsing 234 } // namespace safe_browsing
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698