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 Tests the gutter decorations in target source code after ScriptFormatterEditorAction
0: + function outer(index) { 0: + function outer(index) {
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/debugger-test.js"></script>
<script src="../../inspector/sources-test.js"></script>
<script src="../resources/coverage-test.js"></script>
<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(); CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()'); await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage(); await CoverageTestRunner.stopCoverage();
...@@ -26,11 +28,4 @@ async function test() { ...@@ -26,11 +28,4 @@ async function test() {
await decoratorPromise; await decoratorPromise;
CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView); CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView);
TestRunner.completeTest(); 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. Tests the coverage highlight in sources after the recording finishes.
0: + body { 0: + body {
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/debugger-test.js"></script>
<script src="../resources/coverage-test.js"></script>
<link rel="stylesheet" type="text/css" href="resources/highlight-in-source.css"> (async function() {
<script> 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(); CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()'); await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage(); await CoverageTestRunner.stopCoverage();
await CoverageTestRunner.dumpDecorations('highlight-in-source.css'); await CoverageTestRunner.dumpDecorations('highlight-in-source.css');
TestRunner.completeTest(); 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. Tests the coverage highlight in sources after the recording finishes.
0: + function outer(index) { 0: + function outer(index) {
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/debugger-test.js"></script>
<script src="../resources/coverage-test.js"></script>
<script src="resources/coverage.js"></script>
<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(); CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()'); await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage(); await CoverageTestRunner.stopCoverage();
await CoverageTestRunner.dumpDecorations('coverage.js'); await CoverageTestRunner.dumpDecorations('coverage.js');
TestRunner.completeTest(); 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. Tests the CSS highlight in sources after the Pretty print formatting.
The below should be formatted The below should be formatted
......
<html> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script src="../../inspector/debugger-test.js"></script>
<script src="../../inspector/sources-test.js"></script>
<script src="../resources/coverage-test.js"></script>
<link rel="stylesheet" type="text/css" href="resources/decorations-after-inplace-formatter.css"> (async function() {
<link rel="stylesheet" type="text/css" href="resources/long-mangled.css"> 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(); CoverageTestRunner.startCoverage();
await TestRunner.evaluateInPagePromise('performActions()'); await TestRunner.evaluateInPagePromise('performActions()');
await CoverageTestRunner.stopCoverage(); await CoverageTestRunner.stopCoverage();
...@@ -32,11 +34,4 @@ async function test() { ...@@ -32,11 +34,4 @@ async function test() {
CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView); CoverageTestRunner.dumpDecorationsInSourceFrame(UI.panels.sources.visibleView);
TestRunner.completeTest(); 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> // Copyright 2017 The Chromium Authors. All rights reserved.
<head> // Use of this source code is governed by a BSD-style license that can be
<script src="../../inspector/inspector-test.js"></script> // found in the LICENSE file.
<script>
function initialize_SegmentsMerge() {
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([], []);
testAndDump([{end: 10, count: 1}], []); testAndDump([{end: 10, count: 1}], []);
testAndDump([{end: 10, count: 1}], [{end: 10, count: 1}]); testAndDump([{end: 10, count: 1}], [{end: 10, count: 1}]);
...@@ -46,13 +43,4 @@ function test() { ...@@ -46,13 +43,4 @@ function test() {
} }
return true; 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