| OLD | NEW |
| 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 960 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 971 DevToolsExtensionSecurityPolicyGrants) { | 971 DevToolsExtensionSecurityPolicyGrants) { |
| 972 ASSERT_TRUE(embedded_test_server()->Start()); | 972 ASSERT_TRUE(embedded_test_server()->Start()); |
| 973 | 973 |
| 974 std::unique_ptr<extensions::TestExtensionDir> dir( | 974 std::unique_ptr<extensions::TestExtensionDir> dir( |
| 975 new extensions::TestExtensionDir()); | 975 new extensions::TestExtensionDir()); |
| 976 | 976 |
| 977 extensions::DictionaryBuilder manifest; | 977 extensions::DictionaryBuilder manifest; |
| 978 dir->WriteManifest(extensions::DictionaryBuilder() | 978 dir->WriteManifest(extensions::DictionaryBuilder() |
| 979 .Set("name", "Devtools Panel") | 979 .Set("name", "Devtools Panel") |
| 980 .Set("version", "1") | 980 .Set("version", "1") |
| 981 // Whitelist the script we stuff into the 'blob:' URL: |
| 982 .Set("content_security_policy", |
| 983 "script-src 'self' " |
| 984 "'sha256-95xJWHeV+" |
| 985 "1zjAKQufDVW0misgmR4gCjgpipP2LJ5iis='; " |
| 986 "object-src 'none'") |
| 981 .Set("manifest_version", 2) | 987 .Set("manifest_version", 2) |
| 982 .Set("devtools_page", "devtools.html") | 988 .Set("devtools_page", "devtools.html") |
| 983 .ToJSON()); | 989 .ToJSON()); |
| 984 | 990 |
| 985 dir->WriteFile( | 991 dir->WriteFile( |
| 986 FILE_PATH_LITERAL("devtools.html"), | 992 FILE_PATH_LITERAL("devtools.html"), |
| 987 "<html><head><script src='devtools.js'></script></head></html>"); | 993 "<html><head><script src='devtools.js'></script></head></html>"); |
| 988 | 994 |
| 989 dir->WriteFile( | 995 dir->WriteFile( |
| 990 FILE_PATH_LITERAL("devtools.js"), | 996 FILE_PATH_LITERAL("devtools.js"), |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1542 | 1548 |
| 1543 DevToolsWindowTesting::CloseDevToolsWindowSync(window); | 1549 DevToolsWindowTesting::CloseDevToolsWindowSync(window); |
| 1544 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); | 1550 content::WebUIControllerFactory::UnregisterFactoryForTesting(&test_factory); |
| 1545 } | 1551 } |
| 1546 | 1552 |
| 1547 // Tests scripts panel showing. | 1553 // Tests scripts panel showing. |
| 1548 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) { | 1554 IN_PROC_BROWSER_TEST_F(DevToolsSanityTest, TestDevToolsSharedWorker) { |
| 1549 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL); | 1555 RunTest("testDevToolsSharedWorker", url::kAboutBlankURL); |
| 1550 } | 1556 } |
| 1551 | 1557 |
| OLD | NEW |