dom/plugins/test/mochitest/test_npruntime_construct.html

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

mercurial