Commit ca449870 authored by Bernhard Bauer's avatar Bernhard Bauer Committed by Commit Bot

Attempt to deflake TrustedCdnPublisherTest.testOfflinePage

Opening multiple custom tabs in quick succession can lead to flakiness,
so load a new URL in the same tab instead.

Also use the correct icon for offline pages.

Bug: 833569
Change-Id: I87e83f65bd8883146398e5ddd9dfd7a7acd2a5c8
Reviewed-on: https://chromium-review.googlesource.com/1013923Reviewed-by: default avatarMichael van Ouwerkerk <mvanouwerkerk@chromium.org>
Commit-Queue: Bernhard Bauer <bauerb@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551352}
parent 08bb7324
...@@ -355,10 +355,12 @@ public class TrustedCdnPublisherUrlTest { ...@@ -355,10 +355,12 @@ public class TrustedCdnPublisherUrlTest {
ThreadUtils.runOnUiThreadBlocking( ThreadUtils.runOnUiThreadBlocking(
() -> { NetworkChangeNotifier.forceConnectivityState(false); }); () -> { NetworkChangeNotifier.forceConnectivityState(false); });
// With no connectivity, loading the offline page should succeed, // Load the URL in the same tab. With no connectivity, loading the offline page should
// but not show a publisher URL. // succeed, but not show a publisher URL.
runTrustedCdnPublisherUrlTest( String testUrl = mWebServer.getResponseUrl("/test.html");
publisherUrl, "com.example.test", null, getDefaultSecurityIcon()); mCustomTabActivityTestRule.loadUrl(testUrl);
verifyUrl(UrlFormatter.formatUrlForSecurityDisplay(testUrl, false));
verifySecurityIcon(R.drawable.offline_pin_round);
} }
private void runTrustedCdnPublisherUrlTest(@Nullable String publisherUrl, String clientPackage, private void runTrustedCdnPublisherUrlTest(@Nullable String publisherUrl, String clientPackage,
......
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