Changeset 246232 in webkit
- Timestamp:
- Jun 8, 2019 3:32:07 AM (5 years ago)
- Location:
- trunk/LayoutTests
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r246227 r246232 1 2019-06-08 Cathie Chen <cathiechen@igalia.com> 2 3 resize-observer/element-leak.html fails on Windows platform 4 https://bugs.webkit.org/show_bug.cgi?id=197908 5 6 Reviewed by Ryosuke Niwa. 7 8 We have conservative GC, the removed objects might keep alive for a while. Change the test case 9 to 20 iframes. This would make the result more accurate. 10 11 * platform/win/TestExpectations: 12 * resize-observer/element-leak-expected.txt: 13 * resize-observer/element-leak.html: 14 1 15 2019-06-07 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/LayoutTests/platform/win/TestExpectations
r246214 r246232 4403 4403 webkit.org/b/198112 http/tests/security/showModalDialog-sync-cross-origin-page-load2.html [ Skip ] 4404 4404 4405 # The removed elements couldn't be released properly in Win.4406 # The relevant bug is https://bugs.webkit.org/show_bug.cgi?id=1979084407 resize-observer/element-leak.html [ Skip ]4408 4409 4405 webkit.org/b/198679 fast/events/fire-mousedown-while-pressing-mouse-button.html [ Failure ] -
trunk/LayoutTests/resize-observer/element-leak-expected.txt
r246057 r246232 1 1 2 2 PASS ResizeObserver implemented 3 PASS Test elements leak 3 PASS Test elements leak in 20 iframes 4 4 -
trunk/LayoutTests/resize-observer/element-leak.html
r246057 r246232 8 8 </head> 9 9 <body> 10 <iframe id="testFrame" src="resources/element-leak-frame.html"></iframe>11 10 <script> 11 12 let iframeCount = 20; 13 function prepareFrame() { 14 return new Promise(function(resolve, reject) { 15 let container = document.createElement("div"); 16 for (let i = 0; i < iframeCount; ++i) { 17 let iframe = document.createElement("iframe"); 18 iframe.style.height = "1px"; 19 iframe.src = "resources/element-leak-frame.html"; 20 container.appendChild(iframe); 21 } 22 document.body.appendChild(container); 23 24 let notifyCount = 0; 25 window.addEventListener('message', event => { 26 switch(event.data) { 27 case 'Notified': 28 notifyCount++; 29 if (notifyCount == iframeCount) { 30 resolve("All iframes notified"); 31 } 32 break; 33 } 34 }, false); 35 }); 36 } 37 38 function testElementLeak(resolve, reject) { 39 return new Promise(function(resolve, reject) { 40 let documentIdentifierArray = new Array(iframeCount); 41 let count = 0; 42 document.querySelectorAll('iframe').forEach(iframe => { 43 documentIdentifierArray[count++] = internals.documentIdentifier(iframe.contentDocument); 44 iframe.remove(); 45 }); 46 47 let handle = setInterval(function() { 48 gc(); 49 documentIdentifierArray.forEach(function(frameDocumentIdentifier) { 50 if (internals && !internals.isDocumentAlive(frameDocumentIdentifier)) { 51 clearInterval(handle); 52 documentIdentifierArray = []; 53 resolve("Detected document release."); 54 } 55 }); 56 }, 10); 57 }); 58 } 59 60 function startTest() { 61 return prepareFrame().then(function(){ 62 return testElementLeak().catch(function(result){ 63 assert_unreached(result); 64 }); 65 }).catch(function(result){ 66 assert_unreached(result); 67 }); 68 } 12 69 13 70 test(_ => { … … 16 73 17 74 promise_test(async () => { 18 return new Promise(function(resolve, reject) { 19 window.addEventListener('message', event => { 20 switch(event.data) { 21 case 'Notified': 22 var testFrame = document.getElementById("testFrame"); 23 let frameDocumentIdentifier = internals.documentIdentifier(testFrame.contentDocument); 24 testFrame.remove(); 25 26 handle = setInterval(function() { 27 gc(); 28 if (internals && !internals.isDocumentAlive(frameDocumentIdentifier)) { 29 clearInterval(handle); 30 resolve(); 31 } 32 }, 10); 33 break; 34 } 35 }, false); 36 setTimeout(() => reject("Test timed out"), 5000); 37 }); 38 }, 'Test elements leak'); 75 return startTest(); 76 }, 'Test elements leak in 20 iframes'); 39 77 40 78 </script>
Note: See TracChangeset
for help on using the changeset viewer.