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

Side by Side Diff: chrome/utility/image_writer/image_writer_unittest.cc

Issue 1899083002: Convert //chrome from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 8 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <stdint.h> 5 #include <stdint.h>
6 #include <string.h> 6 #include <string.h>
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/file_util.h" 10 #include "base/files/file_util.h"
(...skipping 22 matching lines...) Expand all
33 void SetUp() override { 33 void SetUp() override {
34 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); 34 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir());
35 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &image_path_)); 35 ASSERT_TRUE(base::CreateTemporaryFileInDir(temp_dir_.path(), &image_path_));
36 ASSERT_TRUE( 36 ASSERT_TRUE(
37 base::CreateTemporaryFileInDir(temp_dir_.path(), &device_path_)); 37 base::CreateTemporaryFileInDir(temp_dir_.path(), &device_path_));
38 } 38 }
39 39
40 void TearDown() override {} 40 void TearDown() override {}
41 41
42 void FillFile(const base::FilePath& path, int pattern) { 42 void FillFile(const base::FilePath& path, int pattern) {
43 scoped_ptr<char[]> buffer(new char[kTestFileSize]); 43 std::unique_ptr<char[]> buffer(new char[kTestFileSize]);
44 memset(buffer.get(), pattern, kTestFileSize); 44 memset(buffer.get(), pattern, kTestFileSize);
45 45
46 ASSERT_TRUE(base::WriteFile(path, buffer.get(), kTestFileSize)); 46 ASSERT_TRUE(base::WriteFile(path, buffer.get(), kTestFileSize));
47 } 47 }
48 48
49 void FillDefault(const base::FilePath& path) { FillFile(path, kTestPattern); } 49 void FillDefault(const base::FilePath& path) { FillFile(path, kTestPattern); }
50 50
51 base::FilePath image_path_; 51 base::FilePath image_path_;
52 base::FilePath device_path_; 52 base::FilePath device_path_;
53 53
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 EXPECT_CALL(mock_handler, SendFailed(_)).Times(0); 224 EXPECT_CALL(mock_handler, SendFailed(_)).Times(0);
225 225
226 FillDefault(image_path_); 226 FillDefault(image_path_);
227 227
228 image_writer.Write(); 228 image_writer.Write();
229 229
230 base::RunLoop().RunUntilIdle(); 230 base::RunLoop().RunUntilIdle();
231 } 231 }
232 232
233 } // namespace image_writer 233 } // namespace image_writer
OLDNEW
« no previous file with comments | « chrome/utility/image_writer/image_writer_handler.h ('k') | chrome/utility/image_writer/image_writer_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698