5 <title>Test for canvas drawWindow
</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", openSourceWindow);
17 function openSourceWindow(event) {
18 if (event.target != document) {
22 sourceWindow = window.open(
"file_drawWindow_source.html",
"",
23 "width=200,height=100");
24 sourceWindow.addEventListener(
"load", runTests);
27 async function runTests(event) {
28 if (event.target != sourceWindow.document) {
32 let win = document.getElementById(
"source").contentWindow;
33 let snapshot = function(context, x, y, width, height, bg) {
34 context.drawWindow(win, x, y, width, height, bg,
0);
37 // Run the tests with the source document in an
<iframe> within this
38 // page, which we expect to have transparency.
39 await runDrawWindowTests(snapshot, true);
41 // Run the tests on the same source document, but in a window opened
42 // by window.open. We do not expect this to have transparency.
44 await runDrawWindowTests(snapshot, false);
54 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug
</a>
55 <iframe id=
"source" src=
"file_drawWindow_source.html" width=
"200" height=
"100"></iframe>