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

Unified Diff: third_party/WebKit/LayoutTests/inspector/tracing/decorations-after-inplace-formatter.html

Issue 2492343002: Devtools: Pretty print fix for CSS coverage decorations. (Closed)
Patch Set: Pretty print fix for CSS coverage decorations. 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
Index: third_party/WebKit/LayoutTests/inspector/tracing/decorations-after-inplace-formatter.html
diff --git a/third_party/WebKit/LayoutTests/inspector/tracing/decorations-after-inplace-formatter.html b/third_party/WebKit/LayoutTests/inspector/tracing/decorations-after-inplace-formatter.html
new file mode 100644
index 0000000000000000000000000000000000000000..45456092c7f94d19f0869b456eaa5f33cb02851a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/inspector/tracing/decorations-after-inplace-formatter.html
@@ -0,0 +1,84 @@
+<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/decorations-after-inplace-formatter.css">
+<script>
+
+function test()
+{setTimeout(InspectorTest.completeTest, 3000);
caseq 2016/11/15 22:07:05 nuke this
+ Runtime.experiments.enableForTest("timelineRuleUsageRecording");
+
+ var panel = UI.panels.timeline;
+ panel._markUnusedCSS.set(true);
+
+ var scriptFormatter;
+
+ InspectorTest.runTestSuite([
+ function testSetup(next) {
+ InspectorTest.startTimeline(timelineStarted);
caseq 2016/11/15 22:07:05 You should be able to make this shorter with somet
+
+ function timelineStarted()
+ {
+ InspectorTest.stopTimeline(printResults);
+ }
+
+ function printResults()
caseq 2016/11/15 22:07:05 let's find a more descriptive name for this -- cou
+ {
+ UI.inspectorView.showPanel("sources").then(next);
+ }
+ },
+ function formatterSetup(next)
caseq 2016/11/15 22:07:05 Each of these are supposed to be independent tests
+ {
+ inplaceFormatter().then(function(sf) {
+ scriptFormatter = sf;
+ next();
+ });
+ },
+ function testMarking(next)
+ {
+ InspectorTest.showScriptSource("decorations-after-inplace-formatter.css", showDecorations);
+
+ function showDecorations()
+ {
+ InspectorTest.addSniffer(Components.CoverageProfile.LineDecorator.prototype, "decorate", formatSource);
+ }
+
+ function formatSource(frame)
+ {
+ InspectorTest.addSniffer(Components.CoverageProfile.LineDecorator.prototype, "decorate", uiSourceCodeScriptFormatted);
+ scriptFormatter._formatSourceInPlace();
+ }
+
+ function uiSourceCodeScriptFormatted()
+ {
+ var lines = Array.prototype.map.call(document.querySelectorAll(".text-editor-line-marker-coverage"),
+ e => e.parentElement.previousSibling.textContent);
+
+ InspectorTest.addResult(lines);
+ next();
+ }
+ }
+ ]);
+
+ function inplaceFormatter()
+ {
+ return self.runtime.allInstances(Sources.SourcesView.EditorAction).then(function(editorActions) {
+ for (var i = 0; i < editorActions.length; ++i) {
+ if (editorActions[i] instanceof Sources.InplaceFormatterEditorAction)
+ return editorActions[i];
+ }
+ return null;
+ });
+ }
+}
+</script>
+</head>
+<p id="id">PASS</p>
+<body onload="runTest()">
+<p>Tests the CSS highlight in sources after the Pretty print formatting.</p>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698