blob: 989dbfffb437961f132c09b154d8da09b2b068b0 [file] [log] [blame]
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
(async function() {
TestRunner.addResult(`Tests the gutter decorations in target source code after ScriptFormatterEditorAction\n`);
await TestRunner.loadModule('coverage_test_runner');
await TestRunner.loadHTML(`
<p id="id">PASS</p>
`);
await TestRunner.addScriptTag('resources/coverage.js');
CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage();
await UI.inspectorView.showPanel('sources');
await CoverageTestRunner.sourceDecorated('coverage.js');
var decoratorPromise = TestRunner.addSnifferPromise(Coverage.CoverageView.LineDecorator.prototype, '_innerDecorate');
var editorActions = await self.runtime.allInstances(Sources.SourcesView.EditorAction);
for (action of editorActions) {
if (action instanceof Sources.ScriptFormatterEditorAction) {
action._toggleFormatScriptSource();
break;
}
}
await decoratorPromise;
CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView);
TestRunner.completeTest();
})();