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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/elements/styles-1/edit-inspector-stylesheet.html

Issue 1954423002: DevTools: introduce CSSStyleSheetHeader.originalContentProvider() method (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@simplify-network-project
Patch Set: address comments Created 4 years, 7 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
OLDNEW
1 <html> 1 <html>
2 <head> 2 <head>
3 <script src="../../../http/tests/inspector/inspector-test.js"></script> 3 <script src="../../../http/tests/inspector/inspector-test.js"></script>
4 <script src="../../../http/tests/inspector/elements-test.js"></script> 4 <script src="../../../http/tests/inspector/elements-test.js"></script>
5 <script src="../../../http/tests/inspector/debugger-test.js"></script> 5 <script src="../../../http/tests/inspector/debugger-test.js"></script>
6 <script> 6 <script>
7 7
8 function test() 8 function test()
9 { 9 {
10 var inspectorResource; 10 InspectorTest.selectNodeAndWaitForStyles("inspected", onStylesSelected);
11 11
12 InspectorTest.selectNodeAndWaitForStyles("inspected", step1); 12 function onStylesSelected(node)
13
14 function step1(node)
15 { 13 {
16 InspectorTest.addNewRule("#inspected", stylesReceived); 14 WebInspector.workspace.addEventListener(WebInspector.Workspace.Events.Wo rkingCopyCommitted, onWorkingCopyCommitted);
17 15 InspectorTest.addNewRule("#inspected", new Function());
18 function stylesReceived()
19 {
20 // UISourceCode.prototype.addRevision() must finish before step2 is called.
21 InspectorTest.showScriptSource("inspector-stylesheet", step2);
22 }
23 } 16 }
24 17
25 function step2(sourceFrame) 18 function onWorkingCopyCommitted(event)
26 { 19 {
27 var uiSourceCode = sourceFrame._uiSourceCode; 20 WebInspector.workspace.removeEventListener(WebInspector.UISourceCode.Eve nts.WorkingCopyCommitted, onWorkingCopyCommitted);
21 var uiSourceCode = event.data.uiSourceCode;
28 InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.disp layName()); 22 InspectorTest.addResult("Inspector stylesheet URL: " + uiSourceCode.disp layName());
29 uiSourceCode.requestContent().then(printContent(onContent)) 23 uiSourceCode.requestContent().then(printContent(onContent))
30 24
31 function onContent() 25 function onContent()
32 { 26 {
33 InspectorTest.addResult("\nSetting new content"); 27 InspectorTest.addResult("\nSetting new content");
34 uiSourceCode.setWorkingCopy("#inspected { background-color: green; } "); 28 uiSourceCode.setWorkingCopy("#inspected { background-color: green; } ");
35 uiSourceCode.commitWorkingCopy(); 29 uiSourceCode.commitWorkingCopy();
36 step3(uiSourceCode); 30 onUpdatedWorkingCopy(uiSourceCode);
37 } 31 }
38 } 32 }
39 33
40 function step3(uiSourceCode) 34 function onUpdatedWorkingCopy(uiSourceCode)
41 { 35 {
42 uiSourceCode.requestContent().then(printContent(selectNode)); 36 uiSourceCode.requestContent().then(printContent(selectNode));
43 function selectNode() 37 function selectNode()
44 { 38 {
45 InspectorTest.selectNodeAndWaitForStyles("inspected", dumpStyles); 39 InspectorTest.selectNodeAndWaitForStyles("inspected", dumpStyles);
46 } 40 }
47 41
48 function dumpStyles() 42 function dumpStyles()
49 { 43 {
50 InspectorTest.dumpSelectedElementStyles(true, false, true); 44 InspectorTest.dumpSelectedElementStyles(true, false, true);
(...skipping 18 matching lines...) Expand all
69 63
70 <body onload="runTest()"> 64 <body onload="runTest()">
71 <p> 65 <p>
72 Tests that adding a new rule creates inspector stylesheet resource and allows it s live editing. 66 Tests that adding a new rule creates inspector stylesheet resource and allows it s live editing.
73 </p> 67 </p>
74 68
75 <div id="inspected">Text</div> 69 <div id="inspected">Text</div>
76 70
77 </body> 71 </body>
78 </html> 72 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698