1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/dom/plugins/test/mochitest/test_wmode.xul Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,38 @@ 1.4 +<?xml version="1.0"?> 1.5 +<?xml-stylesheet href="chrome://global/skin" type="text/css"?> 1.6 +<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css" 1.7 + type="text/css"?> 1.8 +<window title="WMode Tests" 1.9 + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> 1.10 + <script type="application/javascript" 1.11 + src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" /> 1.12 + <script type="application/javascript" src="utils.js"></script> 1.13 + <script type="application/javascript"> 1.14 + setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); 1.15 + </script> 1.16 +<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()"> 1.17 +<embed id="plugin2" type="application/x-test" width="400" height="400" wmode="window"></embed> 1.18 +<embed id="plugin1" type="application/x-test" width="400" height="400"></embed> 1.19 +</body> 1.20 +<script class="testbody" type="application/javascript"> 1.21 +<![CDATA[ 1.22 +SimpleTest.waitForExplicitFinish(); 1.23 + 1.24 +function runTests() { 1.25 + var p1 = document.getElementById("plugin1"); 1.26 + is(p1.hasWidget(), false, "Plugin should be windowless by default"); 1.27 + 1.28 + var p2 = document.getElementById("plugin2"); 1.29 + if (navigator.platform.indexOf("Mac") >= 0) { 1.30 + is(p2.hasWidget(), false, "Mac does not support windowed plugins"); 1.31 + } else if (navigator.platform.indexOf("Win") >= 0) { 1.32 + is(p2.hasWidget(), true, "Windows supports windowed plugins"); 1.33 + } else if (navigator.platform.indexOf("Linux") >= 0) { 1.34 + is(p2.hasWidget(), true, "Linux supports windowed plugins"); 1.35 + } 1.36 + 1.37 + SimpleTest.finish(); 1.38 +} 1.39 +]]> 1.40 +</script> 1.41 +</window>