Bug 1928997: Update tabs icon in Unified Search popup r=desktop-theme-reviewers,daleh...
[gecko.git] / dom / canvas / test / test_drawWindow.html
blobf00d8f285d7328a1d33fa37fe5dea1a0bca6edc0
1 <!DOCTYPE HTML>
2 <html>
3 <head>
4 <meta charset="utf-8">
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);
15 var sourceWindow;
17 function openSourceWindow(event) {
18 if (event.target != document) {
19 return;
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) {
29 return;
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.
43 win = sourceWindow;
44 await runDrawWindowTests(snapshot, false);
46 sourceWindow.close();
48 SimpleTest.finish();
51 </script>
52 </head>
53 <body>
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>
56 </body>
57 </html>