WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
Patch
bug-183460-20180308101619.patch (text/plain), 8.55 KB, created by
Chris Dumez
on 2018-03-08 10:16:20 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Chris Dumez
Created:
2018-03-08 10:16:20 PST
Size:
8.55 KB
patch
obsolete
>Subversion Revision: 229411 >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 24723967f7e7916ca45fb35c6d1aaee89a533a70..4c6ea10b99ad4bafefd06c4a8809d1a98408dd64 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,28 @@ >+2018-03-08 Chris Dumez <cdumez@apple.com> >+ >+ http/tests/security/frame-loading-via-document-write-async-delegates.html fails with async delegates >+ https://bugs.webkit.org/show_bug.cgi?id=183460 >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ The test has 3 frames which all initially load "about:blank". Then using document.write(), it inserts >+ HTML in each frame. >+ Frame 1: body has an onload event handler, which calls JS is click an anchor link to navigate the frame. >+ Frame 2: body has an onload event handler to do some logging >+ Frame 3: body has an onload event handler and finishes the test (calls testRunner.notifyDone()) >+ >+ The issue is that with asynchronous policy delegates, the first frame may not have navigated yet by the >+ time the third frame is loaded. Indeed, the onload event of the first frame merely clicks am anchor link >+ which will trigger a navigation policy check and then later navigate. >+ >+ To make the test more robust, we now count the number of loads and call testRunner.notifyDone() when >+ we've reached the expected number of loads. >+ >+ * http/tests/security/frame-loading-via-document-write-async-delegates-expected.txt: Added. >+ * http/tests/security/frame-loading-via-document-write-async-delegates.html: Copied from LayoutTests/http/tests/security/frame-loading-via-document-write.html. >+ * http/tests/security/frame-loading-via-document-write.html: >+ * http/tests/security/resources/frame-loading-via-document-write.js: >+ > 2018-03-08 Frederic Wang <fwang@igalia.com> > > Add references to bug 160161 for some MathML failures on iOS and macOS. >diff --git a/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates-expected.txt b/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d4b9f90b5c86c3d12ccfac88a6b073a4602718af >--- /dev/null >+++ b/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates-expected.txt >@@ -0,0 +1,22 @@ >+CONSOLE MESSAGE: line 1: Not allowed to load local resource: abe.png >+ >+ >+-------- >+Frame: 'topRow' >+-------- >+This page was successfully loaded. >+My protocol is http: >+My referrer is blank >+ >+ >+-------- >+Frame: 'middleRow' >+-------- >+Image NOT loaded. >+ >+ >+-------- >+Frame: 'bottomRow' >+-------- >+Image loaded. >+ >diff --git a/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates.html b/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates.html >new file mode 100644 >index 0000000000000000000000000000000000000000..c5989b99590c7f7525e8f75c13115c9dc22299c7 >--- /dev/null >+++ b/LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates.html >@@ -0,0 +1,82 @@ >+<html> >+<head> >+<title></title> >+ >+<script language="JavaScript"> >+ >+const expectedLoadCount = 7; >+let loadCount = 0; >+function finishTestIfLastLoad() >+{ >+ if (++loadCount == expectedLoadCount && window.testRunner) >+ testRunner.notifyDone(); >+} >+ >+function buildFrameset() >+{ >+ if (window.testRunner) { >+ testRunner.waitUntilDone(); >+ testRunner.dumpAsText(); >+ testRunner.dumpChildFramesAsText(); >+ if (testRunner.setShouldDecideNavigationPolicyAfterDelay) >+ testRunner.setShouldDecideNavigationPolicyAfterDelay(true); >+ } >+ >+ var outHTML="<frameset rows=\"33%, 33%, 33%\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"topRow\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"middleRow\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"bottomRow\">"+ >+ "</frameset>"; >+ >+ document.open("text/html","replace"); >+ document.write(outHTML); >+ document.close(); >+ >+ outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+ >+ "</scr" + "ipt></head><body onLoad=\"clickAnchor()\"><table><tr><td>"+ >+ "<a href=\"resources/success.html\" target=\"topRow\" id=\"anchorLink\">Click me. If nothing loads above we have a problem.</a>"+ >+ "</td></tr></table></body></html>"; >+ >+ frames['topRow'].document.open("text/html","replace"); >+ frames['topRow'].document.charset=document.charset; >+ frames['topRow'].document.write(outHTML); >+ frames['topRow'].document.close(); >+ >+ var localImageLocation = "file:///tmp/LayoutTests/fast/dom/resources/abe.png"; >+ if (window.testRunner) >+ localImageLocation = testRunner.pathToLocalResource(localImageLocation); >+ >+ outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+ >+ "</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+ >+ "<div id=\"result\"></div>"+ >+ "<img src=\"" + localImageLocation + "\" id=\"myImg\">"+ >+ "</td></tr></table></body></html>"; >+ >+ frames['middleRow'].document.open("text/html","replace"); >+ frames['middleRow'].document.charset=document.charset; >+ frames['middleRow'].document.write(outHTML); >+ frames['middleRow'].document.close(); >+ >+ outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+ >+ "</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+ >+ "<div id=\"result\"></div>"+ >+ "<img src=\"/resources/abe.png\" id=\"myImg\">"+ >+ "</td></tr></table></body></html>"; >+ >+ frames['bottomRow'].document.open("text/html","replace"); >+ frames['bottomRow'].document.charset=document.charset; >+ frames['bottomRow'].document.write(outHTML); >+ frames['bottomRow'].document.close(); >+} >+ >+buildFrameset(); >+ >+</script> >+</head> >+ >+<body> >+<p>JavaScript FAILED! you should not see this.</p> >+</body> >+ >+</html> >+ >diff --git a/LayoutTests/http/tests/security/frame-loading-via-document-write.html b/LayoutTests/http/tests/security/frame-loading-via-document-write.html >index cbd829d2f5fd131fb70eeebd1add6cef87cfb9a1..de684dfb43d1cadebcafe6bcb7655a42ecd57e27 100644 >--- a/LayoutTests/http/tests/security/frame-loading-via-document-write.html >+++ b/LayoutTests/http/tests/security/frame-loading-via-document-write.html >@@ -4,6 +4,14 @@ > > <script language="JavaScript"> > >+const expectedLoadCount = 7; >+let loadCount = 0; >+function finishTestIfLastLoad() >+{ >+ if (++loadCount == expectedLoadCount && window.testRunner) >+ testRunner.notifyDone(); >+} >+ > function buildFrameset() > { > if (window.testRunner) { >@@ -13,9 +21,9 @@ function buildFrameset() > } > > var outHTML="<frameset rows=\"33%, 33%, 33%\">"+ >- "<frame src=\"\" name=\"topRow\">"+ >- "<frame src=\"\" name=\"middleRow\">"+ >- "<frame src=\"\" name=\"bottomRow\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"topRow\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"middleRow\">"+ >+ "<frame src=\"\" onload=\"finishTestIfLastLoad()\" name=\"bottomRow\">"+ > "</frameset>"; > > document.open("text/html","replace"); >@@ -48,7 +56,7 @@ function buildFrameset() > frames['middleRow'].document.close(); > > outHTML = "<html><head><scr" + "ipt language=\"JavaScript\" src=\"resources/frame-loading-via-document-write.js\">"+ >- "</scr" + "ipt></head><body onLoad=\"lastTest()\"><table><tr><td>"+ >+ "</scr" + "ipt></head><body onLoad=\"didImageLoad()\"><table><tr><td>"+ > "<div id=\"result\"></div>"+ > "<img src=\"/resources/abe.png\" id=\"myImg\">"+ > "</td></tr></table></body></html>"; >diff --git a/LayoutTests/http/tests/security/resources/frame-loading-via-document-write.js b/LayoutTests/http/tests/security/resources/frame-loading-via-document-write.js >index 883c02f31d345daf8e499848bcb6a049db00fe81..99c5b455996016ffafa3f25179ad9aaee1d01ea9 100644 >--- a/LayoutTests/http/tests/security/resources/frame-loading-via-document-write.js >+++ b/LayoutTests/http/tests/security/resources/frame-loading-via-document-write.js >@@ -17,11 +17,3 @@ function didImageLoad() > } > } > >-function lastTest() >-{ >- didImageLoad(); >- >- if (window.testRunner) >- testRunner.notifyDone(); >-} >-
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 183460
:
335314
|
335601
|
335603