Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(169)

Side by Side Diff: LayoutTests/plugins/npobject-js-wrapper-destroyed-after-plugin-unload.html

Issue 1319473007: Delete a bunch of NPAPI layout tests. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <script>
5 function startTest() {
6 if (window.testRunner) {
7 testRunner.dumpAsText();
8 testRunner.waitUntilDone();
9 }
10
11 // Access all objects/properties that we're going to use later in th e test so that JS
12 // allocations only happen when we expect.
13 var body = document.body;
14 body.removeChild;
15 var plugin = body.getElementsByTagName('embed')[0];
16 var testObject = plugin.testObject;
17 setTimeout;
18
19 testObject = null;
20
21 // Allocate a bunch of JS memory. This should cause testObject to be finalized, but it's
22 // destructor shouldn't run until the GCController.collect call we m ake later.
23 var array = new Array(10000);
24 for (var i = 0; i < 10000; ++i)
25 array[i] = new Object();
26
27 // Remove the plugin and wait for a little bit to ensure it has been unloaded (WebKit1
28 // on Windows unloads plugins after a delay).
29 body.removeChild(plugin);
30 setTimeout(finishTest, 250);
31 }
32
33 function finishTest() {
34 // Force a GC. If we don't crash here, we've passed the test.
35 if (window.GCController)
36 GCController.collect();
37
38 document.body.appendChild(document.createTextNode('PASSED'));
39
40 if (window.testRunner)
41 testRunner.notifyDone();
42 }
43
44 addEventListener('load', startTest, false);
45 </script>
46 </head>
47 <body>
48 <p>This test will only work in DumpRenderTree/WebKitTestRunner.</p>
49 <embed type="application/x-webkit-test-netscape">
50 </body>
51 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698