This might have regressed when we started to use the JSC garbage collector timers. The thing is that we expect that the WebProcessTester object that we expose to JavaScript is released when the web frame is destroyed, but that's no longer the case. On window object cleared a GC is scheduled, but JSC timers do the actual garbage collection later. In the case of tests that never happens because the web process finishes quickly after the test. We need to force a garbage collection at some point when the web page is destroyed.
Created attachment 335184 [details] Patch
Thanks for the patch. If this patch contains new public API please make sure it follows the guidelines for new WebKit2 GTK+ API. See http://trac.webkit.org/wiki/WebKitGTK/AddingNewWebKit2API
Committed r229395: <https://trac.webkit.org/changeset/229395>
<rdar://problem/38250675>