Changeset 258707 in webkit
- Timestamp:
- Mar 19, 2020 10:23:58 AM (4 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r258703 r258707 1 2020-03-19 Sihui Liu <sihui_liu@apple.com> 2 3 Flaky Test: storage/indexeddb/cursor-leak.html and storage/indexeddb/cursor-leak-private.html 4 https://bugs.webkit.org/show_bug.cgi?id=209256 5 <rdar://problem/60097171> 6 7 Reviewed by Geoffrey Garen. 8 9 gc() does not guarantee all objects to be collected due to our conservative GC. To make the test more stable, we 10 now test if there is at lease one object is collected, which is enough to show cursor does not hold strong 11 reference to script value properties. 12 13 * storage/indexeddb/cursor-leak-expected.txt: 14 * storage/indexeddb/cursor-leak-private-expected.txt: 15 * storage/indexeddb/resources/cursor-leak.js: 16 (onOpen.tx.oncomplete): 17 (onOpen.cursorRequest.onsuccess): Deleted. 18 1 19 2020-03-19 Jason Lawrence <lawrence.j@apple.com> 2 20 -
trunk/LayoutTests/storage/indexeddb/cursor-leak-expected.txt
r242986 r258707 8 8 indexedDB.deleteDatabase(dbname) 9 9 indexedDB.open(dbname) 10 PASS cursorObserver.wasCollected is true 10 PASS cursorObservers.length is 10000 11 PASS anyCollected is true 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/storage/indexeddb/cursor-leak-private-expected.txt
r242986 r258707 8 8 indexedDB.deleteDatabase(dbname) 9 9 indexedDB.open(dbname) 10 PASS cursorObserver.wasCollected is true 10 PASS cursorObservers.length is 10000 11 PASS anyCollected is true 11 12 PASS successfullyParsed is true 12 13 -
trunk/LayoutTests/storage/indexeddb/resources/cursor-leak.js
r195299 r258707 4 4 } 5 5 6 description( "Verify that that cursors weakly hold script value properties");6 description('Verify that that cursors weakly hold script value properties'); 7 7 8 8 if (window.internals) { … … 25 25 26 26 db = evt.target.result; 27 tx = db.transaction('store' );27 tx = db.transaction('store', 'readonly'); 28 28 store = tx.objectStore('store'); 29 cursorRequest = store.openCursor(); 30 cursorRequest.onsuccess = function() { 31 cursor = cursorRequest.result; 32 }; 29 cursorObservers = []; 30 for (let i = 0; i < 10000; ++i) { 31 store.openCursor().onsuccess = (event) => { 32 cursor = event.target.result 33 cursor.key.cursor = cursor; 34 cursor.primaryKey.cursor = cursor; 35 cursor.value.cursor = cursor; 36 cursorObservers.push(internals.observeGC(cursor)); 37 cursor = null; 38 }; 39 } 33 40 tx.oncomplete = function() { 34 41 db.close(); 35 36 // Try and induce a leak by a reference cycle from DOM to V8 and back. 37 // If the v8 value of cursor.key (etc) is only held by the cursor's 38 // V8 wrapper then there will be no leak. 39 cursor.key.cursor = cursor; 40 cursor.primaryKey.cursor = cursor; 41 cursor.value.cursor = cursor; 42 43 cursorObserver = internals.observeGC(cursor); 44 45 cursorRequest = null; 46 cursor = null; 42 shouldBe('cursorObservers.length', '10000'); 47 43 48 44 gc(); 49 45 50 shouldBeTrue("cursorObserver.wasCollected"); 46 anyCollected = false; 47 for (let observer of cursorObservers) { 48 if (observer.wasCollected) 49 anyCollected = true; 50 } 51 52 shouldBeTrue('anyCollected'); 51 53 finishJSTest(); 52 54 };
Note: See TracChangeset
for help on using the changeset viewer.