dom/plugins/test/mochitest/test_bug479979.xul

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 <?xml version="1.0"?>
     2 <?xml-stylesheet href="chrome://global/skin" type="text/css"?>
     3 <?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
     4                  type="text/css"?>
     5 <window title="NPAPI Set Undefined Value Test"
     6   xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
     7   <script type="application/javascript"
     8           src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
     9   <script type="application/javascript" src="utils.js"></script>
    10 <body xmlns="http://www.w3.org/1999/xhtml" onload="runTests()">
    11 <script class="testbody" type="application/javascript">
    12 <![CDATA[
    13 SimpleTest.waitForExplicitFinish();
    14 setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED);
    16 function runTests() {
    17   var pluginElement1 = document.getElementById("plugin1");
    19   var rv = true; // we want !true from the test plugin
    20   var exceptionThrown = false;
    21   try {
    22     rv = pluginElement1.setUndefinedValueTest();
    23   } catch (e) {
    24     exceptionThrown = true;
    25   }
    26   is(exceptionThrown, false, "Exception thrown setting undefined variable.");
    27   is(rv, false, "Setting undefined variable succeeded.");
    29   // give the UI a chance to settle with the current enabled plugin state
    30   // before we finish the test and reset the state to disabled. Otherwise
    31   // the UI shows the plugin infobar!
    32   SimpleTest.executeSoon(SimpleTest.finish);
    33 }
    34 ]]>
    35 </script>
    36 <embed id="plugin1" type="application/x-test" width="300" height="300"></embed>
    37 </body>
    38 </window>

mercurial