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/i18n/rtl.h" | 5 #include "base/i18n/rtl.h" |
6 #include "base/path_service.h" | 6 #include "base/path_service.h" |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
9 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 9 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
10 #include "chrome/common/extensions/manifest_url_handler.h" | 10 #include "chrome/common/extensions/manifest_url_handler.h" |
| 11 #include "components/crx_file/id_util.h" |
11 #include "extensions/common/extension.h" | 12 #include "extensions/common/extension.h" |
12 #include "extensions/common/manifest_constants.h" | 13 #include "extensions/common/manifest_constants.h" |
13 #include "testing/gtest/include/gtest/gtest.h" | 14 #include "testing/gtest/include/gtest/gtest.h" |
14 #include "ui/base/l10n/l10n_util.h" | 15 #include "ui/base/l10n/l10n_util.h" |
15 | 16 |
16 namespace extensions { | 17 namespace extensions { |
17 | 18 |
18 namespace errors = manifest_errors; | 19 namespace errors = manifest_errors; |
19 namespace keys = manifest_keys; | 20 namespace keys = manifest_keys; |
20 | 21 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 } | 79 } |
79 | 80 |
80 TEST_F(InitValueManifestTest, InitFromValueValid) { | 81 TEST_F(InitValueManifestTest, InitFromValueValid) { |
81 scoped_refptr<Extension> extension(LoadAndExpectSuccess( | 82 scoped_refptr<Extension> extension(LoadAndExpectSuccess( |
82 "init_valid_minimal.json")); | 83 "init_valid_minimal.json")); |
83 | 84 |
84 base::FilePath path; | 85 base::FilePath path; |
85 PathService::Get(chrome::DIR_TEST_DATA, &path); | 86 PathService::Get(chrome::DIR_TEST_DATA, &path); |
86 path = path.AppendASCII("extensions"); | 87 path = path.AppendASCII("extensions"); |
87 | 88 |
88 EXPECT_TRUE(Extension::IdIsValid(extension->id())); | 89 EXPECT_TRUE(crx_file::id_util::IdIsValid(extension->id())); |
89 EXPECT_EQ("1.0.0.0", extension->VersionString()); | 90 EXPECT_EQ("1.0.0.0", extension->VersionString()); |
90 EXPECT_EQ("my extension", extension->name()); | 91 EXPECT_EQ("my extension", extension->name()); |
91 EXPECT_EQ(extension->name(), extension->short_name()); | 92 EXPECT_EQ(extension->name(), extension->short_name()); |
92 EXPECT_EQ(extension->id(), extension->url().host()); | 93 EXPECT_EQ(extension->id(), extension->url().host()); |
93 EXPECT_EQ(extension->path(), path); | 94 EXPECT_EQ(extension->path(), path); |
94 EXPECT_EQ(path, extension->path()); | 95 EXPECT_EQ(path, extension->path()); |
95 | 96 |
96 // Test permissions scheme. | 97 // Test permissions scheme. |
97 // We allow unknown API permissions, so this will be valid until we better | 98 // We allow unknown API permissions, so this will be valid until we better |
98 // distinguish between API and host permissions. | 99 // distinguish between API and host permissions. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 154 |
154 localized_name = base::WideToUTF16(L"Dictionary (\x05D1\x05D2" L" Google)"); | 155 localized_name = base::WideToUTF16(L"Dictionary (\x05D1\x05D2" L" Google)"); |
155 base::i18n::AdjustStringForLocaleDirection(&localized_name); | 156 base::i18n::AdjustStringForLocaleDirection(&localized_name); |
156 EXPECT_EQ(localized_name, base::UTF8ToUTF16(extension->name())); | 157 EXPECT_EQ(localized_name, base::UTF8ToUTF16(extension->name())); |
157 | 158 |
158 // Reset locale. | 159 // Reset locale. |
159 base::i18n::SetICUDefaultLocale(locale); | 160 base::i18n::SetICUDefaultLocale(locale); |
160 } | 161 } |
161 | 162 |
162 } // namespace extensions | 163 } // namespace extensions |
OLD | NEW |