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 592 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
603 } | 603 } |
604 | 604 |
605 void TestReportingDisabledAndDontProceed(const GURL& url) { | 605 void TestReportingDisabledAndDontProceed(const GURL& url) { |
606 SetURLThreatType(url, testing::get<0>(GetParam())); | 606 SetURLThreatType(url, testing::get<0>(GetParam())); |
607 ui_test_utils::NavigateToURL(browser(), url); | 607 ui_test_utils::NavigateToURL(browser(), url); |
608 ASSERT_TRUE(WaitForReady()); | 608 ASSERT_TRUE(WaitForReady()); |
609 | 609 |
610 EXPECT_EQ(HIDDEN, GetVisibility("extended-reporting-opt-in")); | 610 EXPECT_EQ(HIDDEN, GetVisibility("extended-reporting-opt-in")); |
611 EXPECT_EQ(HIDDEN, GetVisibility("opt-in-checkbox")); | 611 EXPECT_EQ(HIDDEN, GetVisibility("opt-in-checkbox")); |
612 EXPECT_EQ(HIDDEN, GetVisibility("proceed-link")); | 612 EXPECT_EQ(HIDDEN, GetVisibility("proceed-link")); |
| 613 EXPECT_EQ(VISIBLE, GetVisibility("learn-more-link")); |
613 EXPECT_TRUE(Click("details-button")); | 614 EXPECT_TRUE(Click("details-button")); |
614 EXPECT_EQ(VISIBLE, GetVisibility("learn-more-link")); | |
615 EXPECT_EQ(VISIBLE, GetVisibility("proceed-link")); | 615 EXPECT_EQ(VISIBLE, GetVisibility("proceed-link")); |
616 | 616 |
617 EXPECT_TRUE(ClickAndWaitForDetach("primary-button")); | 617 EXPECT_TRUE(ClickAndWaitForDetach("primary-button")); |
618 AssertNoInterstitial(false); // Assert the interstitial is gone | 618 AssertNoInterstitial(false); // Assert the interstitial is gone |
619 EXPECT_EQ(GURL(url::kAboutBlankURL), // Back to "about:blank" | 619 EXPECT_EQ(GURL(url::kAboutBlankURL), // Back to "about:blank" |
620 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); | 620 browser()->tab_strip_model()->GetActiveWebContents()->GetURL()); |
621 } | 621 } |
622 | 622 |
623 void VerifyResource( | 623 void VerifyResource( |
624 const ClientSafeBrowsingReportRequest& report, | 624 const ClientSafeBrowsingReportRequest& report, |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1473 | 1473 |
1474 INSTANTIATE_TEST_CASE_P( | 1474 INSTANTIATE_TEST_CASE_P( |
1475 SafeBrowsingBlockingPageIDNTestWithThreatType, | 1475 SafeBrowsingBlockingPageIDNTestWithThreatType, |
1476 SafeBrowsingBlockingPageIDNTest, | 1476 SafeBrowsingBlockingPageIDNTest, |
1477 testing::Combine(testing::Values(false, true), | 1477 testing::Combine(testing::Values(false, true), |
1478 testing::Values(SB_THREAT_TYPE_URL_MALWARE, | 1478 testing::Values(SB_THREAT_TYPE_URL_MALWARE, |
1479 SB_THREAT_TYPE_URL_PHISHING, | 1479 SB_THREAT_TYPE_URL_PHISHING, |
1480 SB_THREAT_TYPE_URL_UNWANTED))); | 1480 SB_THREAT_TYPE_URL_UNWANTED))); |
1481 | 1481 |
1482 } // namespace safe_browsing | 1482 } // namespace safe_browsing |
OLD | NEW |