Chromium Code Reviews| Index: third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html |
| diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html b/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..1230ffe1c341f68ab339fe28b67007134dbcb243 |
| --- /dev/null |
| +++ b/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html |
| @@ -0,0 +1,53 @@ |
| +<html> |
| +<head> |
| +<script src="../../http/tests/inspector/inspector-test.js"></script> |
| +<script src="../../http/tests/inspector/timeline-test.js"></script> |
| +<script src="../../http/tests/inspector/debugger-test.js"></script> |
| +<script src="../../http/tests/inspector/sources-test.js"></script> |
| + |
| +<link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> |
| +<script> |
| + |
| +function test() |
| +{ |
| + Runtime.experiments.enableForTest("timelineRuleUsageRecording"); |
| + |
| + var panel = WebInspector.panels.timeline; |
| + panel._markUnusedCSS.set(true); |
| + |
| + InspectorTest.runTestSuite([ |
| + function testMarking(next) |
| + { |
| + function printResults() { |
|
caseq
2016/11/09 23:33:55
{ => next line (this still uses old style)
Also,
|
| + WebInspector.inspectorView.showPanel("sources").then( |
| + InspectorTest.showScriptSource("highlight-in-source.css", () => setTimeout(didShowScriptSource, 0))); |
|
caseq
2016/11/09 23:33:55
Passing the result of showScriptSource() to Promis
|
| + |
| + function didShowScriptSource(sourceFrame) { |
|
caseq
2016/11/09 23:33:55
{ => next line
|
| + var lines = Array.prototype.map.call(document.querySelectorAll(".text-editor-line-marker-coverage"), |
| + e => e.parentElement.previousSibling.textContent); |
| + |
| + InspectorTest.addResult("Number of lines: " + lines.length); |
|
caseq
2016/11/09 23:33:55
drop this, and just do InspectorTest.addResults(li
|
| + |
| + for(line of lines) |
| + InspectorTest.addResults(line); |
| + |
| + next(); |
| + } |
| + } |
| + |
| + function timelineStarted() |
| + { |
| + InspectorTest.stopTimeline(printResults); |
| + } |
| + |
| + InspectorTest.startTimeline(timelineStarted); |
| + } |
| + ]); |
| +} |
| +</script> |
| +</head> |
| +<p id="id">PASS</p> |
| +<body onload="runTest()"> |
| +<p>Tests the CSS highlight in sources after the timeline recording finishes.</p> |
| +</body> |
| +</html> |