http/tests/security/frame-loading-via-document-write-async-delegates.html fails with...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 18:45:59 +0000 (18:45 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 9 Mar 2018 18:45:59 +0000 (18:45 +0000)
commite67344306e6c53327e2f594517e77f3cdca17a43
treee6e040e79a6cd2f9db1c31ece49d2b27f6f1ae1c
parent8f1e7221f5583521caf585c454a356f27bb14429
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 Alex Christensen.

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:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@229468 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates-expected.txt [new file with mode: 0644]
LayoutTests/http/tests/security/frame-loading-via-document-write-async-delegates.html [new file with mode: 0644]
LayoutTests/http/tests/security/frame-loading-via-document-write.html
LayoutTests/http/tests/security/resources/frame-loading-via-document-write.js