content/base/test/test_bug810494.html

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/content/base/test/test_bug810494.html	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,48 @@
     1.4 +<!DOCTYPE HTML>
     1.5 +<html>
     1.6 +<!--
     1.7 +https://bugzilla.mozilla.org/show_bug.cgi?id=810494
     1.8 +-->
     1.9 +<head>
    1.10 +  <meta charset="utf-8">
    1.11 +  <title>Test for Bug 810494</title>
    1.12 +  <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    1.13 +  <script type="application/javascript" src="/tests/SimpleTest/SpecialPowers.js"></script>
    1.14 +  <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    1.15 +</head>
    1.16 +<body>
    1.17 +<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=810494">Mozilla Bug 810494</a>
    1.18 +<pre id="test">
    1.19 +<script type="application/javascript;version=1.8">
    1.20 +
    1.21 +function test(tag, type) {
    1.22 +  "use strict";
    1.23 +  info("testing " + tag + " tag with type " + type);
    1.24 +
    1.25 +  const OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent;
    1.26 +  let obj = document.createElement(tag);
    1.27 +  obj.type = type;
    1.28 +  document.body.appendChild(obj);
    1.29 +
    1.30 +  obj instanceof OBJLC;
    1.31 +  obj = SpecialPowers.wrap(obj);
    1.32 +
    1.33 +  // We expect this tag to simply go to alternate content, not get a
    1.34 +  // pluginProblem binding or fire any events.
    1.35 +  ok(obj.displayedType == OBJLC.TYPE_NULL, "expected null type");
    1.36 +  ok(obj.pluginFallbackType == OBJLC.PLUGIN_ALTERNATE,
    1.37 +     "expected alternate fallback mode");
    1.38 +}
    1.39 +
    1.40 +// Test all non-plugin types these tags can load to make sure none of them
    1.41 +// trigger plugin-specific fallbacks when loaded with no URI
    1.42 +test("object", "text/html");     // Document
    1.43 +test("object", "image/png");     // Image
    1.44 +test("object", "image/svg+xml"); // SVG Document
    1.45 +
    1.46 +test("embed", "image/png");      // Image
    1.47 +test("embed", "image/svg+xml");  // SVG Document
    1.48 +</script>
    1.49 +</pre>
    1.50 +</body>
    1.51 +</html>

mercurial