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

Remove DevTools CSS pretty print tests

These are replaced by Karma tests in https://crrev.com/c/2577572

R=aerotwist@chromium.org

Bug: 1024752
Change-Id: I6faf792691cdfc0bd9aa657c3be0e6b159f254f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2577473
Auto-Submit: Tim van der Lippe <tvanderlippe@chromium.org>
Reviewed-by: default avatarPaul Lewis <aerotwist@chromium.org>
Commit-Queue: Tim van der Lippe <tvanderlippe@chromium.org>
Cr-Commit-Position: refs/heads/master@{#835167}
parent 2d219db3
Verifies CSS pretty-printing functionality.
Running: testSimpleCSS
====== 8< ------
a {
/* pre-comment */
color /* after name */ : /* before value */ red /* post-comment */
}
------ >8 ======
Correct mapping for <pre-comment>
Correct mapping for <post-comment>
Running: testComplexCSS
====== 8< ------
@media screen {
html {
color: green;
foo-property: bar-value
}
}
}
body {
background-color: black;
}
------ >8 ======
Correct mapping for <@media>
Correct mapping for <screen>
Correct mapping for <html>
Correct mapping for <color>
Correct mapping for <green>
Correct mapping for <foo-property>
Correct mapping for <bar-value>
Correct mapping for <body>
Correct mapping for <background>
Correct mapping for <black>
Running: testFormatInlinedStyles
====== 8< ------
<html>
<body>
<style>
@-webkit-keyframes {
from {
left: 0
}
to {
left: 100px;
}
}
</style>
<style>
badbraces {
}
}
@media screen {
a.b {
color: red;
text-decoration: none
}
}
</style>
</body>
</html>
------ >8 ======
Running: testNonZeroLineMapping
====== 8< ------
div {
color: red;
}
------ >8 ======
Correct mapping for <div>
Correct mapping for <color>
Correct mapping for <red>
Running: testComplexSelector
====== 8< ------
a.b.c:hover,.d.e.f.g::before,h.i {
color: red;
}
------ >8 ======
Correct mapping for <a>
Correct mapping for <.b>
Correct mapping for <.c>
Correct mapping for <.d>
Correct mapping for <.e>
Correct mapping for <.f>
Correct mapping for <.g>
Correct mapping for <h>
Correct mapping for <.i>
Correct mapping for <color>
Correct mapping for <red>
// 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 CSS pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.addStylesheetTag('resources/style-formatter-obfuscated.css');
var testCSSFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/css');
TestRunner.runTestSuite([
function testSimpleCSS(next) {
var content = 'a { /* pre-comment */ color /* after name */ : /* before value */ red /* post-comment */ }';
testCSSFormatter(content, ['pre-comment', 'post-comment'], next);
},
function testComplexCSS(next) {
SourcesTestRunner.showScriptSource('style-formatter-obfuscated.css', didShowScriptSource);
function didShowScriptSource(sourceFrame) {
var mappingQueries = [
'@media',
'screen',
'html',
'color',
'green',
'foo-property',
'bar-value',
'body',
'background',
'black',
];
testCSSFormatter(sourceFrame._textEditor.text(), mappingQueries, next);
}
},
function testFormatInlinedStyles(next) {
var content =
'<html><body><style>@-webkit-keyframes{from{left: 0} to{left:100px;}}</style><style>badbraces { }} @media screen{a.b{color:red;text-decoration: none}}</style></body></html>';
SourcesTestRunner.testPrettyPrint('text/html', content, [], next);
},
function testNonZeroLineMapping(next) {
var mappingQueries = ['div', 'color', 'red'];
testCSSFormatter('\n\ndiv { color: red; }', mappingQueries, next);
},
function testComplexSelector(next) {
var css = 'a.b.c:hover,.d.e.f.g::before,h.i{color:red;}';
var mappingQueries = ['a', '.b', '.c', '.d', '.e', '.f', '.g', 'h', '.i', 'color', 'red'];
testCSSFormatter(css, mappingQueries, next);
},
]);
})();
Verifies CSS pretty-printing functionality.
Running: testFontFace
====== 8< ------
@font-face {
font-family: MyHelvetica;
src: local('Helvetica Neue Bold'),local('HelveticaNeue-Bold'),url(MgOpenModernaBold.ttf);
font-weight: bold;
}
div {
color: red
}
------ >8 ======
Correct mapping for <font-face>
Correct mapping for <red>
Running: testCharsetRule
====== 8< ------
@charset 'iso-8859-15';p {
margin: 0
}
------ >8 ======
Correct mapping for <charset>
Correct mapping for <iso>
Correct mapping for <margin>
Running: testImportRule
====== 8< ------
@import url('bluish.css') projection,tv;span {
border: 1px solid black
}
------ >8 ======
Correct mapping for <import>
Correct mapping for <bluish>
Correct mapping for <projection>
Correct mapping for <span>
Correct mapping for <border>
Correct mapping for <black>
Running: testImportWithMediaQueryRule
====== 8< ------
@import url('landscape.css') screen and (orientation: landscape);
article {
background: yellow
}
------ >8 ======
Correct mapping for <import>
Correct mapping for <url>
Correct mapping for <orientation>
Correct mapping for <article>
Correct mapping for <background>
Correct mapping for <yellow>
Running: testKeyframesRule
====== 8< ------
p {
animation-duration: 3s;
}
@keyframes slidein {
from {
margin-left: 100%;
width: 300%;
}
to {
margin-left: 0%;
width: 100%;
}
}
p {
animation-name: slidein
}
------ >8 ======
Correct mapping for <animation-duration>
Correct mapping for <3s>
Correct mapping for <keyframes>
Correct mapping for <from>
Correct mapping for <300%>
Correct mapping for <animation-name>
// 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 CSS pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.addStylesheetTag('resources/style-formatter-obfuscated.css');
var testCSSFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/css');
TestRunner.runTestSuite([
function testFontFace(next) {
var css =
'@font-face{font-family:MyHelvetica;src:local(\'Helvetica Neue Bold\'),local(\'HelveticaNeue-Bold\'),url(MgOpenModernaBold.ttf);font-weight:bold;}div{color:red}';
var mappingQueries = ['font-face', 'red'];
testCSSFormatter(css, mappingQueries, next);
},
function testCharsetRule(next) {
var css = '@charset \'iso-8859-15\';p{margin:0}';
var mappingQueries = ['charset', 'iso', 'margin'];
testCSSFormatter(css, mappingQueries, next);
},
function testImportRule(next) {
var css = '@import url(\'bluish.css\') projection,tv;span{border:1px solid black}';
var mappingQueries = ['import', 'bluish', 'projection', 'span', 'border', 'black'];
testCSSFormatter(css, mappingQueries, next);
},
function testImportWithMediaQueryRule(next) {
var css = '@import url(\'landscape.css\') screen and (orientation:landscape);article{background:yellow}';
var mappingQueries = ['import', 'url', 'orientation', 'article', 'background', 'yellow'];
testCSSFormatter(css, mappingQueries, next);
},
function testKeyframesRule(next) {
var css =
'p{animation-duration:3s;}@keyframes slidein{from{margin-left:100%;width:300%;}to{margin-left:0%;width:100%;}}p{animation-name:slidein}';
var mappingQueries = ['animation-duration', '3s', 'keyframes', 'from', '300%', 'animation-name'];
testCSSFormatter(css, mappingQueries, next);
},
]);
})();
Verifies CSS pretty-printing functionality.
Running: testMediaRule
====== 8< ------
@media screen,print {
body {
line-height: 1.2
}
}
span {
line-height: 10px
}
------ >8 ======
Correct mapping for <@media>
Correct mapping for <screen>
Correct mapping for <print>
Correct mapping for <body>
Correct mapping for <line-height>
Correct mapping for <1.2>
Running: testNamespaceRule
====== 8< ------
@namespace svg url(http://www.w3.org/2000/svg);g {
color: red
}
------ >8 ======
Correct mapping for <namespace>
Correct mapping for <url>
Correct mapping for <color>
Correct mapping for <red>
Running: testPageRule
====== 8< ------
@page :first {
margin: 2in 3in;
}
span {
color: blue
}
------ >8 ======
Correct mapping for <page>
Correct mapping for <first>
Correct mapping for <margin>
Correct mapping for <3in>
Running: testSupportsRule
====== 8< ------
@supports(--foo:green) {
body {
color: green;
}
}
#content {
font-size: 14px
}
------ >8 ======
Correct mapping for <supports>
Correct mapping for <foo>
Correct mapping for <body>
Correct mapping for <color>
// 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 CSS pretty-printing functionality.\n`);
await TestRunner.loadModule('sources_test_runner');
await TestRunner.showPanel('sources');
await TestRunner.addStylesheetTag('resources/style-formatter-obfuscated.css');
var testCSSFormatter = SourcesTestRunner.testPrettyPrint.bind(SourcesTestRunner, 'text/css');
TestRunner.runTestSuite([
function testMediaRule(next) {
var css = '@media screen,print{body{line-height:1.2}}span{line-height:10px}';
var mappingQueries = ['@media', 'screen', 'print', 'body', 'line-height', '1.2'];
testCSSFormatter(css, mappingQueries, next);
},
function testNamespaceRule(next) {
var css = '@namespace svg url(http://www.w3.org/2000/svg);g{color:red}';
var mappingQueries = ['namespace', 'url', 'color', 'red'];
testCSSFormatter(css, mappingQueries, next);
},
function testPageRule(next) {
var css = '@page :first{margin:2in 3in;}span{color:blue}';
var mappingQueries = ['page', 'first', 'margin', '3in'];
testCSSFormatter(css, mappingQueries, next);
},
function testSupportsRule(next) {
var css = '@supports(--foo:green){body{color:green;}}#content{font-size:14px}';
var mappingQueries = ['supports', 'foo', 'body', 'color'];
testCSSFormatter(css, 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