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