TestRunner::notifyDone() should be safely reentrant
authorpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 18:27:06 +0000 (18:27 +0000)
committerpvollan@apple.com <pvollan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 15 Apr 2019 18:27:06 +0000 (18:27 +0000)
commitc637799ab516f99cd9294f6650fb678c02dc2337
tree4fa87f815e4c9286eb142e0ffa25beeed116d792
parent95b215b9f276d4e680f3bf04b1da411c4862270f
TestRunner::notifyDone() should be safely reentrant
https://bugs.webkit.org/show_bug.cgi?id=196898

Reviewed by Darin Adler.

It is currently possible that TestRunner::notifyDone() will call itself, since
notifyDone() will force a repaint, which can start executing JavaScript, which
may call notifyDone() again. This can lead to test failures and flakiness.
Fix this by setting the m_waitToDump flag before calling the dump() method.

* DumpRenderTree/mac/TestRunnerMac.mm:
(TestRunner::notifyDone):
(TestRunner::forceImmediateCompletion):
* DumpRenderTree/win/TestRunnerWin.cpp:
(TestRunner::notifyDone):
(TestRunner::forceImmediateCompletion):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244273 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/DumpRenderTree/mac/TestRunnerMac.mm
Tools/DumpRenderTree/win/TestRunnerWin.cpp