Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge r242043 - IndexedDB: IDBDatabase and IDBTransaction are leaked …
…in layout tests https://bugs.webkit.org/show_bug.cgi?id=194709 Reviewed by Geoffrey Garen. Source/WebCore: When connection to IDB server is closed, IDBTransaction would abort without notifying IDBDatabase, so IDBDatabase didn't clear its reference to IDBTransaction which created a reference cycle. Also IDBTransaction didn't clear its reference to IDBRequest in this case and it led to another reference cycle between IDBOpenDBRequest and IDBTransaction. Test: storage/indexeddb/IDBObject-leak.html * Modules/indexeddb/IDBDatabase.cpp: (WebCore::IDBDatabase::connectionToServerLost): * Modules/indexeddb/IDBTransaction.cpp: (WebCore::IDBTransaction::IDBTransaction): (WebCore::IDBTransaction::~IDBTransaction): (WebCore::IDBTransaction::connectionClosedFromServer): * Modules/indexeddb/IDBTransaction.h: * testing/Internals.cpp: (WebCore::Internals::numberOfIDBTransactions const): * testing/Internals.h: * testing/Internals.idl: LayoutTests: * TestExpectations: * platform/wk2/TestExpectations: * storage/indexeddb/IDBObject-leak-expected.txt: Added. * storage/indexeddb/IDBObject-leak.html: Added.
- Loading branch information
1 parent
17f735c
commit 49b3e93
Showing
12 changed files
with
115 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
This test verifies that IDBTransaction objects are freed. | ||
|
||
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". | ||
|
||
|
||
PASS internals.numberOfIDBTransactions() is 0 | ||
PASS successfullyParsed is true | ||
|
||
TEST COMPLETE | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<!DOCTYPE html> | ||
<script src="../../resources/js-test.js"></script> | ||
<script src="resources/shared.js"></script> | ||
<script> | ||
description('This test verifies that IDBTransaction objects are freed.'); | ||
|
||
jsTestIsAsync = true; | ||
|
||
function test() { | ||
if (!window.internals || !internals.numberOfIDBTransactions) { | ||
testFailed('This test requires access to the Internals object'); | ||
finishJSTest(); | ||
return; | ||
} | ||
|
||
if (sessionStorage.doneFirstLoad) { | ||
gc(); | ||
shouldBeEqualToNumber("internals.numberOfIDBTransactions()", 0); | ||
finishJSTest(); | ||
return; | ||
} | ||
|
||
var dbname = setDBNameFromPath() + Date(); | ||
var request = window.indexedDB.open(dbname); | ||
request.onupgradeneeded = function(evt) { | ||
sessionStorage.doneFirstLoad = true; | ||
if (!window.testRunner || !testRunner.terminateNetworkProcess) { | ||
testFailed('This test requires access to the TestRunner object and terminateNetworkProcess() function'); | ||
finishJSTest(); | ||
return; | ||
} | ||
testRunner.terminateNetworkProcess(); | ||
setTimeout((()=> { | ||
location.reload(); | ||
}), 0); | ||
} | ||
} | ||
|
||
test(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters