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/file_enumerator.h" | 6 #include "base/files/file_enumerator.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 unpacker_.reset(new Unpacker( | 95 unpacker_.reset(new Unpacker( |
96 crx_path, std::string(), Manifest::INTERNAL, Extension::NO_FLAGS)); | 96 crx_path, std::string(), Manifest::INTERNAL, Extension::NO_FLAGS)); |
97 | 97 |
98 // Build a temp area where the extension will be unpacked. | 98 // Build a temp area where the extension will be unpacked. |
99 temp_path_ = | 99 temp_path_ = |
100 temp_dir_.path().AppendASCII("sandboxed_unpacker_test_Temp"); | 100 temp_dir_.path().AppendASCII("sandboxed_unpacker_test_Temp"); |
101 ASSERT_TRUE(file_util::CreateDirectory(temp_path_)); | 101 ASSERT_TRUE(file_util::CreateDirectory(temp_path_)); |
102 | 102 |
103 sandboxed_unpacker_ = new SandboxedUnpacker( | 103 sandboxed_unpacker_ = new SandboxedUnpacker( |
104 crx_path, | 104 crx_path, |
105 false, | |
106 Manifest::INTERNAL, | 105 Manifest::INTERNAL, |
107 Extension::NO_FLAGS, | 106 Extension::NO_FLAGS, |
108 extensions_dir_.path(), | 107 extensions_dir_.path(), |
109 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), | 108 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::FILE).get(), |
110 client_); | 109 client_); |
111 | 110 |
112 EXPECT_TRUE(PrepareUnpackerEnv()); | 111 EXPECT_TRUE(PrepareUnpackerEnv()); |
113 } | 112 } |
114 | 113 |
115 bool PrepareUnpackerEnv() { | 114 bool PrepareUnpackerEnv() { |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
215 // Check that there is newer _locales/en_US/messages.json file. | 214 // Check that there is newer _locales/en_US/messages.json file. |
216 base::PlatformFileInfo new_info; | 215 base::PlatformFileInfo new_info; |
217 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 216 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
218 | 217 |
219 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 218 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
220 | 219 |
221 ASSERT_TRUE(TempFilesRemoved()); | 220 ASSERT_TRUE(TempFilesRemoved()); |
222 } | 221 } |
223 | 222 |
224 } // namespace extensions | 223 } // namespace extensions |
OLD | NEW |