Deduplicate a bit of code across DumpRenderTree and WebKitTestRunner.
Created attachment 405958 [details] Patch
Committed r265271: <https://trac.webkit.org/changeset/265271> All reviewed patches have been landed. Closing bug and clearing flags on attachment 405958 [details].