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 | <!DOCTYPE html> |
michael@0 | 2 | <html> |
michael@0 | 3 | <head> |
michael@0 | 4 | <title>Test whether windowless plugins receive correct visible/invisible notifications.</title> |
michael@0 | 5 | <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script> |
michael@0 | 6 | <script type="text/javascript" src="utils.js"></script> |
michael@0 | 7 | <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" /> |
michael@0 | 8 | |
michael@0 | 9 | <body> |
michael@0 | 10 | <script type="text/javascript"> |
michael@0 | 11 | setTestPluginEnabledState(SpecialPowers.Ci.nsIPluginTag.STATE_ENABLED); |
michael@0 | 12 | </script> |
michael@0 | 13 | |
michael@0 | 14 | <p id="display"></p> |
michael@0 | 15 | |
michael@0 | 16 | <embed id="theplugin" type="application/x-test"></embed> |
michael@0 | 17 | |
michael@0 | 18 | <script type="application/javascript"> |
michael@0 | 19 | function MyFunc(arg) { |
michael@0 | 20 | is(arg, "hi", "Argument passed to constructor function"); |
michael@0 | 21 | this.localProp = 'local'; |
michael@0 | 22 | } |
michael@0 | 23 | MyFunc.prototype.protoProp = 't'; |
michael@0 | 24 | |
michael@0 | 25 | var theplugin = document.getElementById('theplugin'); |
michael@0 | 26 | |
michael@0 | 27 | ok(theplugin.constructObject(Array) instanceof Array, "Constructed Array"); |
michael@0 | 28 | var o = theplugin.constructObject(MyFunc, "hi"); |
michael@0 | 29 | ok(o instanceof MyFunc, "Constructed MyFunc"); |
michael@0 | 30 | is(o.localProp, 'local', "this property correct"); |
michael@0 | 31 | is(o.protoProp, 't', "prototype property correct"); |
michael@0 | 32 | </script> |