Chromium Code Reviews| Index: chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc |
| diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc |
| index 30e597d9ca61958876cf860edc67cd97255dca47..e4c31e03e7f8508afcd17ec6a2e81470a271d365 100644 |
| --- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc |
| +++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc |
| @@ -2,14 +2,15 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| - |
| #include "base/i18n/rtl.h" |
| #include "base/path_service.h" |
| #include "base/utf_string_conversions.h" |
| #include "chrome/common/chrome_paths.h" |
| #include "chrome/common/extensions/extension.h" |
| #include "chrome/common/extensions/extension_manifest_constants.h" |
| +#include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| +#include "chrome/common/extensions/manifest_url_info.h" |
| +#include "chrome/common/extensions/options_page_handler.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| #include "ui/base/l10n/l10n_util.h" |
| @@ -17,9 +18,20 @@ |
| #include <gtk/gtk.h> |
| #endif |
| +namespace keys = extension_manifest_keys; |
|
Yoyo Zhou
2013/01/03 23:16:00
no need for this if it's only used once.
Joe Thomas
2013/01/04 01:36:27
Done.
|
| namespace errors = extension_manifest_errors; |
| -TEST_F(ExtensionManifestTest, InitFromValueInvalid) { |
| +namespace { |
|
Yoyo Zhou
2013/01/03 23:16:00
I don't think the prevailing style is to put these
Joe Thomas
2013/01/04 01:36:27
Done.
|
| + |
| +class InitValueManifestTest : public ExtensionManifestTest { |
| + virtual void SetUp() OVERRIDE { |
| + ExtensionManifestTest::SetUp(); |
| + extensions::ManifestHandler::Register(keys::kOptionsPage, |
| + new extensions::OptionsPageHandler); |
| + } |
| +}; |
| + |
| +TEST_F(InitValueManifestTest, InitFromValueInvalid) { |
| Testcase testcases[] = { |
| Testcase("init_invalid_version_missing.json", errors::kInvalidVersion), |
| Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion), |
| @@ -71,7 +83,7 @@ TEST_F(ExtensionManifestTest, InitFromValueInvalid) { |
| EXPECT_TYPE_ERROR); |
| } |
| -TEST_F(ExtensionManifestTest, InitFromValueValid) { |
| +TEST_F(InitValueManifestTest, InitFromValueValid) { |
| scoped_refptr<extensions::Extension> extension(LoadAndExpectSuccess( |
| "init_valid_minimal.json")); |
| @@ -93,8 +105,10 @@ TEST_F(ExtensionManifestTest, InitFromValueValid) { |
| // Test with an options page. |
| extension = LoadAndExpectSuccess("init_valid_options.json"); |
| - EXPECT_EQ("chrome-extension", extension->options_url().scheme()); |
| - EXPECT_EQ("/options.html", extension->options_url().path()); |
| + EXPECT_EQ("chrome-extension", |
| + extensions::ManifestURLInfo::GetOptionsPage(extension).scheme()); |
| + EXPECT_EQ("/options.html", |
| + extensions::ManifestURLInfo::GetOptionsPage(extension).path()); |
| Testcase testcases[] = { |
| // Test that an empty list of page actions does not stop a browser action |
| @@ -122,7 +136,7 @@ TEST_F(ExtensionManifestTest, InitFromValueValid) { |
| EXPECT_TYPE_SUCCESS); |
| } |
| -TEST_F(ExtensionManifestTest, InitFromValueValidNameInRTL) { |
| +TEST_F(InitValueManifestTest, InitFromValueValidNameInRTL) { |
| #if defined(TOOLKIT_GTK) |
| GtkTextDirection gtk_dir = gtk_widget_get_default_direction(); |
| gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL); |
| @@ -153,3 +167,5 @@ TEST_F(ExtensionManifestTest, InitFromValueValidNameInRTL) { |
| base::i18n::SetICUDefaultLocale(locale); |
| #endif |
| } |
| + |
| +} // namespace |