| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/memory/scoped_temp_dir.h" | |
| 7 #include "base/message_loop.h" | 6 #include "base/message_loop.h" |
| 7 #include "base/scoped_temp_dir.h" |
| 8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
| 9 #include "chrome/browser/download/base_file.h" | 9 #include "chrome/browser/download/base_file.h" |
| 10 #include "content/browser/browser_thread.h" | 10 #include "content/browser/browser_thread.h" |
| 11 #include "net/base/file_stream.h" | 11 #include "net/base/file_stream.h" |
| 12 #include "testing/gtest/include/gtest/gtest.h" | 12 #include "testing/gtest/include/gtest/gtest.h" |
| 13 | 13 |
| 14 namespace { | 14 namespace { |
| 15 | 15 |
| 16 const char kTestData1[] = "Let's write some data to the file!\n"; | 16 const char kTestData1[] = "Let's write some data to the file!\n"; |
| 17 const char kTestData2[] = "Writing more data.\n"; | 17 const char kTestData2[] = "Writing more data.\n"; |
| (...skipping 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 221 EXPECT_TRUE(base_file_->Rename(new_path)); | 221 EXPECT_TRUE(base_file_->Rename(new_path)); |
| 222 EXPECT_FALSE(file_util::PathExists(initial_path)); | 222 EXPECT_FALSE(file_util::PathExists(initial_path)); |
| 223 EXPECT_TRUE(file_util::PathExists(new_path)); | 223 EXPECT_TRUE(file_util::PathExists(new_path)); |
| 224 | 224 |
| 225 AppendDataToFile(kTestData2); | 225 AppendDataToFile(kTestData2); |
| 226 | 226 |
| 227 base_file_->Finish(); | 227 base_file_->Finish(); |
| 228 } | 228 } |
| 229 | 229 |
| 230 } // namespace | 230 } // namespace |
| OLD | NEW |