|
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="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script> |
|
7 <script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script> |
|
8 <script type="application/javascript" src="file_drawWindow_common.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="chrome://mochikit/content/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 // Need to open as a toplevel chrome window so that |
|
23 // DRAWWINDOW_USE_WIDGET_LAYERS is honored. |
|
24 sourceWindow = window.open("file_drawWindow_source.html", "", |
|
25 "chrome,width=200,height=100"); |
|
26 sourceWindow.addEventListener("load", runTests, false); |
|
27 } |
|
28 |
|
29 function runTests(event) { |
|
30 if (event.target != sourceWindow.document) { |
|
31 return; |
|
32 } |
|
33 |
|
34 var cxInterfaceWrap = SpecialPowers.wrap(CanvasRenderingContext2D); |
|
35 var flags = cxInterfaceWrap.DRAWWINDOW_USE_WIDGET_LAYERS | |
|
36 cxInterfaceWrap.DRAWWINDOW_DRAW_CARET | |
|
37 cxInterfaceWrap.DRAWWINDOW_DRAW_VIEW; |
|
38 runDrawWindowTests(sourceWindow, flags, true); |
|
39 |
|
40 sourceWindow.close(); |
|
41 |
|
42 SimpleTest.finish(); |
|
43 } |
|
44 |
|
45 </script> |
|
46 </head> |
|
47 <body> |
|
48 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=">Mozilla Bug </a> |
|
49 </body> |
|
50 </html> |