|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <head> |
|
4 <meta charset="utf-8"> |
|
5 <title>Test for canvas drawWindow</title> |
|
6 <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <script type="application/javascript" 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"> |
|
11 |
|
12 SimpleTest.waitForExplicitFinish(); |
|
13 window.addEventListener("load", openSourceWindow, false); |
|
14 |
|
15 var sourceWindow; |
|
16 |
|
17 function openSourceWindow(event) { |
|
18 if (event.target != document) { |
|
19 return; |
|
20 } |
|
21 |
|
22 sourceWindow = window.open("file_drawWindow_source.html", "", |
|
23 "width=200,height=100"); |
|
24 sourceWindow.addEventListener("load", runTests, false); |
|
25 } |
|
26 |
|
27 function runTests(event) { |
|
28 if (event.target != sourceWindow.document) { |
|
29 return; |
|
30 } |
|
31 |
|
32 // Run the tests with the source document in an <iframe> within this |
|
33 // page, which we expect to have transparency. |
|
34 runDrawWindowTests(document.getElementById("source").contentWindow, |
|
35 0, true); |
|
36 |
|
37 // Run the tests on the same source document, but in a window opened |
|
38 // by window.open. We do not expect this to have transparency... |
|
39 // except on B2G. (This is *probably* a bug in B2G.) |
|
40 var isB2G = /Mobile|Tablet/.test(navigator.userAgent) && |
|
41 !navigator.userAgent.contains("Android"); |
|
42 runDrawWindowTests(sourceWindow, 0, isB2G); |
|
43 |
|
44 sourceWindow.close(); |
|
45 |
|
46 SimpleTest.finish(); |
|
47 } |
|
48 |
|
49 </script> |
|
50 </head> |
|
51 <body> |
|
52 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> |
|
53 <iframe id="source" src="file_drawWindow_source.html" width="200" height="100"></iframe> |
|
54 </body> |
|
55 </html> |