Commit d839e656 authored by Tim van der Lippe's avatar Tim van der Lippe Committed by Chromium LUCI CQ

Remove DevTools HTML pretty printing layout tests

They are replaced by Karma unit tests in https://crrev.com/c/2581919

R=aerotwist@chromium.org

Bug: 1024752
Change-Id: I0222c355d2a57848716772b1be7bbfa72a3019b6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2581922
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Commit-Queue: Yang Guo <yangguo@chromium.org>
Reviewed-by: default avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835605}
parent 662332c4
Verifies JavaScript pretty-printing functionality.
Running: simpleHTML
====== 8< ------
<html>
<head>
<title>test</title>
</head>
</html>
------ >8 ======
Correct mapping for <</head>>
Correct mapping for <test>
Correct mapping for <</title>>
Running: selfClosingTags
====== 8< ------
<html>
<head>
<meta>
</head>
<img>
<hr/>
</html>
------ >8 ======
Correct mapping for <meta>
Correct mapping for <hr>
Correct mapping for <<html>>
Correct mapping for <</html>>
Running: erroneousSelfClosingTags
====== 8< ------
<head>
<meta>
<meta></meta>
<br/></br>
<link></link>
<title>test</title>
</head>
------ >8 ======
Correct mapping for <<br/>>
Correct mapping for <<title>>
Correct mapping for <test>
Correct mapping for <</head>>
Running: testAttributes
====== 8< ------
<body>
<canvas width=100 height=100 data-bad-attr='</canvas>'></canvas>
</body>
------ >8 ======
Correct mapping for <<body>>
Correct mapping for <width>
Correct mapping for <height>
Correct mapping for <</body>>
Running: testCustomElements
====== 8< ------
<body>
<custom-time year=2016 day=1 month=1>
<div>minutes/seconds</div>
</custom-time>
</body>
------ >8 ======
Correct mapping for <<body>>
Correct mapping for <custom-time>
Correct mapping for <year>
Correct mapping for <month>
Correct mapping for <</body>>
// 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(`Verifies JavaScript pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
var testFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/html');
TestRunner.runTestSuite([
function simpleHTML(next) {
var mappingQueries = ['</head>', 'test', '</title>'];
testFormatter('<html><head><title>test</title></head></html>', mappingQueries, next);
},
function selfClosingTags(next) {
var mappingQueries = ['meta', 'hr', '<html>', '</html>'];
testFormatter('<html><head><meta></head><img><hr/></html>', mappingQueries, next);
},
function erroneousSelfClosingTags(next) {
var mappingQueries = ['<br/>', '<title>', 'test', '</head>'];
testFormatter('<head><meta><meta></meta><br/></br><link></link><title>test</title></head>', mappingQueries, next);
},
function testAttributes(next) {
var mappingQueries = ['<body>', 'width', 'height', '</body>'];
testFormatter(
'<body><canvas width=100 height=100 data-bad-attr=\'</canvas>\'></canvas></body>', mappingQueries, next);
},
function testCustomElements(next) {
var mappingQueries = ['<body>', 'custom-time', 'year', 'month', '</body>'];
testFormatter(
'<body><custom-time year=2016 day=1 month=1><div>minutes/seconds</div></custom-time></body>', mappingQueries,
next);
}
]);
})();
Verifies JavaScript pretty-printing functionality.
Running: testDocType
====== 8< ------
<!DOCTYPE HTML>
<body>hello, world</body>
------ >8 ======
Correct mapping for <<body>>
Correct mapping for <hello>
Correct mapping for <</body>>
Running: testComment
====== 8< ------
<!-- comment 1 -->
<html>
<!-- comment 2-->
<meta/>
<body>
<!-- comment 3-->
<a>link</a>
</body>
</html>
------ >8 ======
Correct mapping for <<body>>
Correct mapping for <comment 1>
Correct mapping for <comment 2>
Correct mapping for <comment 3>
Correct mapping for <link>
Running: testNonJavascriptScriptTag
====== 8< ------
<div>
<script type='text/K'>
2_&{&/x!/:2_!x}'!R
</script>
</div>
------ >8 ======
Correct mapping for <type>
Correct mapping for <R>
Correct mapping for <</div>>
Correct mapping for <</script>>
Running: testList
====== 8< ------
<ul>
<li>foo
<li>
hello <b>world</b>
!
<li>
hello <b>world</b>
<b>i'm here</b>
<li>bar
<li>baz
<li>
hello <b>world</b>
<li>another
</ul>
------ >8 ======
Correct mapping for <foo>
Correct mapping for <bar>
Correct mapping for <baz>
Correct mapping for <hello>
Correct mapping for <world>
Correct mapping for <another>
Running: testAutomaticClosingTags
====== 8< ------
<a>
aaaa
<b>
bbbb1
<c>
cccc<d>dddd
</c>
bbbb2
</a>
------ >8 ======
Correct mapping for <aaaa>
Correct mapping for <bbbb1>
Correct mapping for <bbbb2>
Correct mapping for <cccc>
Correct mapping for <dddd>
// 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(`Verifies JavaScript pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
var testFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/html');
TestRunner.runTestSuite([
function testDocType(next) {
var mappingQueries = ['<body>', 'hello', '</body>'];
testFormatter('<!DOCTYPE HTML><body>hello, world</body>', mappingQueries, next);
},
function testComment(next) {
var mappingQueries = ['<body>', 'comment 1', 'comment 2', 'comment 3', 'link'];
testFormatter(
'<!-- comment 1 --><html><!-- comment 2--><meta/><body><!-- comment 3--><a>link</a></body></html>',
mappingQueries, next);
},
function testNonJavascriptScriptTag(next) {
var mappingQueries = ['type', 'R', '</div>', '<\/script>'];
testFormatter('<div><script type=\'text/K\'>2_&{&/x!/:2_!x}\'!R<\/script></div>', mappingQueries, next);
},
function testList(next) {
var mappingQueries = ['foo', 'bar', 'baz', 'hello', 'world', 'another'];
testFormatter(
'<ul><li>foo<li> hello <b>world</b>!<li> hello <b>world</b> <b>i\'m here</b><li>bar<li>baz<li>hello <b>world</b><li>another</ul>',
mappingQueries, next);
},
function testAutomaticClosingTags(next) {
var mappingQueries = ['aaaa', 'bbbb1', 'bbbb2', 'cccc', 'dddd'];
testFormatter('<a>aaaa<b>bbbb1<c>cccc<d>dddd</c>bbbb2</a>', mappingQueries, next);
},
]);
})();
Verifies JavaScript pretty-printing functionality.
Running: testLinkFollowedByComment
====== 8< ------
<link href='a/b/c.css' rel='stylesheet'>
<!-- some comment -->
------ >8 ======
Correct mapping for <stylesheet>
Correct mapping for <some>
Correct mapping for <comment>
Running: testInlineJavascript
====== 8< ------
<html>
<script type="text/javascript">
for (var i = 0; i < 10; ++i)
console.log('test ' + i);
</script>
</html>
------ >8 ======
Correct mapping for <console>
Correct mapping for <test>
Correct mapping for <</html>
Running: testInlineCSS
====== 8< ------
<html>
<style>
div {
color: red;
border: 1px solid black;
}
</style>
</html>
------ >8 ======
Correct mapping for <<html>>
Correct mapping for <red>
Correct mapping for <black>
Running: testMultilineInput
====== 8< ------
<html>
<head>
<meta name="ROBOTS" content="NOODP">
<meta name='viewport' content='text/html'>
<title>foobar</title>
<body>
<script>
if (1 < 2) {
if (2 < 3) {
if (3 < 4) {
if (4 < 5) {
console.log("magic")
}
}
}
}
</script>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...">
<style>
div {
display: flex;
align-items: center;
justify-content: center;
}
body {
width: 100%
}
* {
border: 1px solid black
}
</style>
</body>
</html>
------ >8 ======
Correct mapping for <ROBOTS>
Correct mapping for <image>
Correct mapping for <...>
Correct mapping for <</body>>
Correct mapping for <</html>>
Correct mapping for <</style>>
// 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(`Verifies JavaScript pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
var testFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/html');
TestRunner.runTestSuite([
function testLinkFollowedByComment(next) {
var mappingQueries = ['stylesheet', 'some', 'comment'];
testFormatter('<link href=\'a/b/c.css\' rel=\'stylesheet\'><!-- some comment -->', mappingQueries, next);
},
function testInlineJavascript(next) {
var mappingQueries = ['console', 'test', '</html'];
testFormatter(
'<html><script type="text/javascript">for(var i=0;i<10;++i)console.log(\'test \'+i);<\/script></html>',
mappingQueries, next);
},
function testInlineCSS(next) {
var mappingQueries = ['<html>', 'red', 'black'];
testFormatter('<html><style>div{color:red;border:1px solid black;}</style></html>', mappingQueries, next);
},
function testMultilineInput(next) {
var html = `<html>
<head>
<meta name=\"ROBOTS\" content=\"NOODP\">
<meta name='viewport' content='text/html'>
<title>foobar</title>
<body>
<script>if(1<2){if(2<3){if(3<4){if(4<5){console.log("magic")}}}}<\/script>
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIA...">
<style>div{display:flex;align-items:center;justify-content:center;}body{width:100%}*{border:1px solid black}</style>
</body>
</html>
`;
var mappingQueries = ['ROBOTS', 'image', '...', '</body>', '</html>', '</style>'];
testFormatter(html, mappingQueries, next);
},
]);
})();
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