Improve text-shadow tests

This commit is contained in:
Niklas von Hertzen 2015-01-13 22:50:57 +02:00
parent 7a58ad019f
commit 2699670bf1
2 changed files with 26 additions and 5 deletions

View File

@ -5,17 +5,39 @@
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="../../test.js"></script>
<style>
span{
.shadow1 span{
text-shadow: 1px 1px 3px #888;
}
strong {
.shadow1 strong {
text-shadow: 1px 1px 2px black, 0 0 1em blue, 0 0 0.2em blue;
}
.shadow2 {
font-size: 48px;
}
.shadow2 span{
color: transparent;
text-shadow: 0 0 5px #00f, 2px 2px 0 #f00;
}
.shadow2 strong {
color: rgba(0, 255, 0, 0.5);
text-shadow: 0 0 5px #00f, 2px 2px 0 #f00;
text-decoration: underline;
}
</style>
</head>
<body>
Some text <span> followed by text with shadow </span> followed by more text without shadow.
<strong>Multi text shadow</strong> and some more text without shadow
<div class="shadow1">
Some text <span> followed by text with shadow </span> followed by more text without shadow.
<strong>Multi text shadow</strong> and some more text without shadow
</div>
<div class="shadow2">
<span>testing with transparent</span>
<strong>testing with low opacity</strong>
</div>
</body>
</html>

View File

@ -113,7 +113,6 @@
var data = ctx.getImageData(0, 0, canvas.width, canvas.height).data;
for (var i = 0, len = data.length; i < len; i+=4) {
if (data[i] !== 0 || data[i+1] !== 128 || data[i+2] !== 0 || data[i+3] !== 255) {
console.log(i,data[i], data[i+1], data[i+2], data[i+3]);
expect().fail("Invalid canvas data");
}
}