Chromium Code Reviews| 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 = |
|
not at google - send to devlin
2012/08/06 05:04:56
should be kFilesAndDirs
Haruki Sato
2012/08/06 23:22:18
Good catch. I will follow up with another CL.
| |
| 139 static_cast<file_util::FileEnumerator::FileType>( | |
| 140 file_util::FileEnumerator::DIRECTORIES | | 139 file_util::FileEnumerator::DIRECTORIES | |
| 141 file_util::FileEnumerator::FILES); | 140 file_util::FileEnumerator::FILES; |
|
jar (doing other things)
2012/08/06 18:27:02
nit: push either line 140 or 139 onto the end of 1
Haruki Sato
2012/08/06 23:22:18
Done.
| |
| 142 | 141 |
| 143 file_util::FileEnumerator temp_iterator( | 142 file_util::FileEnumerator temp_iterator( |
| 144 temp_path_, | 143 temp_path_, |
| 145 true, // recursive | 144 true, // recursive |
| 146 files_and_dirs | 145 files_and_dirs |
| 147 ); | 146 ); |
| 148 int items_not_removed = 0; | 147 int items_not_removed = 0; |
| 149 FilePath item_in_temp; | 148 FilePath item_in_temp; |
| 150 item_in_temp = temp_iterator.Next(); | 149 item_in_temp = temp_iterator.Next(); |
| 151 while (!item_in_temp.value().empty()) { | 150 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. | 215 // Check that there is newer _locales/en_US/messages.json file. |
| 217 base::PlatformFileInfo new_info; | 216 base::PlatformFileInfo new_info; |
| 218 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 217 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
| 219 | 218 |
| 220 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 219 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
| 221 | 220 |
| 222 ASSERT_TRUE(TempFilesRemoved()); | 221 ASSERT_TRUE(TempFilesRemoved()); |
| 223 } | 222 } |
| 224 | 223 |
| 225 } // namespace extensions | 224 } // namespace extensions |
| OLD | NEW |