Commit 1436c9ab authored by Will Chen's avatar Will Chen Committed by Commit Bot

DevTools: automatically migrate some of coverage tests

This converts a batch of tests from the old test framework (html file)
into the new test framework (js file).

Most of it was done through an automated transformation script, with
a small amount of manual clean-up.

Bug: 667560
Change-Id: I2171de04cddd60141504bd573c47fadeaeda7906
Reviewed-on: https://chromium-review.googlesource.com/769660
Commit-Queue: Will Chen <chenwilliam@chromium.org>
Reviewed-by: default avatarAndrey Kosyakov <caseq@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517249}
parent ea2ad20b
PASS
Tests the gutter decorations in target source code after ScriptFormatterEditorAction
0: + function outer(index) {
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/debugger-test.js"></script>
<script src="../../inspector/sources-test.js"></script>
<script src="../resources/coverage-test.js"></script>
// 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.
<script src="resources/coverage.js"></script>
(async function() {
TestRunner.addResult(`Tests the gutter decorations in target source code after ScriptFormatterEditorAction\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.loadModule('coverage_test_runner');
await TestRunner.loadHTML(`
<p id="id">PASS</p>
`);
await TestRunner.addScriptTag('resources/coverage.js');
<script>
async function test() {
CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage();
......@@ -26,11 +28,4 @@ async function test() {
await decoratorPromise;
CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView);
TestRunner.completeTest();
}
</script>
</head>
<p id="id">PASS</p>
<body onload="runTest()">
<p>Tests the gutter decorations in target source code after ScriptFormatterEditorAction</p>
</body>
</html>
\ No newline at end of file
})();
PASS
Tests the coverage highlight in sources after the recording finishes.
0: + body {
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/debugger-test.js"></script>
<script src="../resources/coverage-test.js"></script>
// 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.
<link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css">
<script>
(async function() {
TestRunner.addResult(`Tests the coverage highlight in sources after the recording finishes.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.loadModule('coverage_test_runner');
await TestRunner.loadHTML(`
<p id="id">PASS</p>
`);
await TestRunner.addStylesheetTag('resources/highlight-in-source.css');
var initialize_Coverage = function() {
InspectorTest.preloadModule("coverage");
}
async function test() {
CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage();
await CoverageTestRunner.dumpDecorations('highlight-in-source.css');
TestRunner.completeTest();
}
</script>
</head>
<p id="id">PASS</p>
<body onload="runTest()">
<p>Tests the coverage highlight in sources after the recording finishes.</p>
</body>
</html>
\ No newline at end of file
})();
PASS
Tests the coverage highlight in sources after the recording finishes.
0: + function outer(index) {
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/debugger-test.js"></script>
<script src="../resources/coverage-test.js"></script>
<script src="resources/coverage.js"></script>
// 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.
<script>
(async function() {
TestRunner.addResult(`Tests the coverage highlight in sources after the recording finishes.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.loadModule('coverage_test_runner');
await TestRunner.addScriptTag('resources/coverage.js');
async function test() {
CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage();
await CoverageTestRunner.dumpDecorations('coverage.js');
TestRunner.completeTest();
}
</script>
</head>
<p id="id">PASS</p>
<body onload="runTest()">
<p>Tests the coverage highlight in sources after the recording finishes.</p>
</body>
</html>
\ No newline at end of file
})();
PASS
Tests the CSS highlight in sources after the Pretty print formatting.
The below should be formatted
......
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script src="../../inspector/debugger-test.js"></script>
<script src="../../inspector/sources-test.js"></script>
<script src="../resources/coverage-test.js"></script>
// 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.
<link rel="stylesheet" type="text/css" href="resources/decorations-after-inplace-formatter.css">
<link rel="stylesheet" type="text/css" href="resources/long-mangled.css">
(async function() {
TestRunner.addResult(`Tests the CSS highlight in sources after the Pretty print formatting.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.loadModule('coverage_test_runner');
await TestRunner.loadHTML(`
<p id="id">PASS</p>
`);
await TestRunner.addStylesheetTag('resources/decorations-after-inplace-formatter.css');
await TestRunner.addStylesheetTag('resources/long-mangled.css');
<script>
async function test() {
CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage();
......@@ -32,11 +34,4 @@ async function test() {
CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView);
TestRunner.completeTest();
}
</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>
\ No newline at end of file
})();
<html>
<head>
<script src="../../inspector/inspector-test.js"></script>
<script>
function initialize_SegmentsMerge() {
// 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.
InspectorTest.preloadModule("coverage");
(async function() {
TestRunner.addResult(`Tests the merge of disjoint segment lists in CoverageModel.\n`);
await TestRunner.loadModule('coverage');
}
function test() {
testAndDump([], []);
testAndDump([{end: 10, count: 1}], []);
testAndDump([{end: 10, count: 1}], [{end: 10, count: 1}]);
......@@ -46,13 +43,4 @@ function test() {
}
return true;
}
}
</script>
</head>
<body onload="runTest()">
<p>Tests the merge of disjoint segment lists in CoverageModel.</p>
</body>
</html>
})();
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment