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

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

Issue 2770123002: DevTools: produce javascript outline for javascript classess (Closed)
Patch Set: missing build files 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 unified diff | Download patch
OLDNEW
1 var initialize_SourcesTest = function() { 1 var initialize_SourcesTest = function() {
2 2
3 InspectorTest.preloadPanel("sources"); 3 InspectorTest.preloadPanel("sources");
4 4
5 function testSourceMapping(text1, text2, mapping, testToken) 5 function testSourceMapping(text1, text2, mapping, testToken)
6 { 6 {
7 var originalPosition = text1.indexOf(testToken); 7 var originalPosition = text1.indexOf(testToken);
8 InspectorTest.assertTrue(originalPosition !== -1); 8 InspectorTest.assertTrue(originalPosition !== -1);
9 var originalLocation = Sources.Formatter.positionToLocation(text1.computeLin eEndings(), originalPosition); 9 var originalLocation = Sources.Formatter.positionToLocation(text1.computeLin eEndings(), originalPosition);
10 var formattedLocation = mapping.originalToFormatted(originalLocation[0], ori ginalLocation[1]); 10 var formattedLocation = mapping.originalToFormatted(originalLocation[0], ori ginalLocation[1]);
(...skipping 29 matching lines...) Expand all
40 return promise; 40 return promise;
41 41
42 function onChunk(isLastChunk, outlineItems) { 42 function onChunk(isLastChunk, outlineItems) {
43 items.pushAll(outlineItems); 43 items.pushAll(outlineItems);
44 if (!isLastChunk) 44 if (!isLastChunk)
45 return; 45 return;
46 InspectorTest.addResult('Text:'); 46 InspectorTest.addResult('Text:');
47 InspectorTest.addResult(text.split('\n').map(line => ' ' + line).join ('\n')); 47 InspectorTest.addResult(text.split('\n').map(line => ' ' + line).join ('\n'));
48 InspectorTest.addResult('Outline:'); 48 InspectorTest.addResult('Outline:');
49 for (var item of items) 49 for (var item of items)
50 InspectorTest.addResult(' ' + item.name + item.arguments + ':' + item.line + ':' + item.column); 50 InspectorTest.addResult(' ' + item.name + (item.arguments || '') + ':' + item.line + ':' + item.column);
51 fulfill(); 51 fulfill();
52 } 52 }
53 } 53 }
54 54
55 InspectorTest.dumpSwatchPositions = function(sourceFrame, bookmarkType) 55 InspectorTest.dumpSwatchPositions = function(sourceFrame, bookmarkType)
56 { 56 {
57 var textEditor = sourceFrame.textEditor; 57 var textEditor = sourceFrame.textEditor;
58 var markers = textEditor.bookmarks(textEditor.fullRange(), bookmarkType); 58 var markers = textEditor.bookmarks(textEditor.fullRange(), bookmarkType);
59 for (var i = 0; i < markers.length; i++) { 59 for (var i = 0; i < markers.length; i++) {
60 var position = markers[i].position(); 60 var position = markers[i].position();
61 var text = markers[i]._marker.widgetNode.firstChild.textContent; 61 var text = markers[i]._marker.widgetNode.firstChild.textContent;
62 InspectorTest.addResult("Line " + position.startLine + ", Column " + pos ition.startColumn + ": " + text); 62 InspectorTest.addResult("Line " + position.startLine + ", Column " + pos ition.startColumn + ": " + text);
63 } 63 }
64 } 64 }
65 65
66 }; 66 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698