content/base/test/test_bug425013.html

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     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();">
    13 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=425013">Mozilla Bug 425013</a>
    14 <br>
    16 <script type="text/javascript;version=1.7">
    17 var missingPlugins = new Array();
    18 var OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent;
    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 }
    28 document.addEventListener("PluginBindingAttached", pluginBinding, true);
    29 </script>
    31 <object type="foo/bar" id="obj1"></object>
    33 <object type="foo/bar" id="obj2">
    34   <embed type="a/b" id="embed1"></embed>
    35 </object>
    37 <object type="foo/bar"
    38         data="data:foo/bar,bah" id="obj3">
    39 <param name="movie" value="data:foo/bar,bah">
    40 </object>
    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>
    48 <object type="text/html"
    49         data="data:text/html,an html document in an object tag" id="obj5">
    50 </object>
    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>
    57 <embed type="a/b" id="embed2"></embed>
    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;
    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");
    75     is(missingPlugins.length, 4, "Wrong number of missing plugins");
    77     SimpleTest.finish();
    78   });
    79 }
    81 SimpleTest.waitForExplicitFinish();
    82 </script>
    83 </pre>
    84 </body>
    85 </html>

mercurial