dom/plugins/test/mochitest/test_bug479979.xul

changeset 0
6474c204b198
equal deleted inserted replaced
-1:000000000000 0:9304dfc9caa4
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);
15
16 function runTests() {
17 var pluginElement1 = document.getElementById("plugin1");
18
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.");
28
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