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

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

Issue 747403002: Ignore insecure parts of CSP in extensions and allow extension to load (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test expectations Created 6 years 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
« no previous file with comments | « no previous file | chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
diff --git a/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc b/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
index ef13f960784e736719c8b7c72e8b623520b20284..1048817e446252278d34ef0046fa44c892ddb929 100644
--- a/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
+++ b/chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc
@@ -3,22 +3,27 @@
// found in the LICENSE file.
#include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
+#include "extensions/common/error_utils.h"
#include "extensions/common/manifest_constants.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace errors = extensions::manifest_errors;
+using extensions::ErrorUtils;
class ContentSecurityPolicyManifestTest : public ChromeManifestTest {
};
TEST_F(ContentSecurityPolicyManifestTest, InsecureContentSecurityPolicy) {
Testcase testcases[] = {
- Testcase("insecure_contentsecuritypolicy_1.json",
- errors::kInsecureContentSecurityPolicy),
- Testcase("insecure_contentsecuritypolicy_2.json",
- errors::kInsecureContentSecurityPolicy),
- Testcase("insecure_contentsecuritypolicy_3.json",
- errors::kInsecureContentSecurityPolicy),
- };
- RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_ERROR);
+ Testcase(
+ "insecure_contentsecuritypolicy_1.json",
+ ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue,
+ "http://example.com", "script-src")),
+ Testcase("insecure_contentsecuritypolicy_2.json",
+ ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue,
+ "'unsafe-inline'", "script-src")),
+ Testcase("insecure_contentsecuritypolicy_3.json",
+ ErrorUtils::FormatErrorMessage(
+ errors::kInvalidCSPMissingSecureSrc, "object-src"))};
+ RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_WARNING);
}
« no previous file with comments | « no previous file | chrome/common/extensions/manifest_tests/extension_manifests_platformapp_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698