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

Unified Diff: third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js

Issue 2771623003: DevTools: add tests to fixate javascript outline behavior (Closed)
Patch Set: Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js
diff --git a/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js b/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js
index 3b0d95e491d31ca9577905cb825b09a72c7d7e9c..33e368fdce11e67516548f4d057d3300dce8c83b 100644
--- a/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js
+++ b/third_party/WebKit/LayoutTests/http/tests/inspector/sources-test.js
@@ -32,6 +32,26 @@ InspectorTest.testPrettyPrint = function(mimeType, text, mappingQueries, next)
}
}
+InspectorTest.testJavascriptOutline = function(text) {
+ var fulfill;
+ var promise = new Promise(x => fulfill = x);
+ Common.formatterWorkerPool.javaScriptOutline(text, onChunk);
+ var items = [];
+ return promise;
+
+ function onChunk(isLastChunk, outlineItems) {
+ items.pushAll(outlineItems);
+ if (!isLastChunk)
+ return;
+ InspectorTest.addResult('Text:');
+ InspectorTest.addResult(text.split('\n').map(line => ' ' + line).join('\n'));
+ InspectorTest.addResult('Outline:');
+ for (var item of items)
+ InspectorTest.addResult(' ' + item.name + item.arguments + ':' + item.line + ':' + item.column);
+ fulfill();
+ }
+}
+
InspectorTest.dumpSwatchPositions = function(sourceFrame, bookmarkType)
{
var textEditor = sourceFrame.textEditor;

Powered by Google App Engine
This is Rietveld 408576698