WebKit Bugzilla
Attachment 371597 Details for
Bug 197908
: resize-observer/element-leak.html fails on Windows platform
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-197908-20190608014734.patch (text/plain), 5.75 KB, created by
cathiechen
on 2019-06-07 10:47:35 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
cathiechen
Created:
2019-06-07 10:47:35 PDT
Size:
5.75 KB
patch
obsolete
>Subversion Revision: 246206 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index e388554944a6a22a2340a02a771e957f2c37ca8c..bce5b7ed26e85018adb0016bd5bcb0e50a72ccba 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-06-07 Cathie Chen <cathiechen@igalia.com> >+ >+ Make element-leak.html tests 20 iframes >+ https://bugs.webkit.org/show_bug.cgi?id=197908 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ we have conservative GC, the removed objects might keep alive for a while. Change the test case >+ to 20 iframes. This would make the result more accurate. >+ >+ * platform/win/TestExpectations: >+ * resize-observer/element-leak-expected.txt: >+ * resize-observer/element-leak.html: >+ > 2019-06-07 Shawn Roberts <sroberts@apple.com> > > http/tests/storageAccess/request-and-grant-access-then-navigate-same-site-should-have-access.html is a flaky timeout >diff --git a/LayoutTests/platform/win/TestExpectations b/LayoutTests/platform/win/TestExpectations >index 69e52fb3d8e7c8e90aefd28dd465cf2718b530bc..c2e781abe1b91c91fa523d2b4ef66bfdc8a0386b 100644 >--- a/LayoutTests/platform/win/TestExpectations >+++ b/LayoutTests/platform/win/TestExpectations >@@ -4401,7 +4401,3 @@ webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource.html [ Skip ] > webkit.org/b/195623 http/tests/cache/link-prefetch-main-resource-iframe.html [ Skip ] > > webkit.org/b/198112 http/tests/security/showModalDialog-sync-cross-origin-page-load2.html [ Skip ] >- >-# The removed elements couldn't be released properly in Win. >-# The relevant bug is https://bugs.webkit.org/show_bug.cgi?id=197908 >-resize-observer/element-leak.html [ Skip ] >diff --git a/LayoutTests/resize-observer/element-leak-expected.txt b/LayoutTests/resize-observer/element-leak-expected.txt >index a25f3dbe173a59b991b2355765501ea4638d8971..e4c10546912f5b16bb6600e5efc9e1b616b4daa2 100644 >--- a/LayoutTests/resize-observer/element-leak-expected.txt >+++ b/LayoutTests/resize-observer/element-leak-expected.txt >@@ -1,4 +1,4 @@ > > PASS ResizeObserver implemented >-PASS Test elements leak >+PASS Test elements leak in 20 iframes > >diff --git a/LayoutTests/resize-observer/element-leak.html b/LayoutTests/resize-observer/element-leak.html >index 316f2afcc6646e875424093d990f3c84f9b5eaba..7451b2155deb25b2c10434b5502fc1d65d528b3a 100644 >--- a/LayoutTests/resize-observer/element-leak.html >+++ b/LayoutTests/resize-observer/element-leak.html >@@ -7,35 +7,78 @@ > <script src="../resources/gc.js"></script> > </head> > <body> >-<iframe id="testFrame" src="resources/element-leak-frame.html"></iframe> > <script> >+setup({ explicit_timeout: true }); > >-test(_ => { >- assert_own_property(window, "ResizeObserver"); >-}, "ResizeObserver implemented"); >- >-promise_test(async () => { >+let iframeCount = 20; >+function prepareFrame() { > return new Promise(function(resolve, reject) { >+ let container = document.createElement("div"); >+ for (let i = 0; i < iframeCount; ++i) { >+ let ifrm = document.createElement("iframe"); >+ ifrm.style.height = "1px"; >+ ifrm.setAttribute("src", "resources/element-leak-frame.html"); >+ container.appendChild(ifrm); >+ } >+ document.body.appendChild(container); >+ >+ let notifyTimer = setTimeout(() => reject("Waiting Notified timed out."), 10000); >+ let notifyCount = 0; > window.addEventListener('message', event => { > switch(event.data) { > case 'Notified': >- var testFrame = document.getElementById("testFrame"); >- let frameDocumentIdentifier = internals.documentIdentifier(testFrame.contentDocument); >- testFrame.remove(); >- >- handle = setInterval(function() { >- gc(); >- if (internals && !internals.isDocumentAlive(frameDocumentIdentifier)) { >- clearInterval(handle); >- resolve(); >- } >- }, 10); >+ notifyCount++; >+ if (notifyCount == iframeCount) { >+ clearTimeout(notifyTimer); >+ resolve("All iframes notified"); >+ } > break; > } >- }, false); >- setTimeout(() => reject("Test timed out"), 5000); >+ }, false); >+ }); >+} >+ >+function testElementLeak(resolve, reject) { >+ return new Promise(function(resolve, reject) { >+ let documentIdentifierArray = new Array(iframeCount); >+ let count = 0; >+ document.querySelectorAll('iframe').forEach(iframe => { >+ documentIdentifierArray[count++] = internals.documentIdentifier(iframe.contentDocument); >+ iframe.remove(); >+ }); >+ >+ let gcTimer = setTimeout(() => reject("testElementLeak timed out."), 10000); >+ let handle = setInterval(function() { >+ gc(); >+ documentIdentifierArray.forEach(function(frameDocumentIdentifier) { >+ if (internals && !internals.isDocumentAlive(frameDocumentIdentifier)) { >+ clearInterval(handle); >+ clearTimeout(gcTimer); >+ documentIdentifierArray = []; >+ resolve("Detected document release."); >+ } >+ }); >+ }, 10); >+ }); >+} >+ >+function startTest() { >+ return prepareFrame().then(function(){ >+ return testElementLeak().catch(function(result){ >+ assert_unreached(result); >+ }); >+ }).catch(function(result){ >+ assert_unreached(result); > }); >-}, 'Test elements leak'); >+} >+ >+test(_ => { >+ assert_own_property(window, "ResizeObserver"); >+}, "ResizeObserver implemented"); >+ >+promise_test(async () => { >+ return startTest(); >+}, 'Test elements leak in 20 iframes'); > > </script> > </body>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 197908
:
369932
|
369933
|
369948
|
369954
|
370042
|
370045
|
371578
|
371595
|
371597
|
371645
|
371650