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/path_service.h" | 7 #include "base/path_service.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" |
11 #include "chrome/common/chrome_paths.h" | 11 #include "chrome/common/chrome_paths.h" |
12 #include "chrome/common/extensions/extension_constants.h" | 12 #include "chrome/common/extensions/extension_constants.h" |
13 #include "chrome/common/extensions/extension_manifest_constants.h" | 13 #include "chrome/common/extensions/extension_manifest_constants.h" |
14 #include "chrome/common/extensions/unpacker.h" | 14 #include "chrome/common/extensions/unpacker.h" |
15 #include "testing/gtest/include/gtest/gtest.h" | 15 #include "testing/gtest/include/gtest/gtest.h" |
16 #include "third_party/skia/include/core/SkBitmap.h" | 16 #include "third_party/skia/include/core/SkBitmap.h" |
17 | 17 |
(...skipping 28 matching lines...) Expand all Loading... |
46 "Original path " << original_path.value() << | 46 "Original path " << original_path.value() << |
47 ", Crx path " << crx_path.value(); | 47 ", Crx path " << crx_path.value(); |
48 | 48 |
49 unpacker_.reset(new Unpacker(crx_path, | 49 unpacker_.reset(new Unpacker(crx_path, |
50 std::string(), | 50 std::string(), |
51 Extension::INTERNAL, | 51 Extension::INTERNAL, |
52 Extension::NO_FLAGS)); | 52 Extension::NO_FLAGS)); |
53 } | 53 } |
54 | 54 |
55 protected: | 55 protected: |
56 ScopedTempDir temp_dir_; | 56 base::ScopedTempDir temp_dir_; |
57 scoped_ptr<Unpacker> unpacker_; | 57 scoped_ptr<Unpacker> unpacker_; |
58 }; | 58 }; |
59 | 59 |
60 // Crashes intermittently on Windows, see http://crbug.com/109238 | 60 // Crashes intermittently on Windows, see http://crbug.com/109238 |
61 #if defined(OS_WIN) | 61 #if defined(OS_WIN) |
62 #define MAYBE_EmptyDefaultLocale DISABLED_EmptyDefaultLocale | 62 #define MAYBE_EmptyDefaultLocale DISABLED_EmptyDefaultLocale |
63 #else | 63 #else |
64 #define MAYBE_EmptyDefaultLocale EmptyDefaultLocale | 64 #define MAYBE_EmptyDefaultLocale EmptyDefaultLocale |
65 #endif | 65 #endif |
66 TEST_F(UnpackerTest, MAYBE_EmptyDefaultLocale) { | 66 TEST_F(UnpackerTest, MAYBE_EmptyDefaultLocale) { |
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 SetupUnpacker("bad_image.crx"); | 262 SetupUnpacker("bad_image.crx"); |
263 EXPECT_FALSE(unpacker_->Run()); | 263 EXPECT_FALSE(unpacker_->Run()); |
264 EXPECT_TRUE(StartsWith(unpacker_->error_message(), | 264 EXPECT_TRUE(StartsWith(unpacker_->error_message(), |
265 ASCIIToUTF16(kExpected), | 265 ASCIIToUTF16(kExpected), |
266 false)) << "Expected prefix: \"" << kExpected | 266 false)) << "Expected prefix: \"" << kExpected |
267 << "\", actual error: \"" << unpacker_->error_message() | 267 << "\", actual error: \"" << unpacker_->error_message() |
268 << "\""; | 268 << "\""; |
269 } | 269 } |
270 | 270 |
271 } // namespace extensions | 271 } // namespace extensions |
OLD | NEW |