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

Side by Side Diff: LayoutTests/inspector/elements/styles/add-new-rule-inline-style-csp.html

Issue 458213002: DevTools: add test to verify simple selector behavior. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: WebInspector.BlankStylePropertiesSection.makeNormal is private Created 6 years, 4 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
1 <html> 1 <html>
2 <head> 2 <head>
3 <meta http-equiv="Content-Security-Policy" content="style-src https://*:443 'uns afe-eval'"> 3 <meta http-equiv="Content-Security-Policy" content="style-src https://*:443 'uns afe-eval'">
4 <script src="../../../http/tests/inspector/inspector-test.js"></script> 4 <script src="../../../http/tests/inspector/inspector-test.js"></script>
5 <script src="../../../http/tests/inspector/elements-test.js"></script> 5 <script src="../../../http/tests/inspector/elements-test.js"></script>
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 var nodeId; 10 var nodeId;
11 var rule; 11 var rule;
12 12
13 WebInspector.inspectorView.showPanel("elements"); 13 WebInspector.inspectorView.showPanel("elements");
14 14
15 InspectorTest.runTestSuite([ 15 InspectorTest.runTestSuite([
16 function testSetUp(next) { 16 function testSetUp(next) {
17 InspectorTest.selectNodeAndWaitForStyles("inspected", next); 17 InspectorTest.selectNodeAndWaitForStyles("inspected", next);
18 }, 18 },
19 19
20 function testAddRule(next) 20 function testAddRule(next)
21 { 21 {
22 InspectorTest.nodeWithId("inspected", nodeCallback); 22 InspectorTest.nodeWithId("inspected", nodeCallback);
23 23
24 function nodeCallback(node) 24 function nodeCallback(node)
25 { 25 {
26 nodeId = node.id; 26 nodeId = node.id;
27 InspectorTest.addNewRule("#inspected", successCallback); 27 InspectorTest.addNewRule("#inspected", successCallback);
28 } 28 }
29 29
30 function successCallback(styleRule) 30 function successCallback(section)
31 { 31 {
32 rule = styleRule.rule; 32 rule = section.styleRule.rule;
33 InspectorTest.addResult("=== Rule added ==="); 33 InspectorTest.addResult("=== Rule added ===");
34 InspectorTest.addResult(rule.selectorText + " {" + rule.style.cs sText + "}"); 34 InspectorTest.addResult(rule.selectorText + " {" + rule.style.cs sText + "}");
35 InspectorTest.addResult("Selectors matching the (#inspected) nod e: " + InspectorTest.matchingSelectors(rule)); 35 InspectorTest.addResult("Selectors matching the (#inspected) nod e: " + InspectorTest.matchingSelectors(rule));
36 next(); 36 next();
37 } 37 }
38 }, 38 },
39 39
40 function testAddProperty(next) 40 function testAddProperty(next)
41 { 41 {
42 rule.style.appendProperty("width", "100%", callback); 42 rule.style.appendProperty("width", "100%", callback);
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
112 112
113 <body onload="runTest()"> 113 <body onload="runTest()">
114 <p> 114 <p>
115 Tests that adding a new rule does not crash the renderer and modifying an inline style does not report errors when forbidden by Content-Security-Policy. 115 Tests that adding a new rule does not crash the renderer and modifying an inline style does not report errors when forbidden by Content-Security-Policy.
116 </p> 116 </p>
117 117
118 <div id="inspected">Text</div> 118 <div id="inspected">Text</div>
119 119
120 </body> 120 </body>
121 </html> 121 </html>
OLDNEW
« no previous file with comments | « LayoutTests/http/tests/inspector/elements-test.js ('k') | LayoutTests/inspector/elements/styles/simple-selector.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698