Commit d7f2e347 authored by Carlos IL's avatar Carlos IL Committed by Commit Bot

Fix loadInterstitialAndClick link SB webview tests for CI

Tests that involve clicking a link that results in a redirect were
failing with committed interstitials enabled. This CL changes the
check used to catch that case.

Bug: 1046832
Change-Id: Ib57bf24307b58b8441250aa448c271066e8b8ad6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2028299Reviewed-by: default avatarNate Fischer <ntfschr@chromium.org>
Commit-Queue: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#736638}
parent c15c5a36
...@@ -1236,7 +1236,16 @@ public class SafeBrowsingTest { ...@@ -1236,7 +1236,16 @@ public class SafeBrowsingTest {
int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount(); int pageFinishedCount = mContentsClient.getOnPageFinishedHelper().getCallCount();
clickLinkById(linkId); clickLinkById(linkId);
mContentsClient.getOnPageFinishedHelper().waitForCallback(pageFinishedCount); mContentsClient.getOnPageFinishedHelper().waitForCallback(pageFinishedCount);
Assert.assertEquals(linkUrl, mAwContents.getUrl()); if (AwFeatureList.isEnabled(AwFeatures.SAFE_BROWSING_COMMITTED_INTERSTITIALS)) {
// Some click tests involve URLs that redirect and mAwContents.getUrl() sometimes
// returns the post-redirect URL, so we instead check with ShouldInterceptRequest.
AwContentsClient.AwWebResourceRequest requestsForUrl =
mContentsClient.getShouldInterceptRequestHelper().getRequestsForUrl(linkUrl);
// Make sure the URL was seen for a main frame navigation.
Assert.assertTrue(requestsForUrl.isMainFrame);
} else {
Assert.assertEquals(linkUrl, mAwContents.getUrl());
}
} }
@Test @Test
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment