| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/message_loop.h" | 7 #include "base/message_loop.h" |
| 8 #include "base/path_service.h" | 8 #include "base/path_service.h" |
| 9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
| 10 #include "base/scoped_temp_dir.h" | 10 #include "base/scoped_temp_dir.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 *unpacker_->parsed_manifest()); | 128 *unpacker_->parsed_manifest()); |
| 129 } | 129 } |
| 130 | 130 |
| 131 FilePath GetInstallPath() { | 131 FilePath GetInstallPath() { |
| 132 return temp_dir_.path().AppendASCII( | 132 return temp_dir_.path().AppendASCII( |
| 133 extension_filenames::kTempExtensionName); | 133 extension_filenames::kTempExtensionName); |
| 134 } | 134 } |
| 135 | 135 |
| 136 bool TempFilesRemoved() { | 136 bool TempFilesRemoved() { |
| 137 // Check that temporary files were cleaned up. | 137 // Check that temporary files were cleaned up. |
| 138 file_util::FileEnumerator::FileType files_and_dirs = | 138 int files_and_dirs = file_util::FileEnumerator::DIRECTORIES | |
| 139 static_cast<file_util::FileEnumerator::FileType>( | 139 file_util::FileEnumerator::FILES; |
| 140 file_util::FileEnumerator::DIRECTORIES | | |
| 141 file_util::FileEnumerator::FILES); | |
| 142 | 140 |
| 143 file_util::FileEnumerator temp_iterator( | 141 file_util::FileEnumerator temp_iterator( |
| 144 temp_path_, | 142 temp_path_, |
| 145 true, // recursive | 143 true, // recursive |
| 146 files_and_dirs | 144 files_and_dirs |
| 147 ); | 145 ); |
| 148 int items_not_removed = 0; | 146 int items_not_removed = 0; |
| 149 FilePath item_in_temp; | 147 FilePath item_in_temp; |
| 150 item_in_temp = temp_iterator.Next(); | 148 item_in_temp = temp_iterator.Next(); |
| 151 while (!item_in_temp.value().empty()) { | 149 while (!item_in_temp.value().empty()) { |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 // Check that there is newer _locales/en_US/messages.json file. | 214 // Check that there is newer _locales/en_US/messages.json file. |
| 217 base::PlatformFileInfo new_info; | 215 base::PlatformFileInfo new_info; |
| 218 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 216 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
| 219 | 217 |
| 220 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 218 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
| 221 | 219 |
| 222 ASSERT_TRUE(TempFilesRemoved()); | 220 ASSERT_TRUE(TempFilesRemoved()); |
| 223 } | 221 } |
| 224 | 222 |
| 225 } // namespace extensions | 223 } // namespace extensions |
| OLD | NEW |