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/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
7 #include "base/path_service.h" | 7 #include "base/path_service.h" |
8 #include "base/scoped_temp_dir.h" | 8 #include "base/scoped_temp_dir.h" |
9 #include "base/scoped_temp_dir.h" | 9 #include "base/scoped_temp_dir.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 *unpacker_->parsed_manifest()); | 120 *unpacker_->parsed_manifest()); |
121 } | 121 } |
122 | 122 |
123 FilePath GetInstallPath() { | 123 FilePath GetInstallPath() { |
124 return temp_dir_.path().AppendASCII( | 124 return temp_dir_.path().AppendASCII( |
125 extension_filenames::kTempExtensionName); | 125 extension_filenames::kTempExtensionName); |
126 } | 126 } |
127 | 127 |
128 bool TempFilesRemoved() { | 128 bool TempFilesRemoved() { |
129 // Check that temporary files were cleaned up. | 129 // Check that temporary files were cleaned up. |
130 file_util::FileEnumerator::FILE_TYPE files_and_dirs = | 130 file_util::FileEnumerator::FileType files_and_dirs = |
131 static_cast<file_util::FileEnumerator::FILE_TYPE>( | 131 static_cast<file_util::FileEnumerator::FileType>( |
132 file_util::FileEnumerator::DIRECTORIES | | 132 file_util::FileEnumerator::DIRECTORIES | |
133 file_util::FileEnumerator::FILES); | 133 file_util::FileEnumerator::FILES); |
134 | 134 |
135 file_util::FileEnumerator temp_iterator( | 135 file_util::FileEnumerator temp_iterator( |
136 temp_path_, | 136 temp_path_, |
137 true, // recursive | 137 true, // recursive |
138 files_and_dirs | 138 files_and_dirs |
139 ); | 139 ); |
140 int items_not_removed = 0; | 140 int items_not_removed = 0; |
141 FilePath item_in_temp; | 141 FilePath item_in_temp; |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 OnUnpackSucceeded(); | 206 OnUnpackSucceeded(); |
207 | 207 |
208 // Check that there is newer _locales/en_US/messages.json file. | 208 // Check that there is newer _locales/en_US/messages.json file. |
209 base::PlatformFileInfo new_info; | 209 base::PlatformFileInfo new_info; |
210 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 210 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
211 | 211 |
212 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 212 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
213 | 213 |
214 ASSERT_TRUE(TempFilesRemoved()); | 214 ASSERT_TRUE(TempFilesRemoved()); |
215 } | 215 } |
OLD | NEW |