Index: android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java |
diff --git a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java |
index 0e5c4865aa0633890736ba5abd929b414e28369a..deaa38c549cc0d5ffcff6297abcd588678aec886 100644 |
--- a/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java |
+++ b/android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java |
@@ -427,16 +427,20 @@ public class SafeBrowsingTest extends AwTestBase { |
@SmallTest |
@Feature({"AndroidWebView"}) |
@CommandLineFlags.Add(AwSwitches.WEBVIEW_ENABLE_SAFEBROWSING_SUPPORT) |
- public void testSafeBrowsingShowsNetworkErrorForOddSizedViews() throws Throwable { |
+ public void testSafeBrowsingShowsQuietInterstitialForOddSizedViews() throws Throwable { |
mAwContents.setCanShowBigInterstitial(false); |
+ loadGreenPage(); |
+ int count = mWebContentsObserver.getAttachedInterstitialPageHelper().getCallCount(); |
final String responseUrl = mTestServer.getURL(MALWARE_HTML_PATH); |
- OnReceivedError2Helper errorHelper = mContentsClient.getOnReceivedError2Helper(); |
- int errorCount = errorHelper.getCallCount(); |
loadUrlAsync(mAwContents, responseUrl); |
- errorHelper.waitForCallback(errorCount); |
- assertEquals( |
- ErrorCodeConversionHelper.ERROR_UNSAFE_RESOURCE, errorHelper.getError().errorCode); |
- assertEquals("Network error is for the malicious page", responseUrl, |
- errorHelper.getRequest().url); |
+ mWebContentsObserver.getAttachedInterstitialPageHelper().waitForCallback(count); |
+ assertTrue("Original page should not be showing", |
+ GREEN_PAGE_BACKGROUND_COLOR |
+ != GraphicsTestUtils.getPixelColorAtCenterOfView( |
+ mAwContents, mContainerView)); |
+ assertTrue("Target page should not be visible", |
+ MALWARE_PAGE_BACKGROUND_COLOR |
+ != GraphicsTestUtils.getPixelColorAtCenterOfView( |
+ mAwContents, mContainerView)); |
} |
} |