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

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

Issue 12253022: Manifest handler for all keys background-related. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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_platformapp_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
index dd0b9f96de1189eb0dc2c16456c79fd3206c7408..e19ff03456928b63b3b3a731eec8b322f4612937 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc
@@ -8,12 +8,26 @@
#include "base/json/json_file_value_serializer.h"
#include "base/memory/linked_ptr.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/background_info.h"
#include "chrome/common/extensions/extension_manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extension_manifest_errors;
-TEST_F(ExtensionManifestTest, PlatformApps) {
+namespace extensions {
+
+class ExtensionManifestPlatformAppTest : public ExtensionManifestTest {
+ virtual void SetUp() OVERRIDE {
+ ExtensionManifestTest::SetUp();
+ std::vector<std::string> background_keys(BackgroundManifestHandler::keys());
+ linked_ptr<BackgroundManifestHandler> background_handler(
+ new BackgroundManifestHandler);
+ for (size_t i = 0; i < background_keys.size(); ++i)
+ ManifestHandler::Register(background_keys[i], background_handler);
+ }
+};
+
+TEST_F(ExtensionManifestPlatformAppTest, PlatformApps) {
scoped_refptr<extensions::Extension> extension =
LoadAndExpectSuccess("init_valid_platform_app.json");
EXPECT_TRUE(extension->is_storage_isolated());
@@ -54,7 +68,7 @@ TEST_F(ExtensionManifestTest, PlatformApps) {
warning_testcases, arraysize(warning_testcases), EXPECT_TYPE_WARNING);
}
-TEST_F(ExtensionManifestTest, PlatformAppContentSecurityPolicy) {
+TEST_F(ExtensionManifestPlatformAppTest, PlatformAppContentSecurityPolicy) {
// Normal platform apps can't specify a CSP value.
Testcase warning_testcases[] = {
Testcase(
@@ -89,7 +103,7 @@ TEST_F(ExtensionManifestTest, PlatformAppContentSecurityPolicy) {
errors::kInsecureContentSecurityPolicy);
}
-TEST_F(ExtensionManifestTest, CertainApisRequirePlatformApps) {
+TEST_F(ExtensionManifestPlatformAppTest, CertainApisRequirePlatformApps) {
// Put APIs here that should be restricted to platform apps, but that haven't
// yet graduated from experimental.
const char* kPlatformAppExperimentalApis[] = {
@@ -132,3 +146,5 @@ TEST_F(ExtensionManifestTest, CertainApisRequirePlatformApps) {
LoadAndExpectSuccess(Manifest(manifests[i].get(), ""));
}
}
+
+} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698