OLD | NEW |
| (Empty) |
1 <html> | |
2 <script> | |
3 | |
4 var callbackCount = 0; | |
5 | |
6 function npapiCallback(x) { | |
7 callbackCount++; | |
8 } | |
9 | |
10 function runTest() | |
11 { | |
12 if (window.layoutTestController) | |
13 layoutTestController.dumpAsText(); | |
14 | |
15 var successCount = 0; | |
16 var plugin = document.getElementById("testPlugin"); | |
17 plugin.logDestroy = true; | |
18 | |
19 var testObject = plugin.testObject; | |
20 plugin.testPassTestObject("npapiCallback", testObject); | |
21 var testObject2 = testObject.testObject; | |
22 plugin.testPassTestObject("npapiCallback", testObject2); | |
23 var testObject3 = testObject2.testObject; | |
24 plugin.testPassTestObject("npapiCallback", testObject3); | |
25 | |
26 if (callbackCount == 3) | |
27 successCount++; | |
28 | |
29 plugin.parentNode.removeChild(plugin); | |
30 | |
31 try { | |
32 testObject.property; | |
33 } catch (e) { | |
34 if (e instanceof ReferenceError) | |
35 successCount++; | |
36 } | |
37 | |
38 try { | |
39 testObject.property = 'hello'; | |
40 } catch (e) { | |
41 if (e instanceof ReferenceError) | |
42 successCount++; | |
43 } | |
44 | |
45 try { | |
46 testObject2.property; | |
47 } catch (e) { | |
48 if (e instanceof ReferenceError) | |
49 successCount++; | |
50 } | |
51 | |
52 try { | |
53 testObject3.property; | |
54 } catch (e) { | |
55 if (e instanceof ReferenceError) | |
56 successCount++; | |
57 } | |
58 | |
59 if (successCount == 5) | |
60 document.getElementById('result').innerHTML = 'SUCCESS'; | |
61 } | |
62 | |
63 </script> | |
64 | |
65 <body onload="runTest();"> | |
66 <pre> | |
67 This tests that objects from plugin objects are properly cleaned up. | |
68 | |
69 Example: | |
70 plugin | |
71 ------- (Creates) ------ Object1 | |
72 ------- (Creates) ------ Object2 | |
73 | |
74 It is important that both Object1 and Object2 cleanup as a result of | |
75 cleaning up the plugin. | |
76 | |
77 <div id="result">FAILURE</div> | |
78 <embed id="testPlugin" type="application/x-webkit-test-netscape" width="200" hei
ght="200"></embed> | |
79 </body> | |
80 </html> | |
OLD | NEW |