Update web-platform-tests to revision 10168e9a5d44efbc6e7d416d1d454eb9c9f1396c

This commit is contained in:
Josh Matthews 2018-01-31 09:13:41 -05:00
parent c88dc51d03
commit 0e1caebaf4
791 changed files with 23381 additions and 5501 deletions

View file

@ -1,6 +1,10 @@
<!DOCTYPE html>
<html>
<body>
<div style="background: green; width: 100px; height: 100px"></div>
</body>
<canvas id="canvas" width="100" height="100"></canvas>
<script>
var canvas = document.getElementById("canvas");
var ctx = canvas.getContext('2d');
ctx.fillStyle = 'green';
ctx.fillRect(50, 50, 50, 50);
</script>
</html>

View file

@ -5,8 +5,7 @@
#output {
width: 100px;
height: 100px;
background-image: paint(error);
background-color: green;
background-image: paint(errorIndicator), paint(successIndicator);
}
</style>
<script src="/common/reftest-wait.js"></script>
@ -15,11 +14,20 @@
<div id="output"></div>
<script id="code" type="text/worklet">
registerPaint('error', class {
registerPaint('errorIndicator', class {
constructor() { throw Error('failed!'); }
// The paint function should not be executed because an error has been
// thrown.
paint(ctx, geom) {
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, geom.width, geom.height);
ctx.fillRect(0, 0, 50, 50);
}
});
registerPaint('successIndicator', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(50, 50, 50, 50);
}
});
</script>

View file

@ -5,8 +5,7 @@
#output {
width: 100px;
height: 100px;
background-image: paint(error);
background-color: green;
background-image: paint(errorIndicator), paint(successIndicator);
}
</style>
<script src="/common/reftest-wait.js"></script>
@ -15,13 +14,19 @@
<div id="output"></div>
<script id="code" type="text/worklet">
registerPaint('error', class {
registerPaint('errorIndicator', class {
paint(ctx, geom) {
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, geom.width, geom.height);
throw Error('failed!');
}
});
registerPaint('successIndicator', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, geom.width, geom.height);
}
});
</script>
<script>

View file

@ -5,16 +5,28 @@
#output {
width: 100px;
height: 100px;
background-image: paint(invalid);
background-color: green;
background-image: paint(invalid), paint(successIndicator);
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/css-paint-tests.js"></script>
<body>
<div id="output"></div>
<script id="code" type="text/worklet">
// This is testing that even though there is no paint function registered for
// 'invalid', it won't cause any error, and the other painter (successIndicator)
// will paint as usual.
registerPaint('successIndicator', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, geom.width, geom.height);
}
});
</script>
<script>
importPaintWorkletAndTerminateTestAfterAsyncPaint("");
importPaintWorkletAndTerminateTestAfterAsyncPaint(document.getElementById('code').textContent);
</script>
</body>
</html>

View file

@ -21,7 +21,7 @@ var testsPassed = false;
try {
registerPaint('foo7', class { });
} catch(ex) {
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' function on the prototype does not exist.")
if (ex.name == 'TypeError' && ex.message == "Failed to execute 'registerPaint' on 'PaintWorkletGlobalScope': The 'paint' property on the prototype does not exist.")
testsPassed = true;
}

View file

@ -1,15 +1,17 @@
<!DOCTYPE html>
<html>
<body>
<p>The test result should show only one black rect border. It should not paint
any content in the rect because registerPaint will be called twice and the
inputArguments will return two different strings, that will throw an exception
and paint won't be executed.</p>
<p>This test result should show a rect with black border, where the rect is
filled with green on the lower right corner. The registerPaint('failureIndicator')
will be called twice and the inputArguments will return two different strings,
which will throw an exception and the paint function with 'failureIndicator'
should never be called. In other words, there should be no red painted in the result.</p>
<canvas id ="canvas" width="100" height="100" style="border:1px solid black"></canvas>
<script>
var canvas = document.getElementById('canvas');
var context = canvas.getContext("2d");
context.clearRect(0, 0, 100, 100);
context.fillStyle = 'green'
context.fillRect(50, 50, 50, 50);
</script>
</body>
</html>

