Fix DumpRenderTree2 to correctly add JavaScript interfaces to new windows

When adding JavaScript interfaces to a WebView, they must be passed to
the WebView constructor, rather than to
WebView.addJavascriptInterface() if they are to be used immediately
without the risk of race conditions.

This fixes LayoutTest
http/tests/appcache/crash-when-navigating-away-then-back.html

This was fixed for DumpRenderTree in
https://android-git.corp.google.com/g/23804

Change-Id: I1581d6d6cfc1b35be1ec2f2e5b5b944da2b4b935
1 file changed