OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |