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

Side by Side Diff: extensions/common/csp_validator_unittest.cc

Issue 83843002: Move ManifestHandlers to extensions/ (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: s/handler/info Created 7 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 unified diff | Download patch
« no previous file with comments | « extensions/common/csp_validator.cc ('k') | extensions/common/manifest_handlers/csp_info.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/common/extensions/csp_validator.h" 5 #include "extensions/common/csp_validator.h"
6 #include "testing/gtest/include/gtest/gtest.h" 6 #include "testing/gtest/include/gtest/gtest.h"
7 7
8 using extensions::csp_validator::ContentSecurityPolicyIsLegal; 8 using extensions::csp_validator::ContentSecurityPolicyIsLegal;
9 using extensions::csp_validator::ContentSecurityPolicyIsSecure; 9 using extensions::csp_validator::ContentSecurityPolicyIsSecure;
10 using extensions::csp_validator::ContentSecurityPolicyIsSandboxed; 10 using extensions::csp_validator::ContentSecurityPolicyIsSandboxed;
11 using extensions::Manifest; 11 using extensions::Manifest;
12 12
13 TEST(ExtensionCSPValidator, IsLegal) { 13 TEST(ExtensionCSPValidator, IsLegal) {
14 EXPECT_TRUE(ContentSecurityPolicyIsLegal("foo")); 14 EXPECT_TRUE(ContentSecurityPolicyIsLegal("foo"));
15 EXPECT_TRUE(ContentSecurityPolicyIsLegal( 15 EXPECT_TRUE(ContentSecurityPolicyIsLegal(
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 "sandbox allow-top-navigation", Manifest::TYPE_EXTENSION)); 171 "sandbox allow-top-navigation", Manifest::TYPE_EXTENSION));
172 EXPECT_FALSE(ContentSecurityPolicyIsSandboxed( 172 EXPECT_FALSE(ContentSecurityPolicyIsSandboxed(
173 "sandbox allow-top-navigation", Manifest::TYPE_PLATFORM_APP)); 173 "sandbox allow-top-navigation", Manifest::TYPE_PLATFORM_APP));
174 174
175 // Popups are OK. 175 // Popups are OK.
176 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( 176 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed(
177 "sandbox allow-popups", Manifest::TYPE_EXTENSION)); 177 "sandbox allow-popups", Manifest::TYPE_EXTENSION));
178 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( 178 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed(
179 "sandbox allow-popups", Manifest::TYPE_PLATFORM_APP)); 179 "sandbox allow-popups", Manifest::TYPE_PLATFORM_APP));
180 } 180 }
OLDNEW
« no previous file with comments | « extensions/common/csp_validator.cc ('k') | extensions/common/manifest_handlers/csp_info.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698