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

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

Issue 10458063: Add sanbdoxed_pages to allow extension/app pages to be served in a sandboxed, unique origin (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 8 years, 6 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 | Annotate | Revision Log
OLDNEW
(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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698