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

Unified Diff: chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: License year update Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
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..ed41f5cce288085bf60240e9fecec2e5ad95ea8d 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_initvalue_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -8,8 +8,10 @@
#include "base/path_service.h"
#include "base/utf_string_conversions.h"
#include "chrome/common/chrome_paths.h"
+#include "chrome/common/extensions/api/icons/icons_handler.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/manifest_handler.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "ui/base/l10n/l10n_util.h"
@@ -19,7 +21,18 @@
namespace errors = extension_manifest_errors;
-TEST_F(ExtensionManifestTest, InitFromValueInvalid) {
+namespace extensions {
+
+class InitFromValueManifestTest : public ExtensionManifestTest {
+ protected:
+ virtual void SetUp() OVERRIDE {
+ ExtensionManifestTest::SetUp();
+ ManifestHandler::Register(extension_manifest_keys::kIcons,
+ new IconsHandler);
+ }
+};
+
+TEST_F(InitFromValueManifestTest, InitFromValueInvalid) {
Testcase testcases[] = {
Testcase("init_invalid_version_missing.json", errors::kInvalidVersion),
Testcase("init_invalid_version_invalid.json", errors::kInvalidVersion),
@@ -71,15 +84,15 @@ TEST_F(ExtensionManifestTest, InitFromValueInvalid) {
EXPECT_TYPE_ERROR);
}
-TEST_F(ExtensionManifestTest, InitFromValueValid) {
- scoped_refptr<extensions::Extension> extension(LoadAndExpectSuccess(
+TEST_F(InitFromValueManifestTest, InitFromValueValid) {
+ scoped_refptr<Extension> extension(LoadAndExpectSuccess(
"init_valid_minimal.json"));
FilePath path;
PathService::Get(chrome::DIR_TEST_DATA, &path);
path = path.AppendASCII("extensions");
- EXPECT_TRUE(extensions::Extension::IdIsValid(extension->id()));
+ EXPECT_TRUE(Extension::IdIsValid(extension->id()));
EXPECT_EQ("1.0.0.0", extension->VersionString());
EXPECT_EQ("my extension", extension->name());
EXPECT_EQ(extension->id(), extension->url().host());
@@ -122,7 +135,7 @@ TEST_F(ExtensionManifestTest, InitFromValueValid) {
EXPECT_TYPE_SUCCESS);
}
-TEST_F(ExtensionManifestTest, InitFromValueValidNameInRTL) {
+TEST_F(InitFromValueManifestTest, InitFromValueValidNameInRTL) {
#if defined(TOOLKIT_GTK)
GtkTextDirection gtk_dir = gtk_widget_get_default_direction();
gtk_widget_set_default_direction(GTK_TEXT_DIR_RTL);
@@ -132,7 +145,7 @@ TEST_F(ExtensionManifestTest, InitFromValueValidNameInRTL) {
#endif
// No strong RTL characters in name.
- scoped_refptr<extensions::Extension> extension(LoadAndExpectSuccess(
+ scoped_refptr<Extension> extension(LoadAndExpectSuccess(
"init_valid_name_no_rtl.json"));
string16 localized_name(ASCIIToUTF16("Dictionary (by Google)"));
@@ -153,3 +166,5 @@ TEST_F(ExtensionManifestTest, InitFromValueValidNameInRTL) {
base::i18n::SetICUDefaultLocale(locale);
#endif
}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698