| Index: chrome/browser/ui/browser_browsertest.cc
|
| diff --git a/chrome/browser/ui/browser_browsertest.cc b/chrome/browser/ui/browser_browsertest.cc
|
| index 43f0e7635d649796056282813013651c8a133ccd..43ca35392af70c3aa35e25a9a6f3b1be1c7afd72 100644
|
| --- a/chrome/browser/ui/browser_browsertest.cc
|
| +++ b/chrome/browser/ui/browser_browsertest.cc
|
| @@ -384,8 +384,7 @@
|
|
|
| // Check that |observer|'s latest event was for an expired certificate
|
| // and that it saw the proper SecurityStyle and explanations.
|
| -void CheckBrokenSecurityStyle(const SecurityStyleTestObserver& observer,
|
| - int error) {
|
| +void CheckExpiredSecurityStyle(const SecurityStyleTestObserver& observer) {
|
| EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATION_BROKEN,
|
| observer.latest_security_style());
|
|
|
| @@ -398,7 +397,8 @@
|
| EXPECT_EQ(l10n_util::GetStringUTF8(IDS_CERTIFICATE_CHAIN_ERROR),
|
| expired_explanation.broken_explanations[0].summary);
|
|
|
| - base::string16 error_string = base::UTF8ToUTF16(net::ErrorToString(error));
|
| + base::string16 error_string =
|
| + base::UTF8ToUTF16(net::ErrorToString(net::ERR_CERT_DATE_INVALID));
|
| EXPECT_EQ(l10n_util::GetStringFUTF8(
|
| IDS_CERTIFICATE_CHAIN_ERROR_DESCRIPTION_FORMAT, error_string),
|
| expired_explanation.broken_explanations[0].description);
|
| @@ -2950,29 +2950,6 @@
|
| EXPECT_EQ(0u, observer.latest_explanations().warning_explanations.size());
|
| EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size());
|
|
|
| - // Navigate to a bad HTTPS page on a different host, and then click
|
| - // Back to verify that the previous good security style is seen again.
|
| - host_resolver()->AddRule("www.example_broken.test", "127.0.0.1");
|
| - GURL::Replacements replace_host;
|
| - replace_host.SetHostStr("www.example_broken.test");
|
| - GURL https_url_different_host =
|
| - valid_https_url.ReplaceComponents(replace_host);
|
| - ui_test_utils::NavigateToURL(browser(), https_url_different_host);
|
| - CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID);
|
| - ProceedThroughInterstitial(web_contents);
|
| - CheckBrokenSecurityStyle(observer, net::ERR_CERT_COMMON_NAME_INVALID);
|
| -
|
| - content::WindowedNotificationObserver back_nav_load_observer(
|
| - content::NOTIFICATION_LOAD_STOP,
|
| - content::Source<NavigationController>(&web_contents->GetController()));
|
| - chrome::GoBack(browser(), CURRENT_TAB);
|
| - back_nav_load_observer.Wait();
|
| -
|
| - EXPECT_EQ(content::SECURITY_STYLE_AUTHENTICATED,
|
| - observer.latest_security_style());
|
| - EXPECT_EQ(0u, observer.latest_explanations().warning_explanations.size());
|
| - EXPECT_EQ(0u, observer.latest_explanations().broken_explanations.size());
|
| -
|
| // Visit an (otherwise valid) HTTPS page that displays mixed content.
|
| std::string replacement_path;
|
| ASSERT_TRUE(GetFilePathWithHostAndPortReplacement(
|
| @@ -3000,7 +2977,7 @@
|
| // interstitial should fire.
|
| content::WaitForInterstitialAttach(web_contents);
|
| EXPECT_TRUE(web_contents->ShowingInterstitialPage());
|
| - CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID);
|
| + CheckExpiredSecurityStyle(observer);
|
|
|
| // Before clicking through, navigate to a different page, and then go
|
| // back to the interstitial.
|
| @@ -3015,16 +2992,16 @@
|
| ui_test_utils::NavigateToURL(browser(), expired_url);
|
| content::WaitForInterstitialAttach(web_contents);
|
| EXPECT_TRUE(web_contents->ShowingInterstitialPage());
|
| - CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID);
|
| + CheckExpiredSecurityStyle(observer);
|
|
|
| // Since the next expected style is the same as the previous, clear
|
| // the observer (to make sure that the event fires twice and we don't
|
| // just see the previous event's style).
|
| observer.ClearLatestSecurityStyleAndExplanations();
|
|
|
| - // Other conditions cannot be tested on this host after clicking
|
| - // through because once the interstitial is clicked through, all URLs
|
| - // for this host will remain in a broken state.
|
| + // Other conditions cannot be tested after clicking through because
|
| + // once the interstitial is clicked through, all URLs for this host
|
| + // will remain in a broken state.
|
| ProceedThroughInterstitial(web_contents);
|
| - CheckBrokenSecurityStyle(observer, net::ERR_CERT_DATE_INVALID);
|
| -}
|
| + CheckExpiredSecurityStyle(observer);
|
| +}
|
|
|