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

Side by Side Diff: chrome/browser/devtools/devtools_sanity_browsertest.cc

Issue 2472333003: CSP: "local schemes" should inherit policy when embedded. (Closed)
Patch Set: browser_test Created 4 years, 1 month 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 <stddef.h> 5 #include <stddef.h>
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/cancelable_callback.h" 10 #include "base/cancelable_callback.h"
(...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 DevToolsExtensionSecurityPolicyGrants) { 972 DevToolsExtensionSecurityPolicyGrants) {
973 ASSERT_TRUE(embedded_test_server()->Start()); 973 ASSERT_TRUE(embedded_test_server()->Start());
974 974
975 std::unique_ptr<extensions::TestExtensionDir> dir( 975 std::unique_ptr<extensions::TestExtensionDir> dir(
976 new extensions::TestExtensionDir()); 976 new extensions::TestExtensionDir());
977 977
978 extensions::DictionaryBuilder manifest; 978 extensions::DictionaryBuilder manifest;
979 dir->WriteManifest(extensions::DictionaryBuilder() 979 dir->WriteManifest(extensions::DictionaryBuilder()
980 .Set("name", "Devtools Panel") 980 .Set("name", "Devtools Panel")
981 .Set("version", "1") 981 .Set("version", "1")
982 // Whitelist the script we stuff into the 'blob:' URL:
983 .Set("content_security_policy",
984 "script-src 'self' "
985 "'sha256-95xJWHeV+"
986 "1zjAKQufDVW0misgmR4gCjgpipP2LJ5iis='; "
987 "object-src 'none'")
982 .Set("manifest_version", 2) 988 .Set("manifest_version", 2)
983 .Set("devtools_page", "devtools.html") 989 .Set("devtools_page", "devtools.html")
984 .ToJSON()); 990 .ToJSON());
985 991
986 dir->WriteFile( 992 dir->WriteFile(
987 FILE_PATH_LITERAL("devtools.html"), 993 FILE_PATH_LITERAL("devtools.html"),
988 "<html><head><script src='devtools.js'></script></head></html>"); 994 "<html><head><script src='devtools.js'></script></head></html>");
989 995
990 dir->WriteFile( 996 dir->WriteFile(
991 FILE_PATH_LITERAL("devtools.js"), 997 FILE_PATH_LITERAL("devtools.js"),
(...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after
1543 1549
1544 DevToolsWindowTesting::CloseDevToolsWindowSync(window); 1550 DevToolsWindowTesting::CloseDevToolsWindowSync(window);
1545 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); 1551 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory);
1546 } 1552 }
1547 1553
1548 // Tests scripts panel showing. 1554 // Tests scripts panel showing.
1549 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) { 1555 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) {
1550 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL); 1556 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL);
1551 } 1557 }
1552 1558
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698