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