Commit 9cca324e authored by Michael Lippautz's avatar Michael Lippautz Committed by Commit Bot

[unified-heap] Fix indexdb liveness layout tests

Replace direct GC calls that expect objects to die with asyncGC calls
that are guaranteed to run without stack.

Bug: chromium:843903
Change-Id: Ie708567fae153d0f1a20109fe170025afdc1715b
Reviewed-on: https://chromium-review.googlesource.com/1238451Reviewed-by: default avatarKentaro Hara <haraken@chromium.org>
Commit-Queue: Michael Lippautz <mlippautz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593551}
parent 3883a348
......@@ -25,7 +25,6 @@ db = request.result
db = null
request = null
Run GC outside of request's callback via setTimeout()
window.gc()
doThirdOpen():
request = indexedDB.open(dbname, 2)
......
......@@ -48,10 +48,9 @@ function doSecondOpen()
evalAndLog("request = null");
debug("Run GC outside of request's callback via setTimeout()");
setTimeout( function() {
evalAndLog("window.gc()");
asyncGC(function () {
doThirdOpen();
}, 0);
});
};
}
......
......@@ -49,10 +49,10 @@ function onOpen(evt)
cursorRequest = null;
cursor = null;
gc();
shouldBeTrue("cursorObserver.wasCollected");
finishJSTest();
asyncGC(function () {
shouldBeTrue("cursorObserver.wasCollected");
finishJSTest();
});
};
}
......
......@@ -9,7 +9,6 @@ indexedDB.open(dbname)
db.close()
indexedDB.open(dbname)
Dropping references to new connection.
gc()
Open request should not receive a blocked event:
indexedDB.open(dbname, 2)
PASS successfullyParsed is true
......
......@@ -10,6 +10,15 @@ function prepareDatabase()
{
}
function setVersion()
{
debug("Open request should not receive a blocked event:");
var request = evalAndLog("indexedDB.open(dbname, 2)");
request.onerror = unexpectedErrorCallback;
request.onblocked = unexpectedBlockedCallback;
request.onsuccess = finishJSTest;
}
function openSuccess()
{
db = event.target.result;
......@@ -23,16 +32,8 @@ function openSuccess()
debug("Dropping references to new connection.");
// After leaving this function, there are no remaining references to the
// db, so it should get deleted.
setTimeout(setVersion, 2);
setTimeout(function () {
asyncGC(setVersion);
}, 2);
};
}
function setVersion()
{
evalAndLog("gc()");
debug("Open request should not receive a blocked event:");
var request = evalAndLog("indexedDB.open(dbname, 2)");
request.onerror = unexpectedErrorCallback;
request.onblocked = unexpectedBlockedCallback;
request.onsuccess = finishJSTest;
}
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