content/base/test/test_bug425013.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug425013.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,85 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=425013
     1.8 +-->
     1.9 +<head>
    1.10 +  <title>Test for Bug 425013</title>
    1.11 +  <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.12 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
    1.13 +</head>
    1.14 +<body onload="runtests();">
    1.15 +
    1.16 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=425013">Mozilla Bug 425013</a>
    1.17 +<br>
    1.18 +
    1.19 +<script type="text/javascript;version=1.7">
    1.20 +var missingPlugins = new Array();
    1.21 +var OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent;
    1.22 +
    1.23 +function pluginBinding(event)
    1.24 +{
    1.25 +  var plugin = event.target;
    1.26 +  plugin instanceof OBJLC;
    1.27 +  if (SpecialPowers.wrap(plugin).pluginFallbackType == OBJLC.PLUGIN_UNSUPPORTED)
    1.28 +    missingPlugins.push(plugin);
    1.29 +}
    1.30 +
    1.31 +document.addEventListener("PluginBindingAttached", pluginBinding, true);
    1.32 +</script>
    1.33 +
    1.34 +<object type="foo/bar" id="obj1"></object>
    1.35 +
    1.36 +<object type="foo/bar" id="obj2">
    1.37 +  <embed type="a/b" id="embed1"></embed>
    1.38 +</object>
    1.39 +
    1.40 +<object type="foo/bar"
    1.41 +        data="data:foo/bar,bah" id="obj3">
    1.42 +<param name="movie" value="data:foo/bar,bah">
    1.43 +</object>
    1.44 +
    1.45 +<object type="foo/bar"
    1.46 +        data="data:foo/bar,bah" id="obj4">
    1.47 +<param name="movie" value="data:foo/bar,bah">
    1.48 +<p>Alternate content</p>
    1.49 +</object>
    1.50 +
    1.51 +<object type="text/html"
    1.52 +        data="data:text/html,an html document in an object tag" id="obj5">
    1.53 +</object>
    1.54 +
    1.55 +<object type="text/html"
    1.56 +        data="data:text/html,an html document in an object tag" id="obj6">
    1.57 +<p>Alternate content</p>
    1.58 +</object>
    1.59 +
    1.60 +<embed type="a/b" id="embed2"></embed>
    1.61 +
    1.62 +<script class="testbody" type="text/javascript">
    1.63 +function runtests()
    1.64 +{
    1.65 +  // Force layout flush so the binding is attached and the event is fired
    1.66 +  document.getElementById("obj1").clientTop;
    1.67 +  document.getElementById("obj3").clientTop;
    1.68 +  document.getElementById("embed1").clientTop;
    1.69 +  document.getElementById("embed2").clientTop;
    1.70 +
    1.71 +  // Let pending events flush
    1.72 +  SimpleTest.executeSoon(function () {
    1.73 +    ok(missingPlugins.indexOf(document.getElementById("obj1")) >= 0, "Missing plugin element obj1");
    1.74 +    ok(missingPlugins.indexOf(document.getElementById("embed1")) >= 0, "Missing plugin element embed1");
    1.75 +    ok(missingPlugins.indexOf(document.getElementById("embed2")) >= 0, "Missing plugin element embed2");
    1.76 +    ok(missingPlugins.indexOf(document.getElementById("obj3")) >= 0, "Missing plugin element obj3");
    1.77 +
    1.78 +    is(missingPlugins.length, 4, "Wrong number of missing plugins");
    1.79 +
    1.80 +    SimpleTest.finish();
    1.81 +  });
    1.82 +}
    1.83 +
    1.84 +SimpleTest.waitForExplicitFinish();
    1.85 +</script>
    1.86 +</pre>
    1.87 +</body>
    1.88 +</html>

mercurial