Upstream version 7.36.149.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / plugins / windowless_plugin_paint_test.html
1 <!DOCTYPE html>
2
3 <html>
4 <head>
5   <script>
6     if (window.testRunner) {
7         testRunner.dumpAsText();
8         testRunner.waitUntilDone();
9     }
10
11     var paintCount = 0;
12
13     function onLoad() {
14         var pluginDiv = document.getElementById("pluginDiv");
15         // Create the plugin in the middle of the page.
16         pluginDiv.innerHTML = "<embed id=\"testPlugin\" type=\"application/x-webkit-test-netscape\" width=\"200\" height=\"200\" onpaintevent=\"didPaint()\" windowedPlugin=\"false\"></embed>";
17         if (window.internals)
18             internals.updateLayoutIgnorePendingStylesheetsAndRunPostLayoutTasks();
19         testRunner.displayAsync();
20       }
21
22     function notifyDone() {
23         document.getElementById('result').innerHTML = "SUCCESS";
24         testRunner.notifyDone();
25     }
26       
27     function didPaint() {
28         paintCount++;
29         setTimeout("notifyDone();", 50);
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>