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

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

Issue 10217017: Allow features to refer to subkeys in _manifest_features.json. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix theme test Created 8 years, 8 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_background_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
index 49ccf34f4f14d70eb5f0af343268ef369be0b2b7..5dd777a9f23585fa90c7e2141c2f89c11a046014 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_background_unittest.cc
@@ -9,10 +9,13 @@
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_error_utils.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
+#include "chrome/common/extensions/simple_feature_provider.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extension_manifest_errors;
+namespace extensions {
+
TEST_F(ExtensionManifestTest, BackgroundPermission) {
LoadAndExpectError("background_permission.json",
errors::kBackgroundPermissionNeeded);
@@ -61,11 +64,13 @@ TEST_F(ExtensionManifestTest, BackgroundPage) {
EXPECT_EQ("/foo.html", extension->GetBackgroundURL().path());
manifest->SetInteger(keys::kManifestVersion, 2);
- LoadAndExpectError(
- Manifest(manifest.get(), ""),
- ExtensionErrorUtils::FormatErrorMessage(
- errors::kFeatureNotAllowed, "background_page"),
- Extension::INTERNAL, Extension::STRICT_ERROR_CHECKS);
+ Feature* feature = SimpleFeatureProvider::GetManifestFeatures()->
+ GetFeature("background_page");
+ extension = LoadAndExpectSuccess(Manifest(manifest.get(), ""));
+ ASSERT_TRUE(extension);
+ ASSERT_EQ(1u, extension->install_warnings().size());
+ EXPECT_EQ(feature->GetErrorMessage(Feature::INVALID_MAX_MANIFEST_VERSION),
+ extension->install_warnings()[0]);
}
TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) {
@@ -78,3 +83,5 @@ TEST_F(ExtensionManifestTest, BackgroundAllowNoJsAccess) {
ASSERT_TRUE(extension);
EXPECT_FALSE(extension->allow_background_js_access());
}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698