6 if (window
.GCController
)
7 GCController
.collectAll();
11 if (window
.testRunner
)
12 testRunner
.dumpAsText();
16 var plug1
= document
.getElementById("plug1");
17 var plug2
= document
.getElementById("plug2");
18 var output
= document
.getElementById("output");
19 output
.innerHTML
= "";
21 var testObj1
= plug1
.testObject
;
22 var testObj2
= plug2
.testObject
;
26 // Verify we can access each object.
27 if (testObj1
.foo
== "foo") {
29 output
.innerHTML
+= "Got testObj1 property<br>";
31 if (testObj2
.foo
== "foo") {
33 output
.innerHTML
+= "Got testObj2 property<br>";
36 // Now remove the first plugin
37 plug1
.parentNode
.removeChild(plug1
);
40 if (testObj1
.foo
== "foo") {
41 output
.innerHTML
= "Accessed nuked object!<br>";
44 if (e
instanceof ReferenceError
)
49 if (testObj2
.foo
== "foo") {
51 output
.innerHTML
+= "Got testObj2 property<br>";
54 output
.inerHTML
+= "Reference error accessing live object: " + e
;
57 // Now remove the second plugin
58 plug2
.parentNode
.removeChild(plug2
);
61 if (testObj2
.foo
== "foo") {
62 output
.innerHTML
= "Accessed nuked object!<br>";
65 if (e
instanceof ReferenceError
)
69 var success
= (successCount
== 5);
70 output
.innerHTML
+= (success
? "SUCCESS" : "FAILURE");
74 <body onload=
"runtest()">
76 Test that we can create two plugins, and independently clean each.
78 Prints
"SUCCESS" on success,
"FAILURE" on failure.
80 <embed id=
"plug1" type=
"application/x-webkit-test-netscape">
81 <embed id=
"plug2" type=
"application/x-webkit-test-netscape">
83 <div id=output
>FAILURE
</div>