Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../http/tests/inspector/inspector-test.js"></script> | |
| 4 <script src="../../http/tests/inspector/timeline-test.js"></script> | |
| 5 <script src="../../http/tests/inspector/debugger-test.js"></script> | |
| 6 <script src="../../http/tests/inspector/sources-test.js"></script> | |
| 7 | |
| 8 <link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> | |
| 9 <script> | |
| 10 | |
| 11 function test() | |
| 12 { | |
| 13 Runtime.experiments.enableForTest("timelineRuleUsageRecording"); | |
| 14 | |
| 15 var panel = WebInspector.panels.timeline; | |
| 16 panel._markUnusedCSS.set(true); | |
| 17 | |
| 18 InspectorTest.runTestSuite([ | |
| 19 function testMarking(next) | |
| 20 { | |
| 21 function printResults() { | |
|
caseq
2016/11/09 23:33:55
{ => next line (this still uses old style)
Also,
| |
| 22 WebInspector.inspectorView.showPanel("sources").then( | |
| 23 InspectorTest.showScriptSource("highlight-in-source.css", () => setTimeout(didShowScriptSource, 0))); | |
|
caseq
2016/11/09 23:33:55
Passing the result of showScriptSource() to Promis
| |
| 24 | |
| 25 function didShowScriptSource(sourceFrame) { | |
|
caseq
2016/11/09 23:33:55
{ => next line
| |
| 26 var lines = Array.prototype.map.call(document.querySelectorA ll(".text-editor-line-marker-coverage"), | |
| 27 e => e.parentElement.pr eviousSibling.textContent); | |
| 28 | |
| 29 InspectorTest.addResult("Number of lines: " + lines.length); | |
|
caseq
2016/11/09 23:33:55
drop this, and just do InspectorTest.addResults(li
| |
| 30 | |
| 31 for(line of lines) | |
| 32 InspectorTest.addResults(line); | |
| 33 | |
| 34 next(); | |
| 35 } | |
| 36 } | |
| 37 | |
| 38 function timelineStarted() | |
| 39 { | |
| 40 InspectorTest.stopTimeline(printResults); | |
| 41 } | |
| 42 | |
| 43 InspectorTest.startTimeline(timelineStarted); | |
| 44 } | |
| 45 ]); | |
| 46 } | |
| 47 </script> | |
| 48 </head> | |
| 49 <p id="id">PASS</p> | |
| 50 <body onload="runTest()"> | |
| 51 <p>Tests the CSS highlight in sources after the timeline recording finishes.</p> | |
| 52 </body> | |
| 53 </html> | |
| OLD | NEW |