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 | 5 // This test creates a fake safebrowsing service, where we can inject |
6 // malware and phishing urls. It then uses a real browser to go to | 6 // malware and phishing urls. It then uses a real browser to go to |
7 // these urls, and sends "goback" or "proceed" commands and verifies | 7 // these urls, and sends "goback" or "proceed" commands and verifies |
8 // they work. | 8 // they work. |
9 | 9 |
10 #include "base/bind.h" | 10 #include "base/bind.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 protected: | 554 protected: |
555 TestMalwareDetailsFactory details_factory_; | 555 TestMalwareDetailsFactory details_factory_; |
556 | 556 |
557 private: | 557 private: |
558 TestSafeBrowsingServiceFactory factory_; | 558 TestSafeBrowsingServiceFactory factory_; |
559 TestSafeBrowsingBlockingPageFactory blocking_page_factory_; | 559 TestSafeBrowsingBlockingPageFactory blocking_page_factory_; |
560 | 560 |
561 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageTest); | 561 DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageTest); |
562 }; | 562 }; |
563 | 563 |
| 564 // TODO(linux_aura) http://crbug.com/163931 |
| 565 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) && defined(USE_AURA) |
| 566 #define MAYBE_MalwareRedirectInIFrameCanceled DISABLED_MalwareRedirectInIFrameCa
nceled |
| 567 #else |
| 568 #define MAYBE_MalwareRedirectInIFrameCanceled MalwareRedirectInIFrameCanceled |
| 569 #endif |
564 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, | 570 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, |
565 MalwareRedirectInIFrameCanceled) { | 571 MAYBE_MalwareRedirectInIFrameCanceled) { |
566 // 1. Test the case that redirect is a subresource. | 572 // 1. Test the case that redirect is a subresource. |
567 MalwareRedirectCancelAndProceed("openWinIFrame"); | 573 MalwareRedirectCancelAndProceed("openWinIFrame"); |
568 // If the redirect was from subresource but canceled, "proceed" will continue | 574 // If the redirect was from subresource but canceled, "proceed" will continue |
569 // with the rest of resources. | 575 // with the rest of resources. |
570 AssertNoInterstitial(true); | 576 AssertNoInterstitial(true); |
571 } | 577 } |
572 | 578 |
573 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, | 579 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, |
574 MalwareRedirectCanceled) { | 580 MalwareRedirectCanceled) { |
575 // 2. Test the case that redirect is the only resource. | 581 // 2. Test the case that redirect is the only resource. |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
781 SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING); | 787 SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING); |
782 | 788 |
783 EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link")); | 789 EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link")); |
784 AssertNoInterstitial(false); // Assert the interstitial is gone | 790 AssertNoInterstitial(false); // Assert the interstitial is gone |
785 | 791 |
786 // We are in the help page. | 792 // We are in the help page. |
787 EXPECT_EQ( | 793 EXPECT_EQ( |
788 "/goodtoknow/online-safety/phishing/", | 794 "/goodtoknow/online-safety/phishing/", |
789 browser()->tab_strip_model()->GetActiveWebContents()->GetURL().path()); | 795 browser()->tab_strip_model()->GetActiveWebContents()->GetURL().path()); |
790 } | 796 } |
OLD | NEW |