dom/plugins/test/mochitest/test_bug479979.xul

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/plugins/test/mochitest/test_bug479979.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="NPAPI Set Undefined Value Test"
     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 +<body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
    1.14 +<script class="testbody" type="application/javascript">
    1.15 +<![CDATA[
    1.16 +SimpleTest.waitForExplicitFinish();
    1.17 +setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    1.18 +
    1.19 +function runTests() {
    1.20 +  var pluginElement1 = document.getElementById("plugin1");
    1.21 +
    1.22 +  var rv = true; // we want !true from the test plugin
    1.23 +  var exceptionThrown = false;
    1.24 +  try {
    1.25 +    rv = pluginElement1.setUndefinedValueTest();
    1.26 +  } catch (e) {
    1.27 +    exceptionThrown = true;
    1.28 +  }
    1.29 +  is(exceptionThrown, false, "Exception thrown setting undefined variable.");
    1.30 +  is(rv, false, "Setting undefined variable succeeded.");
    1.31 +
    1.32 +  // give the UI a chance to settle with the current enabled plugin state
    1.33 +  // before we finish the test and reset the state to disabled. Otherwise
    1.34 +  // the UI shows the plugin infobar!
    1.35 +  SimpleTest.executeSoon(SimpleTest.finish);
    1.36 +}
    1.37 +]]>
    1.38 +</script>
    1.39 +<embed id="plugin1" type="application/x-test" width="300" height="300"></embed>
    1.40 +</body>
    1.41 +</window>

mercurial