| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/common/extensions/manifest_tests/extension_manifest_test.h" |
| 6 |
| 7 #include "chrome/common/extensions/extension_manifest_constants.h" |
| 8 #include "testing/gtest/include/gtest/gtest.h" |
| 9 |
| 10 using extensions::Extension; |
| 11 |
| 12 namespace errors = extension_manifest_errors; |
| 13 |
| 14 TEST_F(ExtensionManifestTest, SandboxedResources) { |
| 15 // Sandboxed resources specified. |
| 16 scoped_refptr<Extension> extension1( |
| 17 LoadAndExpectSuccess("sandboxed_resources_valid_1.json")); |
| 18 |
| 19 // No sandboxed resources. |
| 20 scoped_refptr<Extension> extension2( |
| 21 LoadAndExpectSuccess("sandboxed_resources_valid_2.json")); |
| 22 |
| 23 EXPECT_TRUE(extension1->IsResourceSandboxed("/test")); |
| 24 EXPECT_FALSE(extension1->IsResourceSandboxed("/none")); |
| 25 |
| 26 EXPECT_FALSE(extension2->IsResourceSandboxed("/test")); |
| 27 |
| 28 Testcase testcases[] = { |
| 29 Testcase("sandboxed_resources_invalid_1.json", |
| 30 errors::kInvalidSandboxedResourcesList), |
| 31 Testcase("sandboxed_resources_invalid_2.json", |
| 32 errors::kInvalidSandboxedResource) |
| 33 }; |
| 34 RunTestcases(testcases, arraysize(testcases), |
| 35 EXPECT_TYPE_ERROR); |
| 36 } |
| 37 |
| 38 |
| OLD | NEW |