OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <stddef.h> |
| 6 |
5 #include "extensions/common/csp_validator.h" | 7 #include "extensions/common/csp_validator.h" |
6 #include "extensions/common/error_utils.h" | 8 #include "extensions/common/error_utils.h" |
7 #include "extensions/common/install_warning.h" | 9 #include "extensions/common/install_warning.h" |
8 #include "extensions/common/manifest_constants.h" | 10 #include "extensions/common/manifest_constants.h" |
9 #include "testing/gtest/include/gtest/gtest.h" | 11 #include "testing/gtest/include/gtest/gtest.h" |
10 | 12 |
11 using extensions::csp_validator::ContentSecurityPolicyIsLegal; | 13 using extensions::csp_validator::ContentSecurityPolicyIsLegal; |
12 using extensions::csp_validator::SanitizeContentSecurityPolicy; | 14 using extensions::csp_validator::SanitizeContentSecurityPolicy; |
13 using extensions::csp_validator::ContentSecurityPolicyIsSandboxed; | 15 using extensions::csp_validator::ContentSecurityPolicyIsSandboxed; |
14 using extensions::csp_validator::OPTIONS_NONE; | 16 using extensions::csp_validator::OPTIONS_NONE; |
(...skipping 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
445 "sandbox allow-top-navigation", Manifest::TYPE_EXTENSION)); | 447 "sandbox allow-top-navigation", Manifest::TYPE_EXTENSION)); |
446 EXPECT_FALSE(ContentSecurityPolicyIsSandboxed( | 448 EXPECT_FALSE(ContentSecurityPolicyIsSandboxed( |
447 "sandbox allow-top-navigation", Manifest::TYPE_PLATFORM_APP)); | 449 "sandbox allow-top-navigation", Manifest::TYPE_PLATFORM_APP)); |
448 | 450 |
449 // Popups are OK. | 451 // Popups are OK. |
450 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( | 452 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( |
451 "sandbox allow-popups", Manifest::TYPE_EXTENSION)); | 453 "sandbox allow-popups", Manifest::TYPE_EXTENSION)); |
452 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( | 454 EXPECT_TRUE(ContentSecurityPolicyIsSandboxed( |
453 "sandbox allow-popups", Manifest::TYPE_PLATFORM_APP)); | 455 "sandbox allow-popups", Manifest::TYPE_PLATFORM_APP)); |
454 } | 456 } |
OLD | NEW |