Commit 915d7a66 authored by Myung-jong Kim's avatar Myung-jong Kim Committed by Commit Bot

Remove redundant gc from LayoutTests

Bug: 706285
Change-Id: I19af8517f4cc561a30afb25ca3b3150a8dd41b12
Reviewed-on: https://chromium-review.googlesource.com/805515Reviewed-by: default avatarJeremy Roman <jbroman@chromium.org>
Commit-Queue: Jeremy Roman <jbroman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#521371}
parent b318cc7d
function gc()
{
if (window.GCController)
return GCController.collectAll();
for (var i = 0; i < 10000; i++) { // > force garbage collection (FF requires about 9K allocations before a collect)
var s = new String("");
}
}
function removeScriptElement() {
var s = document.getElementById('theScript');
s.parentNode.removeChild(s);
......
<body>
<p>Test that adding an event listener for an event with a unique name works correctly (this used to corrupt event listener map after GC).</p>
<pre id=log></pre>
<script src="../../resources/gc.js"></script>
<script>
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 log(message)
{
document.getElementById("log").innerHTML += message + "<br>";
......
<html>
<head>
<script src="../../resources/gc.js"></script>
<script>
function sendXHR()
{
......@@ -43,18 +44,6 @@ function test()
}
}
function GC()
{
// Force GC.
if (window.GCController)
GCController.collect();
else {
for (var i = 0; i < 10000; ++i) {
({ });
}
}
}
/* GLOBALS */
var XHR = new Array();
var numXHRs = 0;
......@@ -67,7 +56,7 @@ var run = 0;
<div id="replaceMe">
<div>
<select id="theSelect" onblur="sendXHR();GC();">
<select id="theSelect" onblur="sendXHR();gc();">
</select>
</div>
......
......@@ -2,15 +2,6 @@ description(
"Tests that an event handler registered on two nodes still fires after one of the nodes has been GC'd."
);
function gc() {
if (window.GCController)
GCController.collect();
else {
for (var i = 0; i < 10000; ++i)
new Object;
}
}
var clickCount = 0;
function clickHandler() {
++clickCount;
......
......@@ -281,22 +281,6 @@ function shouldThrowType(_a, _e)
testFailed(_a + " should throw an instance of " + _e.name);
}
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)
}
}
// It's possible for an async test to call finishJSTest() before moz-test-post.js
// has been parsed.
function finishJSTest()
......@@ -324,4 +308,4 @@ function assertEq(left, right, message)
testFailed(message);
else
testFailed("assertEq failed: " + left + "(of type " + (typeof left) + ") !== " + right + "(of type " + (typeof right) + ")");
}
\ No newline at end of file
}
......@@ -2,15 +2,6 @@ description(
'Tests to make sure we do not gc the constants contained by functions defined inside eval code. To pass we need to not crash.'
);
function gc()
{
if (this.GCController)
GCController.collect();
else
for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC.
({});
}
evalStringTest = "'test'";
evalString = "function f() { shouldBe(\"'test'\", evalStringTest) }; f()";
function doTest() {
......
......@@ -2,15 +2,6 @@ description(
'Tests to make sure that dynamic scope objects are correctly protected from GC. To pass we need to not crash.'
);
function gc()
{
if (this.GCController)
GCController.collectAll();
else
for (var i = 0; i < 10000; ++i) // Allocate a sufficient number of objects to force a GC.
({});
}
(function() {
try {
// Immediate value for scope
......
......@@ -3,6 +3,7 @@
<html>
<title>Worklet: Worklet should report context destroyed</title>
<body>
<script src="../../../resources/gc.js"></script>
<script>
// This test was added for confirming a crash bug fix (see
// https://crbug.com/657450). This should not be upstreamed to WPT because of
......@@ -12,16 +13,6 @@ if (window.testRunner) {
testRunner.dumpAsText();
}
function gc()
{
if (window.GCController) {
GCController.collect();
} else {
for (var i = 0; i < 10000; ++i)
new Object;
}
}
function tryCrash()
{
document.frame.CSS.paintWorklet;
......
<html>
<head>
<script src="../../resources/gc.js"></script>
<script src="resources/database-common.js"></script>
<script src="multiple-databases-garbage-collection.js"></script>
<body onload="setupAndRunTest();">
......
function GC()
{
// Force GC.
if (window.GCController)
GCController.collectAll();
else {
for (var i = 0; i < 10000; ++i) {
({ });
}
}
}
// Variable for the database that will never be forgotten
var persistentDB = 0;
// Variable for the forgotten database
......@@ -32,12 +20,12 @@ function runTest()
}, function(err) {
log("Forgotten Database Transaction Errored - " + err);
forgottenDB = 0;
GC();
gc();
checkCompletion();
}, function() {
log("Forgotten Database Transaction Complete");
forgottenDB = 0;
GC();
gc();
checkCompletion();
});
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment