Implement TestWebSettings.setJavaScriptCanOpenWindowAutomatically.

Closes #968.