content/base/test/test_bug810494.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=810494
     5 -->
     6 <head>
     7   <meta charset="utf-8">
     8   <title>Test for Bug 810494</title>
     9   <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
    10   <script type="application/javascript" src="/tests/SimpleTest/SpecialPowers.js"></script>
    11   <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
    12 </head>
    13 <body>
    14 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=810494">Mozilla Bug 810494</a>
    15 <pre id="test">
    16 <script type="application/javascript;version=1.8">
    18 function test(tag, type) {
    19   "use strict";
    20   info("testing " + tag + " tag with type " + type);
    22   const OBJLC = SpecialPowers.Ci.nsIObjectLoadingContent;
    23   let obj = document.createElement(tag);
    24   obj.type = type;
    25   document.body.appendChild(obj);
    27   obj instanceof OBJLC;
    28   obj = SpecialPowers.wrap(obj);
    30   // We expect this tag to simply go to alternate content, not get a
    31   // pluginProblem binding or fire any events.
    32   ok(obj.displayedType == OBJLC.TYPE_NULL, "expected null type");
    33   ok(obj.pluginFallbackType == OBJLC.PLUGIN_ALTERNATE,
    34      "expected alternate fallback mode");
    35 }
    37 // Test all non-plugin types these tags can load to make sure none of them
    38 // trigger plugin-specific fallbacks when loaded with no URI
    39 test("object", "text/html");     // Document
    40 test("object", "image/png");     // Image
    41 test("object", "image/svg+xml"); // SVG Document
    43 test("embed", "image/png");      // Image
    44 test("embed", "image/svg+xml");  // SVG Document
    45 </script>
    46 </pre>
    47 </body>
    48 </html>

mercurial