OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 // | 4 // |
5 // This test creates a fake safebrowsing service, where we can inject known- | 5 // This test creates a fake safebrowsing service, where we can inject known- |
6 // threat urls. It then uses a real browser to go to these urls, and sends | 6 // threat urls. It then uses a real browser to go to these urls, and sends |
7 // "goback" or "proceed" commands and verifies they work. | 7 // "goback" or "proceed" commands and verifies they work. |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 | 10 |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 // interstitial triggered by a subresource. Regression test for | 1212 // interstitial triggered by a subresource. Regression test for |
1213 // https://crbug.com/659713. | 1213 // https://crbug.com/659713. |
1214 IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, | 1214 IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, |
1215 SecurityStateDowngradedForSubresourceInterstitial) { | 1215 SecurityStateDowngradedForSubresourceInterstitial) { |
1216 WebContents* error_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1216 WebContents* error_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
1217 ASSERT_TRUE(error_tab); | 1217 ASSERT_TRUE(error_tab); |
1218 SecurityStyleTestObserver observer(error_tab); | 1218 SecurityStyleTestObserver observer(error_tab); |
1219 // The security indicator should be downgraded while the interstitial shows. | 1219 // The security indicator should be downgraded while the interstitial shows. |
1220 SetupThreatIframeWarningAndNavigate(); | 1220 SetupThreatIframeWarningAndNavigate(); |
1221 ExpectSecurityIndicatorDowngrade(error_tab, 0u); | 1221 ExpectSecurityIndicatorDowngrade(error_tab, 0u); |
1222 EXPECT_EQ(blink::WebSecurityStyleAuthenticationBroken, | 1222 EXPECT_EQ(blink::WebSecurityStyleInsecure, observer.latest_security_style()); |
1223 observer.latest_security_style()); | |
1224 // Security style summary for Developer Tools should contain a warning. | 1223 // Security style summary for Developer Tools should contain a warning. |
1225 EXPECT_EQ(l10n_util::GetStringUTF8(IDS_SAFEBROWSING_WARNING), | 1224 EXPECT_EQ(l10n_util::GetStringUTF8(IDS_SAFEBROWSING_WARNING), |
1226 observer.latest_security_style_explanations().summary); | 1225 observer.latest_security_style_explanations().summary); |
1227 | 1226 |
1228 // The security indicator should still be downgraded post-interstitial. | 1227 // The security indicator should still be downgraded post-interstitial. |
1229 EXPECT_TRUE(ClickAndWaitForDetach("proceed-link")); | 1228 EXPECT_TRUE(ClickAndWaitForDetach("proceed-link")); |
1230 AssertNoInterstitial(true); | 1229 AssertNoInterstitial(true); |
1231 WebContents* post_tab = browser()->tab_strip_model()->GetActiveWebContents(); | 1230 WebContents* post_tab = browser()->tab_strip_model()->GetActiveWebContents(); |
1232 ASSERT_TRUE(post_tab); | 1231 ASSERT_TRUE(post_tab); |
1233 ExpectSecurityIndicatorDowngrade(post_tab, 0u); | 1232 ExpectSecurityIndicatorDowngrade(post_tab, 0u); |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 | 1433 |
1435 INSTANTIATE_TEST_CASE_P( | 1434 INSTANTIATE_TEST_CASE_P( |
1436 SafeBrowsingBlockingPageIDNTestWithThreatType, | 1435 SafeBrowsingBlockingPageIDNTestWithThreatType, |
1437 SafeBrowsingBlockingPageIDNTest, | 1436 SafeBrowsingBlockingPageIDNTest, |
1438 testing::Combine(testing::Values(false, true), | 1437 testing::Combine(testing::Values(false, true), |
1439 testing::Values(SB_THREAT_TYPE_URL_MALWARE, | 1438 testing::Values(SB_THREAT_TYPE_URL_MALWARE, |
1440 SB_THREAT_TYPE_URL_PHISHING, | 1439 SB_THREAT_TYPE_URL_PHISHING, |
1441 SB_THREAT_TYPE_URL_UNWANTED))); | 1440 SB_THREAT_TYPE_URL_UNWANTED))); |
1442 | 1441 |
1443 } // namespace safe_browsing | 1442 } // namespace safe_browsing |
OLD | NEW |