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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html

Issue 2472213005: DevTools: introduce "Track CSS Usage" experiment (Closed)
Patch Set: Unused CSS highlight in sources panel Created 4 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..57170bcbfb47c94d263a4a0aef2d5ea4d5ed4d20
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source.html
@@ -0,0 +1,60 @@
+<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)
+ {
+ InspectorTest.startTimeline(timelineStarted);
+
+ function timelineStarted()
+ {
+ InspectorTest.stopTimeline(printResults);
+ }
+
+ function printResults()
+ {
+ WebInspector.inspectorView.showPanel("sources").then(showSource);
+ }
+
+ function showSource()
+ {
+ InspectorTest.showScriptSource("highlight-in-source.css", waitForDecorations);
+ }
+
+ function waitForDecorations()
+ {
+ InspectorTest.addSniffer(WebInspector.CoverageProfile.LineDecorator.prototype, "decorate", didShowDecorations);
+ }
+
+ function didShowDecorations(sourceFrame)
+ {
+ var lines = Array.prototype.map.call(document.querySelectorAll(".text-editor-line-marker-coverage"),
+ e => e.parentElement.previousSibling.textContent);
+
+ InspectorTest.addResult(lines);
+ next();
+ }
+ }
+ ]);
+}
+</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>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/inspector/tracing/highlight-in-source-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698