OLD | NEW |
| (Empty) |
1 <head> | |
2 <script src="../../resources/js-test.js"></script> | |
3 </head> | |
4 <body> | |
5 <script> | |
6 function main() | |
7 { | |
8 if (!window.testRunner) { | |
9 debug("This test can only run from within DumpRenderTree because it requ
ires TestNetscapePlugin.\n"); | |
10 return; | |
11 } | |
12 | |
13 testRunner.waitUntilDone(); | |
14 } | |
15 main(); | |
16 | |
17 function testNPInvoke() | |
18 { | |
19 argumentsLength = arguments.length; | |
20 | |
21 shouldBe("argumentsLength", "7"); | |
22 | |
23 undefinedArgument = arguments[0]; | |
24 shouldBe("typeof(undefinedArgument)", "'undefined'") | |
25 | |
26 nullArgument = arguments[1]; | |
27 shouldBe("typeof(nullArgument)", "'object'") | |
28 shouldBe("nullArgument", "null"); | |
29 | |
30 booleanArgument = arguments[2]; | |
31 shouldBe("typeof(booleanArgument)", "'boolean'"); | |
32 shouldBe("booleanArgument", "true"); | |
33 | |
34 intArgument = arguments[3]; | |
35 shouldBe("typeof(intArgument)", "'number'"); | |
36 shouldBe("intArgument", "242"); | |
37 | |
38 doubleArgument = arguments[4]; | |
39 shouldBe("typeof(doubleArgument)", "'number'"); | |
40 shouldBe("doubleArgument", "242.242"); | |
41 | |
42 stringArgument = arguments[5]; | |
43 shouldBe("typeof(stringArgument)", "'string'"); | |
44 shouldBe("stringArgument", "'Hello, World'"); | |
45 | |
46 objectArgument = arguments[6]; | |
47 shouldBe("typeof(objectArgument)", "'object'"); | |
48 | |
49 isSuccessfullyParsed(); | |
50 testRunner.notifyDone(); | |
51 } | |
52 | |
53 description("Tests that the NPRuntime implementation works as expected"); | |
54 | |
55 </script> | |
56 <embed id="plugin" | |
57 type="application/x-webkit-test-netscape" | |
58 style="width:0; height:0" | |
59 testnpruntime="1"> | |
60 </embed> | |
OLD | NEW |