|
1 <!DOCTYPE HTML> |
|
2 <html> |
|
3 <!-- |
|
4 https://bugzilla.mozilla.org/show_bug.cgi?id=425013 |
|
5 --> |
|
6 <head> |
|
7 <title>Test for Bug 425013</title> |
|
8 <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
|
9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
|
10 </head> |
|
11 <body onload="runtests();"> |
|
12 |
|
13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=425013">Mozilla Bug 425013</a> |
|
14 <br> |
|
15 |
|
16 <script type="text/javascript;version=1.7"> |
|
17 var missingPlugins = new Array(); |
|
18 var OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent; |
|
19 |
|
20 function pluginBinding(event) |
|
21 { |
|
22 var plugin = event.target; |
|
23 plugin instanceof OBJLC; |
|
24 if (SpecialPowers.wrap(plugin).pluginFallbackType == OBJLC.PLUGIN_UNSUPPORTED) |
|
25 missingPlugins.push(plugin); |
|
26 } |
|
27 |
|
28 document.addEventListener("PluginBindingAttached", pluginBinding, true); |
|
29 </script> |
|
30 |
|
31 <object type="foo/bar" id="obj1"></object> |
|
32 |
|
33 <object type="foo/bar" id="obj2"> |
|
34 <embed type="a/b" id="embed1"></embed> |
|
35 </object> |
|
36 |
|
37 <object type="foo/bar" |
|
38 data="data:foo/bar,bah" id="obj3"> |
|
39 <param name="movie" value="data:foo/bar,bah"> |
|
40 </object> |
|
41 |
|
42 <object type="foo/bar" |
|
43 data="data:foo/bar,bah" id="obj4"> |
|
44 <param name="movie" value="data:foo/bar,bah"> |
|
45 <p>Alternate content</p> |
|
46 </object> |
|
47 |
|
48 <object type="text/html" |
|
49 data="data:text/html,an html document in an object tag" id="obj5"> |
|
50 </object> |
|
51 |
|
52 <object type="text/html" |
|
53 data="data:text/html,an html document in an object tag" id="obj6"> |
|
54 <p>Alternate content</p> |
|
55 </object> |
|
56 |
|
57 <embed type="a/b" id="embed2"></embed> |
|
58 |
|
59 <script class="testbody" type="text/javascript"> |
|
60 function runtests() |
|
61 { |
|
62 // Force layout flush so the binding is attached and the event is fired |
|
63 document.getElementById("obj1").clientTop; |
|
64 document.getElementById("obj3").clientTop; |
|
65 document.getElementById("embed1").clientTop; |
|
66 document.getElementById("embed2").clientTop; |
|
67 |
|
68 // Let pending events flush |
|
69 SimpleTest.executeSoon(function () { |
|
70 ok(missingPlugins.indexOf(document.getElementById("obj1")) >= 0, "Missing plugin element obj1"); |
|
71 ok(missingPlugins.indexOf(document.getElementById("embed1")) >= 0, "Missing plugin element embed1"); |
|
72 ok(missingPlugins.indexOf(document.getElementById("embed2")) >= 0, "Missing plugin element embed2"); |
|
73 ok(missingPlugins.indexOf(document.getElementById("obj3")) >= 0, "Missing plugin element obj3"); |
|
74 |
|
75 is(missingPlugins.length, 4, "Wrong number of missing plugins"); |
|
76 |
|
77 SimpleTest.finish(); |
|
78 }); |
|
79 } |
|
80 |
|
81 SimpleTest.waitForExplicitFinish(); |
|
82 </script> |
|
83 </pre> |
|
84 </body> |
|
85 </html> |