Title: [110650] trunk/LayoutTests
Revision
110650
Author
a...@chromium.org
Date
2012-03-13 17:36:34 -0700 (Tue, 13 Mar 2012)

Log Message

Remove duplicate GC functions from layout tests
https://bugs.webkit.org/show_bug.cgi?id=81047

Reviewed by Ojan Vafai.

* fast/canvas/webgl/shader-deleted-by-accessor.html:
* fast/dom/Window/customized-property-survives-gc.html:
* fast/dom/inline-event-attributes-lookup-removed-form.html:
* fast/dom/inline-event-attributes-lookup-removed.html:
* fast/dom/shadow/gc-shadow.html:
* fast/filesystem/resources/file-writer-gc-blob.js:
* fast/forms/input-image-submit.html:
* fast/forms/interactive-validation-remove-node-in-handler.html:
* fast/forms/select-set-length-with-mutation-remove.html:
* fast/js/resources/js-test-pre.js:
(gc.else.gcRec):
(gc):
* http/tests/websocket/tests/hixie76/close-on-unload-and-force-gc.html:
* http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html:
* webaudio/mediaelementaudiosourcenode-gc.html:

Modified Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (110649 => 110650)


--- trunk/LayoutTests/ChangeLog	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/ChangeLog	2012-03-14 00:36:34 UTC (rev 110650)
@@ -1,3 +1,26 @@
+2012-03-13  Erik Arvidsson  <a...@chromium.org>
+
+        Remove duplicate GC functions from layout tests
+        https://bugs.webkit.org/show_bug.cgi?id=81047
+
+        Reviewed by Ojan Vafai.
+
+        * fast/canvas/webgl/shader-deleted-by-accessor.html:
+        * fast/dom/Window/customized-property-survives-gc.html:
+        * fast/dom/inline-event-attributes-lookup-removed-form.html:
+        * fast/dom/inline-event-attributes-lookup-removed.html:
+        * fast/dom/shadow/gc-shadow.html:
+        * fast/filesystem/resources/file-writer-gc-blob.js:
+        * fast/forms/input-image-submit.html:
+        * fast/forms/interactive-validation-remove-node-in-handler.html:
+        * fast/forms/select-set-length-with-mutation-remove.html:
+        * fast/js/resources/js-test-pre.js:
+        (gc.else.gcRec):
+        (gc):
+        * http/tests/websocket/tests/hixie76/close-on-unload-and-force-gc.html:
+        * http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html:
+        * webaudio/mediaelementaudiosourcenode-gc.html:
+
 2012-03-13  Jessie Berlin  <jber...@apple.com>
 
         WebKitTestRunner needs layoutTestController.setEditingBehavior

Modified: trunk/LayoutTests/fast/canvas/webgl/shader-deleted-by-accessor.html (110649 => 110650)


--- trunk/LayoutTests/fast/canvas/webgl/shader-deleted-by-accessor.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/canvas/webgl/shader-deleted-by-accessor.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -9,15 +9,7 @@
 <div id="console"></div>
 
 <script>
-function gc()
-{
-    if (window.GCController)
-        return GCController.collect();
 
-    for (var i = 0; i < 10000; ++i)
-        var s = new String("AAAA");
-}
-
 description("Verifies that WebGLRenderingContext::getAttachedShaders doesn't crash when an accessor property is defined on Array.prototype.");
 
 context = create3DContext();

Modified: trunk/LayoutTests/fast/dom/Window/customized-property-survives-gc.html (110649 => 110650)


--- trunk/LayoutTests/fast/dom/Window/customized-property-survives-gc.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/dom/Window/customized-property-survives-gc.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -7,19 +7,9 @@
 <script>
 description("This tests that customized properties on window.location and window.navigator won't get lost after garbage collection. Results may be different when run manually, since forcing GC may not be exposed in all applications. Browsers disagree about what happens to properties on window.screen, window.history, and others through 'toolbar' in the list below, but the behavior of window.location and window.navigator is consistent.");
 
