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

Side by Side Diff: third_party/WebKit/LayoutTests/inspector/css_tracker/decorations-after-inplace-formatter.html

Issue 2705433003: DevTools: decouple model logic from presentation within CSSTrackerView (Closed)
Patch Set: Review comments addressed Created 3 years, 10 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/timeline-test.js"></script> 4 <script src="../../http/tests/inspector/timeline-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 src="../../http/tests/inspector/sources-test.js"></script> 6 <script src="../../http/tests/inspector/sources-test.js"></script>
7 7
8 <link rel="stylesheet" type="text/css" href="resources/decorations-after-inplace -formatter.css"> 8 <link rel="stylesheet" type="text/css" href="resources/decorations-after-inplace -formatter.css">
9 <script> 9 <script>
10 10
11 var initialize_CSSTracker = function() { 11 var initialize_CSSTracker = function() {
12 InspectorTest.preloadModule("css_tracker"); 12 InspectorTest.preloadModule("css_tracker");
13 } 13 }
14 14
15 function test() 15 function test()
16 { 16 {
17 var scriptFormatter; 17 var scriptFormatter;
18 18
19 var tracker = self.runtime.sharedInstance(CSSTracker.CSSTrackerView); 19 var tracker = self.runtime.sharedInstance(CSSTracker.CSSTrackerView);
20 InspectorTest.addSniffer(CSSTracker.CSSTrackerView.prototype, "_renderRuleUs age", onTracingFinished); 20 InspectorTest.addSniffer(CSSTracker.CSSTrackerView.prototype, "_updateGutter ", onTracingFinished);
21 21
22 tracker._toggleRecording(true); 22 tracker._toggleRecording(true);
23 UI.viewManager.showView("css_tracker"); 23 UI.viewManager.showView("css_tracker");
24 tracker._toggleRecording(false); 24 tracker._toggleRecording(false);
25 25
26 function onTracingFinished() 26 function onTracingFinished()
27 { 27 {
28 UI.inspectorView.showPanel("sources").then(formatterSetup); 28 UI.inspectorView.showPanel("sources").then(formatterSetup);
29 } 29 }
30 function formatterSetup() 30 function formatterSetup()
(...skipping 17 matching lines...) Expand all
48 48
49 function uiSourceCodeScriptFormatted() 49 function uiSourceCodeScriptFormatted()
50 { 50 {
51 var lines = Array.prototype.map.call(document.querySelectorAll(".text-ed itor-css-rule-unused-marker"), 51 var lines = Array.prototype.map.call(document.querySelectorAll(".text-ed itor-css-rule-unused-marker"),
52 e => e.parentElement.previousSib ling.textContent); 52 e => e.parentElement.previousSib ling.textContent);
53 53
54 InspectorTest.addResult("Formatted line numbers of rules that were not u sed:"); 54 InspectorTest.addResult("Formatted line numbers of rules that were not u sed:");
55 InspectorTest.addResult(lines); 55 InspectorTest.addResult(lines);
56 InspectorTest.completeTest(); 56 InspectorTest.completeTest();
57 } 57 }
58 58
59 function inplaceFormatter() 59 function inplaceFormatter()
60 { 60 {
61 return self.runtime.allInstances(Sources.SourcesView.EditorAction).then( function(editorActions) { 61 return self.runtime.allInstances(Sources.SourcesView.EditorAction).then( function(editorActions) {
62 for (var i = 0; i < editorActions.length; ++i) { 62 for (var i = 0; i < editorActions.length; ++i) {
63 if (editorActions[i] instanceof Sources.InplaceFormatterEditorAc tion) 63 if (editorActions[i] instanceof Sources.InplaceFormatterEditorAc tion)
64 return editorActions[i]; 64 return editorActions[i];
65 } 65 }
66 return null; 66 return null;
67 }); 67 });
68 } 68 }
69 } 69 }
70 </script> 70 </script>
71 </head> 71 </head>
72 <p id="id">PASS</p> 72 <p id="id">PASS</p>
73 <body onload="runTest()"> 73 <body onload="runTest()">
74 <p>Tests the CSS highlight in sources after the Pretty print formatting.</p> 74 <p>Tests the CSS highlight in sources after the Pretty print formatting.</p>
75 </body> 75 </body>
76 </html> 76 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698