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

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

Issue 2321453002: c/browser, c/common, components S-W: Change ScopedTempDir::path() to GetPath() (Closed)
Patch Set: Just rebased Created 4 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_feedback_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_service.h" 5 #include "chrome/browser/safe_browsing/download_feedback_service.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
140 140
141 void SetUp() override { 141 void SetUp() override {
142 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 142 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
143 DownloadFeedback::RegisterFactory(&download_feedback_factory_); 143 DownloadFeedback::RegisterFactory(&download_feedback_factory_);
144 } 144 }
145 145
146 void TearDown() override { DownloadFeedback::RegisterFactory(nullptr); } 146 void TearDown() override { DownloadFeedback::RegisterFactory(nullptr); }
147 147
148 base::FilePath CreateTestFile(int n) const { 148 base::FilePath CreateTestFile(int n) const {
149 base::FilePath upload_file_path( 149 base::FilePath upload_file_path(
150 temp_dir_.path().AppendASCII("test file " + base::IntToString(n))); 150 temp_dir_.GetPath().AppendASCII("test file " + base::IntToString(n)));
151 const std::string upload_file_data = "data"; 151 const std::string upload_file_data = "data";
152 int wrote = base::WriteFile( 152 int wrote = base::WriteFile(
153 upload_file_path, upload_file_data.data(), upload_file_data.size()); 153 upload_file_path, upload_file_data.data(), upload_file_data.size());
154 EXPECT_EQ(static_cast<int>(upload_file_data.size()), wrote); 154 EXPECT_EQ(static_cast<int>(upload_file_data.size()), wrote);
155 return upload_file_path; 155 return upload_file_path;
156 } 156 }
157 157
158 FakeDownloadFeedback* feedback(size_t n) const { 158 FakeDownloadFeedback* feedback(size_t n) const {
159 return download_feedback_factory_.feedback(n); 159 return download_feedback_factory_.feedback(n);
160 } 160 }
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
367 // was deleted. 367 // was deleted.
368 EXPECT_FALSE(base::PathExists(file_path[2])); 368 EXPECT_FALSE(base::PathExists(file_path[2]));
369 369
370 // These files should still exist since the FakeDownloadFeedback does not 370 // These files should still exist since the FakeDownloadFeedback does not
371 // delete them. 371 // delete them.
372 EXPECT_TRUE(base::PathExists(file_path[0])); 372 EXPECT_TRUE(base::PathExists(file_path[0]));
373 EXPECT_TRUE(base::PathExists(file_path[1])); 373 EXPECT_TRUE(base::PathExists(file_path[1]));
374 } 374 }
375 375
376 } // namespace safe_browsing 376 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/safe_browsing/download_feedback_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698