| 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/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
| 8 #include "chrome/common/chrome_paths.h" | 8 #include "chrome/common/chrome_paths.h" |
| 9 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" | 9 #include "chrome/common/extensions/api/extension_action/page_action_handler.h" |
| 10 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" | 10 #include "chrome/common/extensions/api/i18n/default_locale_handler.h" |
| 11 #include "chrome/common/extensions/api/icons/icons_handler.h" | 11 #include "chrome/common/extensions/api/icons/icons_handler.h" |
| 12 #include "chrome/common/extensions/extension.h" | 12 #include "chrome/common/extensions/extension.h" |
| 13 #include "chrome/common/extensions/extension_manifest_constants.h" | 13 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 14 #include "chrome/common/extensions/manifest_handler.h" | 14 #include "chrome/common/extensions/manifest_handler.h" |
| 15 #include "chrome/common/extensions/manifest_handlers/content_scripts_handler.h" |
| 15 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" | 16 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 16 #include "chrome/common/extensions/manifest_url_handler.h" | 17 #include "chrome/common/extensions/manifest_url_handler.h" |
| 17 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
| 18 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
| 19 | 20 |
| 20 #if defined(TOOLKIT_GTK) | 21 #if defined(TOOLKIT_GTK) |
| 21 #include <gtk/gtk.h> | 22 #include <gtk/gtk.h> |
| 22 #endif | 23 #endif |
| 23 | 24 |
| 24 namespace errors = extension_manifest_errors; | 25 namespace errors = extension_manifest_errors; |
| 25 namespace keys = extension_manifest_keys; | 26 namespace keys = extension_manifest_keys; |
| 26 | 27 |
| 27 namespace extensions { | 28 namespace extensions { |
| 28 | 29 |
| 29 class InitValueManifestTest : public ExtensionManifestTest { | 30 class InitValueManifestTest : public ExtensionManifestTest { |
| 30 protected: | 31 protected: |
| 31 virtual void SetUp() OVERRIDE { | 32 virtual void SetUp() OVERRIDE { |
| 32 ExtensionManifestTest::SetUp(); | 33 ExtensionManifestTest::SetUp(); |
| 33 (new extensions::DefaultLocaleHandler)->Register(); | 34 (new extensions::DefaultLocaleHandler)->Register(); |
| 34 (new extensions::IconsHandler)->Register(); | 35 (new extensions::IconsHandler)->Register(); |
| 35 (new extensions::OptionsPageHandler)->Register(); | 36 (new extensions::OptionsPageHandler)->Register(); |
| 36 (new extensions::PageActionHandler)->Register(); | 37 (new extensions::PageActionHandler)->Register(); |
| 38 (new extensions::ContentScriptsHandler)->Register(); |
| 37 } | 39 } |
| 38 }; | 40 }; |
| 39 | 41 |
| 40 TEST_F(InitValueManifestTest, InitFromValueInvalid) { | 42 TEST_F(InitValueManifestTest, InitFromValueInvalid) { |
| 41 Testcase testcases[] = { | 43 Testcase testcases[] = { |
| 42 Testcase("init_invalid_version_missing.json", errors::kInvalidVersion), | 44 Testcase("init_invalid_version_missing.json", errors::kInvalidVersion), |
| 43 Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion), | 45 Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion), |
| 44 Testcase("init_invalid_name_missing.json", errors::kInvalidName), | 46 Testcase("init_invalid_name_missing.json", errors::kInvalidName), |
| 45 Testcase("init_invalid_name_invalid.json", errors::kInvalidName), | 47 Testcase("init_invalid_name_invalid.json", errors::kInvalidName), |
| 46 Testcase("init_invalid_description_invalid.json", | 48 Testcase("init_invalid_description_invalid.json", |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 170 |
| 169 // Reset locale. | 171 // Reset locale. |
| 170 #if defined(TOOLKIT_GTK) | 172 #if defined(TOOLKIT_GTK) |
| 171 gtk_widget_set_default_direction(gtk_dir); | 173 gtk_widget_set_default_direction(gtk_dir); |
| 172 #else | 174 #else |
| 173 base::i18n::SetICUDefaultLocale(locale); | 175 base::i18n::SetICUDefaultLocale(locale); |
| 174 #endif | 176 #endif |
| 175 } | 177 } |
| 176 | 178 |
| 177 } // namespace extensions | 179 } // namespace extensions |
| OLD | NEW |