content/base/test/test_bug425013.html

Thu, 15 Jan 2015 21:03:48 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 21:03:48 +0100
branch
TOR_BUG_9701
changeset 11
deefc01c0e14
permissions
-rw-r--r--

Integrate friendly tips from Tor colleagues to make (or not) 4.5 alpha 3;
This includes removal of overloaded (but unused) methods, and addition of
a overlooked call to DataStruct::SetData(nsISupports, uint32_t, bool.)

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

mercurial