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 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
562 ui_test_utils::NavigateToURL(browser(), url); | 562 ui_test_utils::NavigateToURL(browser(), url); |
563 | 563 |
564 SendCommand("\"proceed\""); // Simulate the user clicking "proceed" | 564 SendCommand("\"proceed\""); // Simulate the user clicking "proceed" |
565 AssertNoInterstitial(true); // Assert the interstitial is gone | 565 AssertNoInterstitial(true); // Assert the interstitial is gone |
566 | 566 |
567 EXPECT_EQ( | 567 EXPECT_EQ( |
568 url, | 568 url, |
569 browser()->GetSelectedTabContentsWrapper()->web_contents()->GetURL()); | 569 browser()->GetSelectedTabContentsWrapper()->web_contents()->GetURL()); |
570 } | 570 } |
571 | 571 |
| 572 #if defined(OS_WIN) |
| 573 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, |
| 574 DISABLED_MalwareIframeReportDetails) { |
| 575 #else |
572 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, | 576 IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageTest, |
573 MalwareIframeReportDetails) { | 577 MalwareIframeReportDetails) { |
| 578 #endif |
574 GURL url = test_server()->GetURL(kMalwarePage); | 579 GURL url = test_server()->GetURL(kMalwarePage); |
575 GURL iframe_url = test_server()->GetURL(kMalwareIframe); | 580 GURL iframe_url = test_server()->GetURL(kMalwareIframe); |
576 AddURLResult(iframe_url, SafeBrowsingService::URL_MALWARE); | 581 AddURLResult(iframe_url, SafeBrowsingService::URL_MALWARE); |
577 | 582 |
578 ui_test_utils::NavigateToURL(browser(), url); | 583 ui_test_utils::NavigateToURL(browser(), url); |
579 | 584 |
580 // If the DOM details from renderer did not already return, wait for them. | 585 // If the DOM details from renderer did not already return, wait for them. |
581 if (!details_factory_.get_details()->got_dom()) { | 586 if (!details_factory_.get_details()->got_dom()) { |
582 // This condition might not trigger normally, but if you add a | 587 // This condition might not trigger normally, but if you add a |
583 // sleep(1) in malware_dom_details it triggers :). | 588 // sleep(1) in malware_dom_details it triggers :). |
(...skipping 11 matching lines...) Expand all Loading... |
595 SendCommand("\"proceed\""); // Simulate the user clicking "back" | 600 SendCommand("\"proceed\""); // Simulate the user clicking "back" |
596 AssertNoInterstitial(true); // Assert the interstitial is gone | 601 AssertNoInterstitial(true); // Assert the interstitial is gone |
597 | 602 |
598 EXPECT_EQ( | 603 EXPECT_EQ( |
599 url, | 604 url, |
600 browser()->GetSelectedTabContentsWrapper()->web_contents()->GetURL()); | 605 browser()->GetSelectedTabContentsWrapper()->web_contents()->GetURL()); |
601 AssertReportSent(); | 606 AssertReportSent(); |
602 } | 607 } |
603 | 608 |
604 } // namespace | 609 } // namespace |
OLD | NEW |