Skip to content

Commit

Permalink
Added a reftest.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alan Jeffrey committed Jun 7, 2017
1 parent 7d74ebe commit e8db3ea
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 0 deletions.
34 changes: 34 additions & 0 deletions tests/wpt/mozilla/meta/MANIFEST.json
Expand Up @@ -6736,6 +6736,18 @@
],
{}
]
],
"mozilla/worklets/test_paint_worklet.html": [
[
"/_mozilla/mozilla/worklets/test_paint_worklet.html",
[
[
"/_mozilla/mozilla/worklets/test_paint_worklet_ref.html",
"=="
]
],
{}
]
]
},
"reftest_node": {
Expand Down Expand Up @@ -11208,6 +11220,16 @@
{}
]
],
"mozilla/worklets/test_paint_worklet.js": [
[
{}
]
],
"mozilla/worklets/test_paint_worklet_ref.html": [
[
{}
]
],
"mozilla/worklets/test_worklet.js": [
[
{}
Expand Down Expand Up @@ -31775,6 +31797,18 @@
"f3a9b8c78346507bc0b3190c8000ccf80cc133f6",
"support"
],
"mozilla/worklets/test_paint_worklet.html": [
"67fccbde17c28e13b5f4dc54d70b1279d6e9d602",
"reftest"
],
"mozilla/worklets/test_paint_worklet.js": [
"e714db50da9e5cb18c652629fcc1b5ccc453564d",
"support"
],
"mozilla/worklets/test_paint_worklet_ref.html": [
"e9cfa945824a8ecf07c41a269f82a2c2ca002406",
"support"
],
"mozilla/worklets/test_worklet.html": [
"fe9c93a5307c616f878b6623155e1b04c86dd994",
"testharness"
Expand Down
18 changes: 18 additions & 0 deletions tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet.html
@@ -0,0 +1,18 @@
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset=utf-8>
<title>A basic paint worklet test</title>
<link rel=match href=/_mozilla/mozilla/worklets/test_paint_worklet_ref.html>
</head>
<body>
<div style="height: 100px; width: 100px; background: paint(test);"></div>
</body>
<script>
// This reftest will TIMEOUT if loading the paint worklet fails,
// It will PASS if the worklet draws a green rectangle.
window.paintWorklet
.addModule("test_paint_worklet.js")
.then(function() { document.documentElement.classList.remove("reftest-wait"); });
</script>
</html>
@@ -0,0 +1,6 @@
registerPaint("test", class {
paint(ctx, size) {
ctx.fillStyle = 'green';
ctx.fillRect(0, 0, size.width, size.height);
}
});
@@ -0,0 +1,6 @@
<!doctype html>
<html>
<body>
<div style="height: 100px; width: 100px; background: green;"></div>
</body>
</html>

0 comments on commit e8db3ea

Please sign in to comment.