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/files/scoped_temp_dir.h" | 6 #include "base/files/scoped_temp_dir.h" |
7 #include "base/memory/ref_counted.h" | 7 #include "base/memory/ref_counted.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return (items_not_removed == 0); | 156 return (items_not_removed == 0); |
157 } | 157 } |
158 | 158 |
159 protected: | 159 protected: |
160 base::ScopedTempDir temp_dir_; | 160 base::ScopedTempDir temp_dir_; |
161 base::ScopedTempDir extensions_dir_; | 161 base::ScopedTempDir extensions_dir_; |
162 base::FilePath temp_path_; | 162 base::FilePath temp_path_; |
163 MockSandboxedUnpackerClient* client_; | 163 MockSandboxedUnpackerClient* client_; |
164 scoped_ptr<Unpacker> unpacker_; | 164 scoped_ptr<Unpacker> unpacker_; |
165 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; | 165 scoped_refptr<SandboxedUnpacker> sandboxed_unpacker_; |
166 MessageLoop loop_; | 166 base::MessageLoop loop_; |
167 scoped_ptr<content::TestBrowserThread> file_thread_; | 167 scoped_ptr<content::TestBrowserThread> file_thread_; |
168 }; | 168 }; |
169 | 169 |
170 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) { | 170 TEST_F(SandboxedUnpackerTest, NoCatalogsSuccess) { |
171 EXPECT_CALL(*client_, OnUnpackSuccess(_, _, _, _)); | 171 EXPECT_CALL(*client_, OnUnpackSuccess(_, _, _, _)); |
172 EXPECT_CALL(*client_, OnUnpackFailure(_)).Times(0); | 172 EXPECT_CALL(*client_, OnUnpackFailure(_)).Times(0); |
173 | 173 |
174 SetupUnpacker("no_l10n.crx"); | 174 SetupUnpacker("no_l10n.crx"); |
175 ASSERT_TRUE(unpacker_->Run()); | 175 ASSERT_TRUE(unpacker_->Run()); |
176 ASSERT_TRUE(unpacker_->DumpImagesToFile()); | 176 ASSERT_TRUE(unpacker_->DumpImagesToFile()); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 // Check that there is newer _locales/en_US/messages.json file. | 216 // Check that there is newer _locales/en_US/messages.json file. |
217 base::PlatformFileInfo new_info; | 217 base::PlatformFileInfo new_info; |
218 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 218 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
219 | 219 |
220 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 220 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
221 | 221 |
222 ASSERT_TRUE(TempFilesRemoved()); | 222 ASSERT_TRUE(TempFilesRemoved()); |
223 } | 223 } |
224 | 224 |
225 } // namespace extensions | 225 } // namespace extensions |
OLD | NEW |