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/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/scoped_temp_dir.h" | 7 #include "base/scoped_temp_dir.h" |
8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 // Try bots won't let us write into DIR_TEST_DATA, so we have to create | 36 // Try bots won't let us write into DIR_TEST_DATA, so we have to create |
37 // a temp folder to play in. | 37 // a temp folder to play in. |
38 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 38 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
39 | 39 |
40 FilePath crx_path = temp_dir_.path().AppendASCII(crx_name); | 40 FilePath crx_path = temp_dir_.path().AppendASCII(crx_name); |
41 ASSERT_TRUE(file_util::CopyFile(original_path, crx_path)) << | 41 ASSERT_TRUE(file_util::CopyFile(original_path, crx_path)) << |
42 "Original path " << original_path.value() << | 42 "Original path " << original_path.value() << |
43 ", Crx path " << crx_path.value(); | 43 ", Crx path " << crx_path.value(); |
44 | 44 |
45 unpacker_.reset( | 45 unpacker_.reset( |
46 new ExtensionUnpacker( | 46 new ExtensionUnpacker(crx_path, |
47 crx_path, std::string(), Extension::INTERNAL, Extension::NO_FLAGS)); | 47 std::string(), |
| 48 extensions::Extension::INTERNAL, |
| 49 extensions::Extension::NO_FLAGS)); |
48 } | 50 } |
49 | 51 |
50 protected: | 52 protected: |
51 ScopedTempDir temp_dir_; | 53 ScopedTempDir temp_dir_; |
52 scoped_ptr<ExtensionUnpacker> unpacker_; | 54 scoped_ptr<ExtensionUnpacker> unpacker_; |
53 }; | 55 }; |
54 | 56 |
55 // Crashes intermittently on Windows, see http://crbug.com/109238 | 57 // Crashes intermittently on Windows, see http://crbug.com/109238 |
56 #if defined(OS_WIN) | 58 #if defined(OS_WIN) |
57 #define MAYBE_EmptyDefaultLocale DISABLED_EmptyDefaultLocale | 59 #define MAYBE_EmptyDefaultLocale DISABLED_EmptyDefaultLocale |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 #define MAYBE_NoL10n DISABLED_NoL10n | 182 #define MAYBE_NoL10n DISABLED_NoL10n |
181 #else | 183 #else |
182 #define MAYBE_NoL10n NoL10n | 184 #define MAYBE_NoL10n NoL10n |
183 #endif | 185 #endif |
184 TEST_F(ExtensionUnpackerTest, MAYBE_NoL10n) { | 186 TEST_F(ExtensionUnpackerTest, MAYBE_NoL10n) { |
185 SetupUnpacker("no_l10n.crx"); | 187 SetupUnpacker("no_l10n.crx"); |
186 EXPECT_TRUE(unpacker_->Run()); | 188 EXPECT_TRUE(unpacker_->Run()); |
187 EXPECT_TRUE(unpacker_->error_message().empty()); | 189 EXPECT_TRUE(unpacker_->error_message().empty()); |
188 EXPECT_EQ(0U, unpacker_->parsed_catalogs()->size()); | 190 EXPECT_EQ(0U, unpacker_->parsed_catalogs()->size()); |
189 } | 191 } |
OLD | NEW |