Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc

Issue 578653005: Revert "Refactor ExtensionManifestTest to allow usage in src/extensions" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/i18n/rtl.h" 6 #include "base/i18n/rtl.h"
7 #include "base/path_service.h" 7 #include "base/path_service.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/common/chrome_paths.h" 9 #include "chrome/common/chrome_paths.h"
10 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" 10 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h"
11 #include "components/crx_file/id_util.h" 11 #include "components/crx_file/id_util.h"
12 #include "extensions/common/extension.h" 12 #include "extensions/common/extension.h"
13 #include "extensions/common/manifest_constants.h" 13 #include "extensions/common/manifest_constants.h"
14 #include "extensions/common/manifest_handlers/options_page_info.h" 14 #include "extensions/common/manifest_handlers/options_page_info.h"
15 #include "extensions/common/switches.h" 15 #include "extensions/common/switches.h"
16 #include "testing/gtest/include/gtest/gtest.h" 16 #include "testing/gtest/include/gtest/gtest.h"
17 #include "ui/base/l10n/l10n_util.h" 17 #include "ui/base/l10n/l10n_util.h"
18 18
19 namespace extensions { 19 namespace extensions {
20 20
21 namespace { 21 namespace {
22 22
23 // The ID of test manifests requiring whitelisting. 23 // The ID of test manifests requiring whitelisting.
24 const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl"; 24 const char kWhitelistID[] = "lmadimbbgapmngbiclpjjngmdickadpl";
25 25
26 } // namespace 26 } // namespace
27 27
28 namespace errors = manifest_errors; 28 namespace errors = manifest_errors;
29 namespace keys = manifest_keys; 29 namespace keys = manifest_keys;
30 30
31 class InitValueManifestTest : public ChromeManifestTest { 31 class InitValueManifestTest : public ExtensionManifestTest {
32 }; 32 };
33 33
34 TEST_F(InitValueManifestTest, InitFromValueInvalid) { 34 TEST_F(InitValueManifestTest, InitFromValueInvalid) {
35 CommandLine::ForCurrentProcess()->AppendSwitchASCII( 35 CommandLine::ForCurrentProcess()->AppendSwitchASCII(
36 extensions::switches::kWhitelistedExtensionID, kWhitelistID); 36 extensions::switches::kWhitelistedExtensionID, kWhitelistID);
37 Testcase testcases[] = { 37 Testcase testcases[] = {
38 Testcase("init_invalid_version_missing.json", errors::kInvalidVersion), 38 Testcase("init_invalid_version_missing.json", errors::kInvalidVersion),
39 Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion), 39 Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion),
40 Testcase("init_invalid_name_missing.json", errors::kInvalidName), 40 Testcase("init_invalid_name_missing.json", errors::kInvalidName),
41 Testcase("init_invalid_name_invalid.json", errors::kInvalidName), 41 Testcase("init_invalid_name_invalid.json", errors::kInvalidName),
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 171
172 localized_name = base::WideToUTF16(L"Dictionary (\x05D1\x05D2" L" Google)"); 172 localized_name = base::WideToUTF16(L"Dictionary (\x05D1\x05D2" L" Google)");
173 base::i18n::AdjustStringForLocaleDirection(&localized_name); 173 base::i18n::AdjustStringForLocaleDirection(&localized_name);
174 EXPECT_EQ(localized_name, base::UTF8ToUTF16(extension->name())); 174 EXPECT_EQ(localized_name, base::UTF8ToUTF16(extension->name()));
175 175
176 // Reset locale. 176 // Reset locale.
177 base::i18n::SetICUDefaultLocale(locale); 177 base::i18n::SetICUDefaultLocale(locale);
178 } 178 }
179 179
180 } // namespace extensions 180 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698