Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Alan Jeffrey
committed
Jun 7, 2017
1 parent
7d74ebe
commit e8db3ea
Showing
4 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |
6 changes: 6 additions & 0 deletions
6
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
registerPaint("test", class { | ||
paint(ctx, size) { | ||
ctx.fillStyle = 'green'; | ||
ctx.fillRect(0, 0, size.width, size.height); | ||
} | ||
}); |
6 changes: 6 additions & 0 deletions
6
tests/wpt/mozilla/tests/mozilla/worklets/test_paint_worklet_ref.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<!doctype html> | ||
<html> | ||
<body> | ||
<div style="height: 100px; width: 100px; background: green;"></div> | ||
</body> | ||
</html> |