| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/common/extensions/extension.h" | 5 #include "chrome/common/extensions/extension.h" |
| 6 | 6 |
| 7 #if defined(TOOLKIT_GTK) | 7 #if defined(TOOLKIT_GTK) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "base/format_macros.h" | 11 #include "base/format_macros.h" |
| 12 #include "base/file_path.h" | 12 #include "base/file_path.h" |
| 13 #include "base/file_util.h" | 13 #include "base/file_util.h" |
| 14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
| 15 #include "base/path_service.h" | 15 #include "base/path_service.h" |
| 16 #include "base/string_number_conversions.h" | 16 #include "base/string_number_conversions.h" |
| 17 #include "base/string_util.h" | 17 #include "base/string_util.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "chrome/common/chrome_paths.h" | 19 #include "chrome/common/chrome_paths.h" |
| 20 #include "chrome/common/extensions/extension_action.h" | 20 #include "chrome/common/extensions/extension_action.h" |
| 21 #include "chrome/common/extensions/extension_constants.h" | 21 #include "chrome/common/extensions/extension_constants.h" |
| 22 #include "chrome/common/extensions/extension_error_utils.h" | 22 #include "chrome/common/extensions/extension_error_utils.h" |
| 23 #include "chrome/common/extensions/extension_resource.h" | 23 #include "chrome/common/extensions/extension_resource.h" |
| 24 #include "chrome/common/json_value_serializer.h" | 24 #include "chrome/common/json_value_serializer.h" |
| 25 #include "chrome/common/url_constants.h" | 25 #include "chrome/common/url_constants.h" |
| 26 #include "gfx/codec/png_codec.h" | |
| 27 #include "googleurl/src/gurl.h" | 26 #include "googleurl/src/gurl.h" |
| 28 #include "net/base/mime_sniffer.h" | 27 #include "net/base/mime_sniffer.h" |
| 29 #include "skia/ext/image_operations.h" | 28 #include "skia/ext/image_operations.h" |
| 30 #include "chrome/test/ui_test_utils.h" | 29 #include "chrome/test/ui_test_utils.h" |
| 31 #include "net/base/mock_host_resolver.h" | 30 #include "net/base/mock_host_resolver.h" |
| 32 #include "testing/gtest/include/gtest/gtest.h" | 31 #include "testing/gtest/include/gtest/gtest.h" |
| 33 #include "third_party/skia/include/core/SkBitmap.h" | 32 #include "third_party/skia/include/core/SkBitmap.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
| 34 #include "ui/gfx/codec/png_codec.h" |
| 35 | 35 |
| 36 namespace keys = extension_manifest_keys; | 36 namespace keys = extension_manifest_keys; |
| 37 namespace values = extension_manifest_values; | 37 namespace values = extension_manifest_values; |
| 38 namespace errors = extension_manifest_errors; | 38 namespace errors = extension_manifest_errors; |
| 39 | 39 |
| 40 namespace { | 40 namespace { |
| 41 | 41 |
| 42 void CompareLists(const std::vector<std::string>& expected, | 42 void CompareLists(const std::vector<std::string>& expected, |
| 43 const std::vector<std::string>& actual) { | 43 const std::vector<std::string>& actual) { |
| 44 ASSERT_EQ(expected.size(), actual.size()); | 44 ASSERT_EQ(expected.size(), actual.size()); |
| (...skipping 1231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 EXPECT_TRUE(Extension::GenerateId("test", &result)); | 1276 EXPECT_TRUE(Extension::GenerateId("test", &result)); |
| 1277 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf"); | 1277 EXPECT_EQ(result, "jpignaibiiemhngfjkcpokkamffknabf"); |
| 1278 | 1278 |
| 1279 EXPECT_TRUE(Extension::GenerateId("_", &result)); | 1279 EXPECT_TRUE(Extension::GenerateId("_", &result)); |
| 1280 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd"); | 1280 EXPECT_EQ(result, "ncocknphbhhlhkikpnnlmbcnbgdempcd"); |
| 1281 | 1281 |
| 1282 EXPECT_TRUE(Extension::GenerateId( | 1282 EXPECT_TRUE(Extension::GenerateId( |
| 1283 "this_string_is_longer_than_a_single_sha256_hash_digest", &result)); | 1283 "this_string_is_longer_than_a_single_sha256_hash_digest", &result)); |
| 1284 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi"); | 1284 EXPECT_EQ(result, "jimneklojkjdibfkgiiophfhjhbdgcfi"); |
| 1285 } | 1285 } |
| OLD | NEW |