Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(699)

Unified Diff: android_webview/javatests/src/org/chromium/android_webview/test/SafeBrowsingTest.java

Issue 2898593002: WebView: choose loud vs. quiet interstitial (Closed)
Patch Set: Rebase, fix merge conflicts Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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));
}
}
« no previous file with comments | « android_webview/java/src/org/chromium/android_webview/AwContents.java ('k') | android_webview/ui/grit_resources_whitelist.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698