-function CollectGarbage() {
-  if (window.GCController) {
-    window.GCController.collect();
-  } else {
-    // Allocate objects to trigger GC. This may not work in all applications.
-    for (var i = 0; i < 50000; i++)
-      new Object();
-  }
-}
-
 function check(name, shouldSurvive) {
   window[name].myProp = 10;
-  CollectGarbage();
+  gc();
   if (shouldSurvive)
     shouldBe("window." + name + ".myProp", "10");
   else

Modified: trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form.html (110649 => 110650)


--- trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed-form.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -7,16 +7,6 @@
 
 description('Tests that lookup in inline event handlers keeps references alive');
 
-function forceGC()
-{
-    if (window.GCController)
-        return GCController.collect();
-
-    // Force garbage collection
-    for (var ndx = 0; ndx < 99000; ndx++)
-        var str = new String("1234");
-}
-
 var result;
 var pa = '(FAIL input)'
 var ss = '(FAIL form)'
@@ -30,7 +20,7 @@
 
 input.parentNode.removeChild(input);
 input = null;
-forceGC();
+gc();
 
 f();
 shouldBeEqualToString('result', 'PASS');

Modified: trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed.html (110649 => 110650)


--- trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/dom/inline-event-attributes-lookup-removed.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -4,16 +4,6 @@
 
 description('Tests that lookup in inline event handlers keeps references alive');
 
-function forceGC()
-{
-    if (window.GCController)
-        return GCController.collect();
-
-    // Force garbage collection
-    for (var ndx = 0; ndx < 99000; ndx++)
-        var str = new String("1234");
-}
-
 function dispatchClick(element)
 {
     var clickEvent = document.createEvent('MouseEvent');
@@ -32,7 +22,7 @@
 div2._onclick_ = div1.onclick;
 
 div1 = null;
-forceGC();
+gc();
 
 dispatchClick(div2);
 shouldBeEqualToString('result', 'PASS');

Modified: trunk/LayoutTests/fast/dom/shadow/gc-shadow.html (110649 => 110650)


--- trunk/LayoutTests/fast/dom/shadow/gc-shadow.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/dom/shadow/gc-shadow.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -10,16 +10,6 @@
 
 </pre>
 <script>
-function gc() {
-    if (window.GCController) {
-        GCController.collect();
-        return;
-    }
-
-    for (var i = 0; i < 10000; i++)
-        new String(i);
-}
-
 if (window.internals) {
     var ps = [];
 

Modified: trunk/LayoutTests/fast/filesystem/resources/file-writer-gc-blob.js (110649 => 110650)


--- trunk/LayoutTests/fast/filesystem/resources/file-writer-gc-blob.js	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/filesystem/resources/file-writer-gc-blob.js	2012-03-14 00:36:34 UTC (rev 110650)
@@ -2,22 +2,6 @@
     importScripts('fs-worker-common.js');
     importScripts('../../js/resources/js-test-pre.js');
     importScripts('file-writer-utils.js');
-    function gc() {
-        if (typeof GCController !== "undefined")
-            GCController.collect();
-        else {
-            function gcRec(n) {
-                if (n < 1)
-                    return {};
-                var temp = {i: "ab" + i + (i / 100000)};
-                temp += "foo";
-                gcRec(n-1);
-            }
-            for (var i = 0; i < 1000; i++)
-                gcRec(10)
-        }
-    }
-
 }
 
 description("Test that a blob won't get garbage-collected while being written out by a FileWriter.");

Modified: trunk/LayoutTests/fast/forms/input-image-submit.html (110649 => 110650)


--- trunk/LayoutTests/fast/forms/input-image-submit.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/forms/input-image-submit.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -12,14 +12,6 @@
 
 <div id="console"></div>
 <script>
-function gc() {
-    if (window.GCController)
-        return GCController.collect();
-
-    for (var i = 0; i < 10000; i++)
-        var s = new String("");
-}
-
 function notifyDone() {
     if (window.layoutTestController)
         layoutTestController.notifyDone();

Modified: trunk/LayoutTests/fast/forms/interactive-validation-remove-node-in-handler.html (110649 => 110650)


--- trunk/LayoutTests/fast/forms/interactive-validation-remove-node-in-handler.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/forms/interactive-validation-remove-node-in-handler.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -14,14 +14,6 @@
 <script>
 description('Should not crash or have an assertion failure if a node was removed during an "invalid" event dispatching for the node.');
 
-function gc() {
-    if (window.GCController)
-        return GCController.collect();
-    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
-        var s = new String("");
-    }
-}
-
 function handler(event) {
     var node = event.target;
     node.parentNode.removeChild(node);

Modified: trunk/LayoutTests/fast/forms/select-set-length-with-mutation-remove.html (110649 => 110650)


--- trunk/LayoutTests/fast/forms/select-set-length-with-mutation-remove.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/forms/select-set-length-with-mutation-remove.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -9,15 +9,6 @@
 <script>
 description('Tests that setting .length on an HTMLSelectElement works in the presence of mutation listeners that remove option elements.');
 
-function gc() {
-    if (window.GCController)
-        return GCController.collect();
-
-    for (var i=0; i<10000; ++i) {
-        var s = new String("abc");
-    }
-}
-
 function onRemove(e) {
     if (e.target.nextSibling != null) {
         // remove listener temporarily to avoid lots of nesting

Modified: trunk/LayoutTests/fast/js/resources/js-test-pre.js (110649 => 110650)


--- trunk/LayoutTests/fast/js/resources/js-test-pre.js	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/fast/js/resources/js-test-pre.js	2012-03-14 00:36:34 UTC (rev 110650)
@@ -434,13 +434,13 @@
     if (typeof GCController !== "undefined")
         GCController.collect();
     else {
-        function gcRec(n) {
+        var gcRec = function (n) {
             if (n < 1)
                 return {};
             var temp = {i: "ab" + i + (i / 100000)};
             temp += "foo";
             gcRec(n-1);
-        }
+        };
         for (var i = 0; i < 1000; i++)
             gcRec(10)
     }

Modified: trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-on-unload-and-force-gc.html (110649 => 110650)


--- trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-on-unload-and-force-gc.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/http/tests/websocket/tests/hixie76/close-on-unload-and-force-gc.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -13,16 +13,6 @@
 if (window.layoutTestController)
     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 1);
 
-function gc()
-{
-    if (window.GCController)
-        return GCController.collect();
-
-    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
-        var s = new String("abc");
-    }
-};
-
 var frameDiv;
 var closedSocket;
 

Modified: trunk/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html (110649 => 110650)


--- trunk/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/http/tests/websocket/tests/hybi/close-on-unload-and-force-gc.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -13,16 +13,6 @@
 if (window.layoutTestController)
     layoutTestController.overridePreference("WebKitHixie76WebSocketProtocolEnabled", 0);
 
-function gc()
-{
-    if (window.GCController)
-        return GCController.collect();
-
-    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
-        var s = new String("abc");
-    }
-};
-
 var frameDiv;
 var closedSocket;
 

Modified: trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-gc.html (110649 => 110650)


--- trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-gc.html	2012-03-14 00:31:03 UTC (rev 110649)
+++ trunk/LayoutTests/webaudio/mediaelementaudiosourcenode-gc.html	2012-03-14 00:36:34 UTC (rev 110650)
@@ -12,16 +12,6 @@
 <script>
 description("Tests garbage collection of MediaElementAudioSourceNode.");
 
-function gc()
-{
-    if (window.GCController)
-        return GCController.collect();
-
-    for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
-        var s = new String("abc");
-    }
-}
-
 function runTest() {
     if (window.layoutTestController) {
         layoutTestController.overridePreference("WebKitWebAudioEnabled", "1");
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to