View file

@ -9,16 +9,17 @@
#canvas-geometry {
border:1px solid black;
background-image: paint(geometry);
background-image: paint(failureIndicator), paint(geometry);
}
</style>
<script src="/common/reftest-wait.js"></script>
<script src="/common/css-paint-tests.js"></script>
<body>
<p>The test result should show only one black rect border. It should not paint
any content in the rect because registerPaint will be called twice and the
inputArguments will return two different strings, that will throw an exception
and paint won't be executed.</p>
<p>This test result should show a rect with black border, where the rect is
filled with green on the lower right corner. The registerPaint('failureIndicator')
will be called twice and the inputArguments will return two different strings,
which will throw an exception and the paint function with 'failureIndicator'
should never be called. In other words, there should be no red painted in the result.</p>
<div id="canvas-geometry" class="container"></div>
<script id="code" type="text/worklet">
@ -31,7 +32,7 @@ function generateRandString(length) {
}
try {
registerPaint('geometry', class {
registerPaint('failureIndicator', class {
static get inputArguments() {
// This test is testing the case where an exception should be thrown
// when two paint definitions with different properties are registered
@ -42,14 +43,23 @@ try {
var current_str = generateRandString(100);
return [current_str];
}
// The paint function here should never be called because the inputArguments
// will generate two different properties, and that should throw an
// exception.
paint(ctx, geom) {
ctx.strokeStyle = 'red';
ctx.lineWidth = 4;
ctx.strokeRect(0, 0, geom.width, geom.height);
ctx.fillStyle = 'red';
ctx.fillRect(0, 0, 50, 50);
}
});
} catch(ex) {
}
registerPaint('geometry', class {
paint(ctx, geom) {
ctx.fillStyle = 'green';
ctx.fillRect(50, 50, 50, 50);
}
});
</script>
<script>

View file

@ -25,7 +25,7 @@ registerPaint('geometry', class {
'--bar',
'--foo',
'align-items',
'border-radius',
'border-top-left-radius',
];
}
paint(ctx, geom, styleMap) {
@ -41,13 +41,13 @@ registerPaint('geometry', class {
serializedStrings.push(serialized);
}
ctx.strokeStyle = 'green';
if (serializedStrings[0] != "--bar: [null]")
if (serializedStrings[0] != "--bar: [CSSUnparsedValue=]")
ctx.strokeStyle = 'red';
if (serializedStrings[1] != "--foo: [CSSUnparsedValue= bar]")
ctx.strokeStyle = 'blue';
if (serializedStrings[2] != "align-items: [CSSKeywordValue=normal]")
ctx.strokeStyle = 'yellow';
if (serializedStrings[3] != "border-radius: [CSSStyleValue=2px]")
if (serializedStrings[3] != "border-top-left-radius: [CSSUnitValue=2px]")
ctx.strokeStyle = 'cyan';
ctx.lineWidth = 4;
ctx.strokeRect(0, 0, geom.width, geom.height);

View file

@ -28,7 +28,7 @@ registerPaint('geometry', class {
return [
'--bar',
'--foo',
'border-radius',
'border-top-left-radius',
];
}
paint(ctx, geom, styleMap) {
@ -44,11 +44,11 @@ registerPaint('geometry', class {
serializedStrings.push(serialized);
}
ctx.strokeStyle = 'green';
if (serializedStrings[0] != "--bar: [null]")
if (serializedStrings[0] != "--bar: [CSSUnparsedValue=]")
ctx.strokeStyle = 'red';
if (serializedStrings[1] != "--foo: [CSSUnparsedValue= bar]")
ctx.strokeStyle = 'blue';
if (serializedStrings[2] != "border-radius: [CSSStyleValue=2px]")
if (serializedStrings[2] != "border-top-left-radius: [CSSUnitValue=2px]")
ctx.strokeStyle = 'yellow';
ctx.lineWidth = 4;
ctx.strokeRect(0, 0, geom.width, geom.height);