| Index: third_party/WebKit/LayoutTests/inspector/coverage/coverage-test.js
|
| diff --git a/third_party/WebKit/LayoutTests/inspector/coverage/coverage-test.js b/third_party/WebKit/LayoutTests/inspector/coverage/coverage-test.js
|
| index 1f0b4947f9d1bd8f57c33e8f37a1022174d5bea5..73fa5bae16cd90408c8957b970d8b4a32fffcb5b 100644
|
| --- a/third_party/WebKit/LayoutTests/inspector/coverage/coverage-test.js
|
| +++ b/third_party/WebKit/LayoutTests/inspector/coverage/coverage-test.js
|
| @@ -19,8 +19,36 @@ InspectorTest.sourceDecorated = async function(source)
|
| {
|
| await UI.inspectorView.showPanel("sources");
|
| var decoratePromise = InspectorTest.addSnifferPromise(Coverage.CoverageView.LineDecorator.prototype, "decorate");
|
| - await new Promise(fulfill => InspectorTest.showScriptSource(source, fulfill));
|
| + var sourceFrame = await new Promise(fulfill => InspectorTest.showScriptSource(source, fulfill));
|
| await decoratePromise;
|
| + return sourceFrame;
|
| }
|
|
|
| +InspectorTest.dumpDecorations = async function(source)
|
| +{
|
| + var sourceFrame = await InspectorTest.sourceDecorated(source);
|
| + InspectorTest.dumpDecorationsInSourceFrame(sourceFrame);
|
| +}
|
| +
|
| +InspectorTest.dumpDecorationsInSourceFrame = function(sourceFrame)
|
| +{
|
| + var markerMap = new Map([['used', '+'], ['unused', '-'], ['mixed', '*']]);
|
| +
|
| + var codeMirror = sourceFrame.textEditor.codeMirror();
|
| + for (var line = 0; line < codeMirror.lineCount(); ++line) {
|
| + var text = codeMirror.getLine(line);
|
| + var markerType = ' ';
|
| + var lineInfo = codeMirror.lineInfo(line);
|
| + if (!lineInfo)
|
| + continue;
|
| + var gutterElement = lineInfo.gutterMarkers && lineInfo.gutterMarkers['CodeMirror-gutter-coverage'];
|
| + if (gutterElement) {
|
| + var markerClass = /^text-editor-coverage-(\w*)-marker$/.exec(gutterElement.classList)[1];
|
| + markerType = markerMap.get(markerClass) || gutterElement.classList;
|
| + }
|
| + InspectorTest.addResult(`${line}: ${markerType} ${text}`);
|
| + }
|
| +}
|
| +
|
| +
|
| }
|
|
|