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

Side by Side Diff: chrome/common/extensions/manifest_tests/extension_manifests_contentsecuritypolicy_unittest.cc

Issue 1548153002: Switch to standard integer types in chrome/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/macros.h"
5 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h" 6 #include "chrome/common/extensions/manifest_tests/chrome_manifest_test.h"
6 #include "extensions/common/error_utils.h" 7 #include "extensions/common/error_utils.h"
7 #include "extensions/common/manifest_constants.h" 8 #include "extensions/common/manifest_constants.h"
8 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
9 10
10 namespace errors = extensions::manifest_errors; 11 namespace errors = extensions::manifest_errors;
11 using extensions::ErrorUtils; 12 using extensions::ErrorUtils;
12 13
13 class ContentSecurityPolicyManifestTest : public ChromeManifestTest { 14 class ContentSecurityPolicyManifestTest : public ChromeManifestTest {
14 }; 15 };
15 16
16 TEST_F(ContentSecurityPolicyManifestTest, InsecureContentSecurityPolicy) { 17 TEST_F(ContentSecurityPolicyManifestTest, InsecureContentSecurityPolicy) {
17 Testcase testcases[] = { 18 Testcase testcases[] = {
18 Testcase( 19 Testcase(
19 "insecure_contentsecuritypolicy_1.json", 20 "insecure_contentsecuritypolicy_1.json",
20 ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue, 21 ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue,
21 "http://example.com", "script-src")), 22 "http://example.com", "script-src")),
22 Testcase("insecure_contentsecuritypolicy_2.json", 23 Testcase("insecure_contentsecuritypolicy_2.json",
23 ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue, 24 ErrorUtils::FormatErrorMessage(errors::kInvalidCSPInsecureValue,
24 "'unsafe-inline'", "script-src")), 25 "'unsafe-inline'", "script-src")),
25 Testcase("insecure_contentsecuritypolicy_3.json", 26 Testcase("insecure_contentsecuritypolicy_3.json",
26 ErrorUtils::FormatErrorMessage( 27 ErrorUtils::FormatErrorMessage(
27 errors::kInvalidCSPMissingSecureSrc, "object-src"))}; 28 errors::kInvalidCSPMissingSecureSrc, "object-src"))};
28 RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_WARNING); 29 RunTestcases(testcases, arraysize(testcases), EXPECT_TYPE_WARNING);
29 } 30 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698