Improve unit tests of WebView

This guards that https://bugzilla.mozilla.org/show_bug.cgi?id=1001853
like error does not reappear.
Merge pull request #220 from rainemak/testWebView

Improve unit tests of WebView