HtmlInterstitialWebView extends BaseHtmlWebView { @TargetApi(11) @Override public void destroy() { if (currentApiLevel().isAtLeast(HONEYCOMB)) { removeJavascriptInterface(MOPUB_JS_INTERFACE_NAME); } super.destroy(); } HtmlInterstitialWebView(Context context, AdConfiguration adConfiguration); void init(final CustomEventInterstitialListener customEventInterstitialListener, boolean isScrollable, String redirectUrl, String clickthroughUrl); @TargetApi(11) @Override void destroy();  }
@Config(reportSdk = VERSION_CODES.HONEYCOMB) @Test public void destroy_atLeastHoneycomb_shouldRemoveJavascriptInterface() { HtmlInterstitialWebView spySubject = spy(subject); spySubject.destroy(); verify(spySubject).removeJavascriptInterface(MOPUB_JS_INTERFACE_NAME); }
@Config(reportSdk = VERSION_CODES.GINGERBREAD_MR1) @Test public void destroy_beforeHoneycomb_shouldNotRemoveJavascriptInterface() { HtmlInterstitialWebView spySubject = spy(subject); spySubject.destroy(); verify(spySubject, never()).removeJavascriptInterface(MOPUB_JS_INTERFACE_NAME); }