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
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>