5 <title>Test for drawSnapshot
</title>
6 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
7 <script src=
"/tests/SimpleTest/WindowSnapshot.js"></script>
8 <script type=
"application/javascript" src=
"file_drawWindow_common.js"></script>
9 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
10 <script type=
"application/javascript">
12 SimpleTest.waitForExplicitFinish();
13 window.addEventListener(
"load", runTests);
15 async function runTests(event) {
16 let snapshot = async function(context, x, y, width, height, bg) {
17 let elem = document.getElementById(
"source");
19 var rect = new window.DOMRect(x, y, width, height);
21 let image = await SpecialPowers.snapshotContext(elem, rect, bg);
22 context.drawImage(image,
0,
0);
25 // Run the tests with the source document in an
<iframe> within this
26 // page, which we expect to have transparency.
27 await runDrawWindowTests(snapshot, true);
35 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug
</a>
36 <iframe id=
"source" src=
"file_drawWindow_source.html" width=
"200" height=
"100"></iframe>