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 "base/file_util.h" | 5 #include "base/file_util.h" |
6 #include "base/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/run_loop.h" | 7 #include "base/run_loop.h" |
8 #include "chrome/utility/image_writer/error_messages.h" | 8 #include "chrome/utility/image_writer/error_messages.h" |
9 #include "chrome/utility/image_writer/image_writer.h" | 9 #include "chrome/utility/image_writer/image_writer.h" |
10 #include "chrome/utility/image_writer/image_writer_handler.h" | 10 #include "chrome/utility/image_writer/image_writer_handler.h" |
(...skipping 20 matching lines...) Expand all Loading... |
31 ASSERT_TRUE( | 31 ASSERT_TRUE( |
32 base::CreateTemporaryFileInDir(temp_dir_.path(), &device_path_)); | 32 base::CreateTemporaryFileInDir(temp_dir_.path(), &device_path_)); |
33 } | 33 } |
34 | 34 |
35 virtual void TearDown() OVERRIDE {} | 35 virtual void TearDown() OVERRIDE {} |
36 | 36 |
37 void FillFile(const base::FilePath& path, int pattern) { | 37 void FillFile(const base::FilePath& path, int pattern) { |
38 scoped_ptr<char[]> buffer(new char[kTestFileSize]); | 38 scoped_ptr<char[]> buffer(new char[kTestFileSize]); |
39 memset(buffer.get(), pattern, kTestFileSize); | 39 memset(buffer.get(), pattern, kTestFileSize); |
40 | 40 |
41 ASSERT_TRUE(file_util::WriteFile(path, buffer.get(), kTestFileSize)); | 41 ASSERT_TRUE(base::WriteFile(path, buffer.get(), kTestFileSize)); |
42 } | 42 } |
43 | 43 |
44 void FillDefault(const base::FilePath& path) { FillFile(path, kTestPattern); } | 44 void FillDefault(const base::FilePath& path) { FillFile(path, kTestPattern); } |
45 | 45 |
46 base::FilePath image_path_; | 46 base::FilePath image_path_; |
47 base::FilePath device_path_; | 47 base::FilePath device_path_; |
48 | 48 |
49 private: | 49 private: |
50 base::MessageLoop message_loop_; | 50 base::MessageLoop message_loop_; |
51 base::ScopedTempDir temp_dir_; | 51 base::ScopedTempDir temp_dir_; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 image_writer.Write(image_path_, device_path_); | 190 image_writer.Write(image_path_, device_path_); |
191 | 191 |
192 base::RunLoop().RunUntilIdle(); | 192 base::RunLoop().RunUntilIdle(); |
193 | 193 |
194 image_writer.Verify(image_path_, device_path_); | 194 image_writer.Verify(image_path_, device_path_); |
195 | 195 |
196 base::RunLoop().RunUntilIdle(); | 196 base::RunLoop().RunUntilIdle(); |
197 } | 197 } |
198 | 198 |
199 } // namespace image_writer | 199 } // namespace image_writer |
OLD | NEW |