c8a9c5b5b42a060147f7c6681fe7b985eb1938bc
[WebKit-https.git] / LayoutTests / plugins / windowless_plugin_paint_test.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5   <script>\r
6     if (window.testRunner) {\r
7         testRunner.dumpAsText();\r
8         testRunner.waitUntilDone();\r
9     }
10
11     var paintCount = 0;\r
12 \r
13     function onLoad() {\r
14         var pluginDiv = document.getElementById("pluginDiv");\r
15         // Create the plugin in the middle of the page.\r
16         pluginDiv.innerHTML = "<embed id=\"testPlugin\" type=\"application/x-webkit-test-netscape\" width=\"200\" height=\"200\" onpaintevent=\"didPaint()\" windowedPlugin=\"false\"></embed>";\r
17         if (window.internals)\r
18             internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();\r
19         testRunner.displayInvalidatedRegion();\r
20       }\r
21 \r
22     function notifyDone() {\r
23         document.getElementById('result').innerHTML = "SUCCESS";\r
24         testRunner.notifyDone();\r
25     }\r
26       \r
27     function didPaint() {\r
28         paintCount++;\r
29         setTimeout("notifyDone();", 50);\r
30     }
31   </script>
32 </head>
33 <body onload="setTimeout(onLoad(), 50);">
34   This tests that dynamically added windowless plugins receive paint events on creation.
35
36   <div id="result">FAILURE</div>
37
38   <div id="pluginDiv" style="position: absolute; left: 300px; top: 300px; height: 400px; width: 400px; padding: 1em;">
39   </div>
40 </body>
41 </html>