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" |
11 #include "base/string_util.h" | 11 #include "base/string_util.h" |
12 #include "base/values.h" | 12 #include "base/values.h" |
13 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 13 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
14 #include "chrome/common/chrome_paths.h" | 14 #include "chrome/common/chrome_paths.h" |
15 #include "chrome/common/extensions/extension.h" | 15 #include "chrome/common/extensions/extension.h" |
16 #include "chrome/common/extensions/extension_manifest_constants.h" | 16 #include "chrome/common/extensions/extension_manifest_constants.h" |
17 #include "chrome/common/extensions/extension_unpacker.h" | 17 #include "chrome/common/extensions/extension_unpacker.h" |
18 #include "content/test/test_browser_thread.h" | 18 #include "content/test/test_browser_thread.h" |
19 #include "testing/gmock/include/gmock/gmock.h" | 19 #include "testing/gmock/include/gmock/gmock.h" |
20 #include "testing/gtest/include/gtest/gtest.h" | 20 #include "testing/gtest/include/gtest/gtest.h" |
21 #include "third_party/skia/include/core/SkBitmap.h" | 21 #include "third_party/skia/include/core/SkBitmap.h" |
22 | 22 |
23 namespace errors = extension_manifest_errors; | 23 namespace errors = extension_manifest_errors; |
24 namespace keys = extension_manifest_keys; | 24 namespace keys = extension_manifest_keys; |
25 | 25 |
26 using content::BrowserThread; | 26 using content::BrowserThread; |
| 27 using extensions::Extension; |
27 using testing::_; | 28 using testing::_; |
28 using testing::Invoke; | 29 using testing::Invoke; |
29 | 30 |
30 namespace { | 31 namespace { |
31 | 32 |
32 void OnUnpackSuccess(const FilePath& temp_dir, | 33 void OnUnpackSuccess(const FilePath& temp_dir, |
33 const FilePath& extension_root, | 34 const FilePath& extension_root, |
34 const DictionaryValue* original_manifest, | 35 const DictionaryValue* original_manifest, |
35 const Extension* extension) { | 36 const Extension* extension) { |
36 // Don't delete temp_dir here, we need to do some post op checking. | 37 // Don't delete temp_dir here, we need to do some post op checking. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 OnUnpackSucceeded(); | 214 OnUnpackSucceeded(); |
214 | 215 |
215 // Check that there is newer _locales/en_US/messages.json file. | 216 // Check that there is newer _locales/en_US/messages.json file. |
216 base::PlatformFileInfo new_info; | 217 base::PlatformFileInfo new_info; |
217 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); | 218 EXPECT_TRUE(file_util::GetFileInfo(messages_file, &new_info)); |
218 | 219 |
219 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); | 220 EXPECT_TRUE(new_info.last_modified > old_info.last_modified); |
220 | 221 |
221 ASSERT_TRUE(TempFilesRemoved()); | 222 ASSERT_TRUE(TempFilesRemoved()); |
222 } | 223 } |
OLD | NEW |