Chromium Code Reviews| Index: chrome/browser/ssl/ssl_browser_tests.cc |
| diff --git a/chrome/browser/ssl/ssl_browser_tests.cc b/chrome/browser/ssl/ssl_browser_tests.cc |
| index ee444e10b774b24f561bb50bf656c51b20075a06..5d8febcde065f99cba42c983275a5eef3617b545 100644 |
| --- a/chrome/browser/ssl/ssl_browser_tests.cc |
| +++ b/chrome/browser/ssl/ssl_browser_tests.cc |
| @@ -45,6 +45,7 @@ |
| #include "chrome/browser/ssl/ssl_blocking_page.h" |
| #include "chrome/browser/ssl/ssl_error_assistant.pb.h" |
| #include "chrome/browser/ssl/ssl_error_handler.h" |
| +#include "chrome/browser/ssl/superfish_blocking_page.h" |
| #include "chrome/browser/ui/browser.h" |
| #include "chrome/browser/ui/browser_commands.h" |
| #include "chrome/browser/ui/browser_finder.h" |
| @@ -4752,6 +4753,42 @@ IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, NoSuperfishRecorded) { |
| false, 1); |
| } |
| +// Tests that the Superfish interstitial is shown when the Finch feature is |
| +// enabled and the Superfish certificate is present. |
| +IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitial) { |
| + base::test::ScopedFeatureList scoped_feature_list; |
| + scoped_feature_list.InitFromCommandLine("SuperfishInterstitial", |
| + std::string()); |
| + SetUpCertVerifier(true /* use superfish cert */); |
| + GURL url(https_server_.GetURL("/ssl/google.html")); |
|
meacer
2017/06/22 19:06:18
nit: const
estark
2017/06/22 22:01:05
inlined instead
|
| + ui_test_utils::NavigateToURL(browser(), url); |
| + content::WebContents* tab = |
| + browser()->tab_strip_model()->GetActiveWebContents(); |
| + content::WaitForInterstitialAttach(tab); |
| + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); |
| + ASSERT_TRUE(interstitial_page); |
| + EXPECT_EQ(SuperfishBlockingPage::kTypeForTesting, |
| + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); |
| +} |
| + |
| +// Tests that the Superfish interstitial is not shown when the Finch feature is |
| +// disabled. |
| +IN_PROC_BROWSER_TEST_F(SuperfishSSLUITest, SuperfishInterstitialDisabled) { |
| + base::test::ScopedFeatureList scoped_feature_list; |
| + scoped_feature_list.InitFromCommandLine(std::string(), |
| + "SuperfishInterstitial"); |
| + SetUpCertVerifier(true /* use superfish cert */); |
| + GURL url(https_server_.GetURL("/ssl/google.html")); |
|
meacer
2017/06/22 19:06:18
const
estark
2017/06/22 22:01:05
ditto
|
| + ui_test_utils::NavigateToURL(browser(), url); |
| + content::WebContents* tab = |
| + browser()->tab_strip_model()->GetActiveWebContents(); |
| + content::WaitForInterstitialAttach(tab); |
| + InterstitialPage* interstitial_page = tab->GetInterstitialPage(); |
| + ASSERT_TRUE(interstitial_page); |
| + EXPECT_EQ(SSLBlockingPage::kTypeForTesting, |
| + interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); |
| +} |
| + |
| // TODO(jcampan): more tests to do below. |
| // Visit a page over https that contains a frame with a redirect. |