Source code

Revision control

Copy as Markdown

Other Tools

Test Info: Warnings

<!DOCTYPE HTML>
<html>
<head>
<title>Test for PaintWorklet</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
<script type="application/javascript" src="common.js"></script>
</head>
<body>
<script type="application/javascript">
function configureTest() {
const ConsoleAPIStorage = SpecialPowers.Cc[
"@mozilla.org/consoleAPI-storage;1"
].getService(SpecialPowers.Ci.nsIConsoleAPIStorage);
function observe(aSubject) {
var obj = aSubject.wrappedJSObject;
if (obj.arguments[0] == "So far so good") {
ok(true, "Message received \\o/");
ConsoleAPIStorage.removeLogEventListener(observe);
SimpleTest.finish();
}
}
ConsoleAPIStorage.addLogEventListener(observe, SpecialPowers.wrap(document).nodePrincipal);
return SpecialPowers.pushPrefEnv({ "set": [["dom.paintWorklet.enabled", true]] });
}
// This function is called into an iframe.
/* global paintWorklet */
function runTestInIframe() {
paintWorklet.addModule("worklet_paintWorklet.js")
}
</script>
</body>
</html>