Commit 357bc6f5 authored by Carlos IL's avatar Carlos IL Committed by Commit Bot

Adapt Android Captive Portal tests for committed interstitials.

Bug: 752372
Change-Id: I4a9b4565dd70c85295268fb8d67b4cf84b1a00ee
Reviewed-on: https://chromium-review.googlesource.com/c/1313268Reviewed-by: default avatarMustafa Emre Acer <meacer@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Commit-Queue: Carlos IL <carlosil@chromium.org>
Cr-Commit-Position: refs/heads/master@{#604741}
parent 38e83f2d
...@@ -276,6 +276,7 @@ public abstract class ChromeFeatureList { ...@@ -276,6 +276,7 @@ public abstract class ChromeFeatureList {
public static final String SIMPLIFIED_NTP = "SimplifiedNTP"; public static final String SIMPLIFIED_NTP = "SimplifiedNTP";
public static final String SOLE_INTEGRATION = "SoleIntegration"; public static final String SOLE_INTEGRATION = "SoleIntegration";
public static final String SOUND_CONTENT_SETTING = "SoundContentSetting"; public static final String SOUND_CONTENT_SETTING = "SoundContentSetting";
public static final String SSL_COMMITTED_INTERSTITIALS = "SSLCommittedInterstitials";
public static final String SPANNABLE_INLINE_AUTOCOMPLETE = "SpannableInlineAutocomplete"; public static final String SPANNABLE_INLINE_AUTOCOMPLETE = "SpannableInlineAutocomplete";
public static final String SUBRESOURCE_FILTER = "SubresourceFilter"; public static final String SUBRESOURCE_FILTER = "SubresourceFilter";
public static final String QUERY_IN_OMNIBOX = "QueryInOmnibox"; public static final String QUERY_IN_OMNIBOX = "QueryInOmnibox";
......
...@@ -110,8 +110,13 @@ public class CaptivePortalTest { ...@@ -110,8 +110,13 @@ public class CaptivePortalTest {
Tab tab = mActivityTestRule.getActivity().getActivityTab(); Tab tab = mActivityTestRule.getActivity().getActivityTab();
ChromeTabUtils.loadUrlOnUiThread( ChromeTabUtils.loadUrlOnUiThread(
tab, mServer.getURL("/chrome/test/data/android/navigate/simple.html")); tab, mServer.getURL("/chrome/test/data/android/navigate/simple.html"));
waitForInterstitial(tab.getWebContents(), true);
Assert.assertTrue(tab.isShowingInterstitialPage()); // If committed interstitials are enabled, the interstitial is a regular navigation, so we
// skip interstitial specific checks, and just check the page title.
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.SSL_COMMITTED_INTERSTITIALS)) {
waitForInterstitial(tab.getWebContents(), true);
Assert.assertTrue(tab.isShowingInterstitialPage());
}
new TabTitleObserver(tab, CAPTIVE_PORTAL_INTERSTITIAL_TITLE_PREFIX) { new TabTitleObserver(tab, CAPTIVE_PORTAL_INTERSTITIAL_TITLE_PREFIX) {
@Override @Override
...@@ -179,8 +184,13 @@ public class CaptivePortalTest { ...@@ -179,8 +184,13 @@ public class CaptivePortalTest {
Tab tab = mActivityTestRule.getActivity().getActivityTab(); Tab tab = mActivityTestRule.getActivity().getActivityTab();
ChromeTabUtils.loadUrlOnUiThread( ChromeTabUtils.loadUrlOnUiThread(
tab, mServer.getURL("/chrome/test/data/android/navigate/simple.html")); tab, mServer.getURL("/chrome/test/data/android/navigate/simple.html"));
waitForInterstitial(tab.getWebContents(), true);
Assert.assertTrue(tab.isShowingInterstitialPage()); // If committed interstitials are enabled, the interstitial is a regular navigation, so we
// skip interstitial specific checks, and just check the page title.
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.SSL_COMMITTED_INTERSTITIALS)) {
waitForInterstitial(tab.getWebContents(), true);
Assert.assertTrue(tab.isShowingInterstitialPage());
}
new TabTitleObserver(tab, SSL_INTERSTITIAL_TITLE) new TabTitleObserver(tab, SSL_INTERSTITIAL_TITLE)
.waitForTitleUpdate(INTERSTITIAL_TITLE_UPDATE_TIMEOUT_SECONDS); .waitForTitleUpdate(INTERSTITIAL_TITLE_UPDATE_TIMEOUT_SECONDS);
......
...@@ -68,6 +68,7 @@ const base::Feature* kFeaturesExposedToJava[] = { ...@@ -68,6 +68,7 @@ const base::Feature* kFeaturesExposedToJava[] = {
&features::kServiceWorkerPaymentApps, &features::kServiceWorkerPaymentApps,
&features::kShowTrustedPublisherURL, &features::kShowTrustedPublisherURL,
&features::kSoundContentSetting, &features::kSoundContentSetting,
&features::kSSLCommittedInterstitials,
&features::kWebAuth, &features::kWebAuth,
&features::kWebPayments, &features::kWebPayments,
&feed::kInterestFeedContentSuggestions, &feed::kInterestFeedContentSuggestions,
......
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