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