| Index: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
|
| diff --git a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
|
| index f744b11d8f0b11c5578909fcc5a078bc61707720..92f2249fe84676df655a2f283daf623de91ab7c2 100644
|
| --- a/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
|
| +++ b/chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
|
| @@ -305,52 +305,6 @@ class TestMalwareDetailsFactory : public MalwareDetailsFactory {
|
| };
|
|
|
| // A SafeBrowingBlockingPage class that lets us wait until it's hidden.
|
| -class TestSafeBrowsingBlockingPageV2 : public SafeBrowsingBlockingPageV2 {
|
| - public:
|
| - TestSafeBrowsingBlockingPageV2(SafeBrowsingUIManager* manager,
|
| - WebContents* web_contents,
|
| - const UnsafeResourceList& unsafe_resources)
|
| - : SafeBrowsingBlockingPageV2(manager, web_contents, unsafe_resources),
|
| - wait_for_delete_(false) {
|
| - // Don't wait the whole 3 seconds for the browser test.
|
| - malware_details_proceed_delay_ms_ = 100;
|
| - }
|
| -
|
| - virtual ~TestSafeBrowsingBlockingPageV2() {
|
| - LOG(INFO) << __FUNCTION__;
|
| - if (!wait_for_delete_)
|
| - return;
|
| -
|
| - // Notify that we are gone
|
| - base::MessageLoopForUI::current()->Quit();
|
| - wait_for_delete_ = false;
|
| - }
|
| -
|
| - void WaitForDelete() {
|
| - LOG(INFO) << __FUNCTION__;
|
| - wait_for_delete_ = true;
|
| - content::RunMessageLoop();
|
| - }
|
| -
|
| - // InterstitialPageDelegate methods:
|
| - virtual void CommandReceived(const std::string& command) OVERRIDE {
|
| - LOG(INFO) << __FUNCTION__ << " " << command;
|
| - SafeBrowsingBlockingPageV2::CommandReceived(command);
|
| - }
|
| - virtual void OnProceed() OVERRIDE {
|
| - LOG(INFO) << __FUNCTION__;
|
| - SafeBrowsingBlockingPageV2::OnProceed();
|
| - }
|
| - virtual void OnDontProceed() OVERRIDE {
|
| - LOG(INFO) << __FUNCTION__;
|
| - SafeBrowsingBlockingPageV2::OnDontProceed();
|
| - }
|
| -
|
| - private:
|
| - bool wait_for_delete_;
|
| -};
|
| -
|
| -// A SafeBrowingBlockingPage class that lets us wait until it's hidden.
|
| class TestSafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPageV3 {
|
| public:
|
| TestSafeBrowsingBlockingPageV3(SafeBrowsingUIManager* manager,
|
| @@ -399,7 +353,7 @@ class TestSafeBrowsingBlockingPageV3 : public SafeBrowsingBlockingPageV3 {
|
| class TestSafeBrowsingBlockingPageFactory
|
| : public SafeBrowsingBlockingPageFactory {
|
| public:
|
| - TestSafeBrowsingBlockingPageFactory() : version_(2) { }
|
| + TestSafeBrowsingBlockingPageFactory() { }
|
| virtual ~TestSafeBrowsingBlockingPageFactory() { }
|
|
|
| virtual SafeBrowsingBlockingPage* CreateSafeBrowsingPage(
|
| @@ -407,20 +361,9 @@ class TestSafeBrowsingBlockingPageFactory
|
| WebContents* web_contents,
|
| const SafeBrowsingBlockingPage::UnsafeResourceList& unsafe_resources)
|
| OVERRIDE {
|
| - if (version_ == 3) {
|
| - return new TestSafeBrowsingBlockingPageV3(delegate, web_contents,
|
| - unsafe_resources);
|
| - }
|
| - return new TestSafeBrowsingBlockingPageV2(delegate, web_contents,
|
| + return new TestSafeBrowsingBlockingPageV3(delegate, web_contents,
|
| unsafe_resources);
|
| }
|
| -
|
| - void SetTestVersion(int version) {
|
| - version_ = version;
|
| - }
|
| -
|
| - private:
|
| - int version_;
|
| };
|
|
|
| } // namespace
|
| @@ -442,7 +385,6 @@ class SafeBrowsingBlockingPageBrowserTest
|
| virtual void SetUp() OVERRIDE {
|
| SafeBrowsingService::RegisterFactory(&factory_);
|
| SafeBrowsingBlockingPage::RegisterFactory(&blocking_page_factory_);
|
| - blocking_page_factory_.SetTestVersion(GetParam());
|
| MalwareDetails::RegisterFactory(&details_factory_);
|
| InProcessBrowserTest::SetUp();
|
| }
|
| @@ -532,17 +474,10 @@ class SafeBrowsingBlockingPageBrowserTest
|
|
|
| if (contents->ShowingInterstitialPage() && wait_for_delete) {
|
| // We'll get notified when the interstitial is deleted.
|
| - if (GetParam() == 3) {
|
| - TestSafeBrowsingBlockingPageV3* page =
|
| - static_cast<TestSafeBrowsingBlockingPageV3*>(
|
| - contents->GetInterstitialPage()->GetDelegateForTesting());
|
| - page->WaitForDelete();
|
| - } else {
|
| - TestSafeBrowsingBlockingPageV2* page =
|
| - static_cast<TestSafeBrowsingBlockingPageV2*>(
|
| - contents->GetInterstitialPage()->GetDelegateForTesting());
|
| - page->WaitForDelete();
|
| - }
|
| + TestSafeBrowsingBlockingPageV3* page =
|
| + static_cast<TestSafeBrowsingBlockingPageV3*>(
|
| + contents->GetInterstitialPage()->GetDelegateForTesting());
|
| + page->WaitForDelete();
|
| }
|
|
|
| // Can't use InterstitialPage::GetInterstitialPage() because that
|
| @@ -700,10 +635,6 @@ class SafeBrowsingBlockingPageBrowserTest
|
| DISALLOW_COPY_AND_ASSIGN(SafeBrowsingBlockingPageBrowserTest);
|
| };
|
|
|
| -INSTANTIATE_TEST_CASE_P(SafeBrowsingInterstitialVersions,
|
| - SafeBrowsingBlockingPageBrowserTest,
|
| - testing::Values(2, 3));
|
| -
|
| // TODO(linux_aura) http://crbug.com/163931
|
| // TODO(win_aura) http://crbug.com/154081
|
| #if defined(USE_AURA) && !defined(OS_CHROMEOS)
|
| @@ -711,7 +642,7 @@ INSTANTIATE_TEST_CASE_P(SafeBrowsingInterstitialVersions,
|
| #else
|
| #define MAYBE_MalwareRedirectInIFrameCanceled MalwareRedirectInIFrameCanceled
|
| #endif
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MAYBE_MalwareRedirectInIFrameCanceled) {
|
| // 1. Test the case that redirect is a subresource.
|
| MalwareRedirectCancelAndProceed("openWinIFrame");
|
| @@ -720,7 +651,7 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| AssertNoInterstitial(true);
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MalwareRedirectCanceled) {
|
| // 2. Test the case that redirect is the only resource.
|
| MalwareRedirectCancelAndProceed("openWin");
|
| @@ -729,7 +660,7 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| EXPECT_TRUE(YesInterstitial());
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MalwareDontProceed) {
|
| #if defined(OS_WIN) && defined(USE_ASH)
|
| // Disable this test in Metro+Ash for now (http://crbug.com/262796).
|
| @@ -739,63 +670,31 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
|
|
| SetupWarningAndNavigate(SB_THREAT_TYPE_URL_MALWARE);
|
|
|
| - if (GetParam() == 2) {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("malware-icon"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("subresource-icon"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("phishing-icon"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("check-report"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed"));
|
| - EXPECT_TRUE(Click("see-more-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("back"));
|
| - } else {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(Click("details-button"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
| - }
|
| + EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(Click("details-button"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
|
|
| AssertNoInterstitial(false); // Assert the interstitial is gone
|
| EXPECT_EQ(GURL(url::kAboutBlankURL), // Back to "about:blank"
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, MalwareProceed) {
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest, MalwareProceed) {
|
| GURL url = SetupWarningAndNavigate(SB_THREAT_TYPE_URL_MALWARE);
|
|
|
| - if (GetParam() == 2)
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed"));
|
| - else
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| AssertNoInterstitial(true); // Assert the interstitial is gone.
|
| EXPECT_EQ(url,
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| - MalwareLearnMoreV2) {
|
| - if (GetParam() == 3) return; // Don't have this link in V3.
|
| - SetupWarningAndNavigate(SB_THREAT_TYPE_URL_MALWARE);
|
| -
|
| - EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link"));
|
| - AssertNoInterstitial(false); // Assert the interstitial is gone
|
| -
|
| - // We are in the help page.
|
| - EXPECT_EQ(
|
| - "/transparencyreport/safebrowsing/",
|
| - browser()->tab_strip_model()->GetActiveWebContents()->GetURL().path());
|
| -}
|
| -
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MalwareIframeDontProceed) {
|
| #if defined(OS_WIN) && defined(USE_ASH)
|
| // Disable this test in Metro+Ash for now (http://crbug.com/262796).
|
| @@ -805,30 +704,15 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
|
|
| SetupMalwareIframeWarningAndNavigate();
|
|
|
| - if (GetParam() == 2) {
|
| - EXPECT_EQ(HIDDEN, GetVisibility("malware-icon"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("subresource-icon"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("phishing-icon"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("check-report"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed"));
|
| - EXPECT_TRUE(Click("see-more-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("back"));
|
| - } else {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(Click("details-button"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
| - }
|
| + EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(Click("details-button"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
|
|
| AssertNoInterstitial(false); // Assert the interstitial is gone
|
|
|
| @@ -836,32 +720,20 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MalwareIframeProceed) {
|
| GURL url = SetupMalwareIframeWarningAndNavigate();
|
|
|
| - if (GetParam() == 2)
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed"));
|
| - else
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| AssertNoInterstitial(true); // Assert the interstitial is gone
|
|
|
| EXPECT_EQ(url,
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| -// http://crbug.com/273302
|
| -#if defined(OS_WIN)
|
| -// Temporarily re-enabled to get some logs.
|
| -#define MAYBE_MalwareIframeReportDetails MalwareIframeReportDetails
|
| -#else
|
| -#define MAYBE_MalwareIframeReportDetails MalwareIframeReportDetails
|
| -#endif
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| - MAYBE_MalwareIframeReportDetails) {
|
| - // TODO(felt): Enable for V3 when the checkbox is added.
|
| - if (GetParam() == 3) return;
|
| -
|
| +// TODO(felt): Needs to be re-enabled: http://crbug.com/273302
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| + DISABLED_MalwareIframeReportDetails) {
|
| scoped_refptr<content::MessageLoopRunner> malware_report_sent_runner(
|
| new content::MessageLoopRunner);
|
| SetReportSentCallback(malware_report_sent_runner->QuitClosure());
|
| @@ -902,13 +774,12 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| // Verifies that the "proceed anyway" link isn't available when it is disabled
|
| // by the corresponding policy. Also verifies that sending the "proceed"
|
| // command anyway doesn't advance to the malware site.
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, ProceedDisabled) {
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest, ProceedDisabled) {
|
| #if defined(OS_WIN) && defined(USE_ASH)
|
| // Disable this test in Metro+Ash for now (http://crbug.com/262796).
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
|
| return;
|
| #endif
|
| - if (GetParam() == 3) return;
|
|
|
| // Simulate a policy disabling the "proceed anyway" link.
|
| browser()->profile()->GetPrefs()->SetBoolean(
|
| @@ -916,26 +787,14 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, ProceedDisabled) {
|
|
|
| SetupWarningAndNavigate(SB_THREAT_TYPE_URL_MALWARE);
|
|
|
| - if (GetParam() == 2) {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("check-report"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-span"));
|
| - EXPECT_TRUE(Click("see-more-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-span"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed"));
|
| - } else {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("final-paragraph"));
|
| - EXPECT_TRUE(Click("details-button"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("final-paragraph"));
|
| - SendCommand("proceed");
|
| - }
|
| + EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("final-paragraph"));
|
| + EXPECT_TRUE(Click("details-button"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("final-paragraph"));
|
| + SendCommand("proceed");
|
|
|
| // The "proceed" command should go back instead, if proceeding is disabled.
|
| AssertNoInterstitial(true);
|
| @@ -943,17 +802,17 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, ProceedDisabled) {
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| +// TODO(felt): Needs to be re-enabled: http://crbug.com/273302
|
| // Verifies that the reporting checkbox is hidden on non-HTTP pages.
|
| // TODO(mattm): Should also verify that no report is sent, but there isn't a
|
| // good way to do that in the current design.
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, ReportingDisabled) {
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| + DISABLED_ReportingDisabled) {
|
| #if defined(OS_WIN) && defined(USE_ASH)
|
| // Disable this test in Metro+Ash for now (http://crbug.com/262796).
|
| if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAshBrowserTests))
|
| return;
|
| #endif
|
| - // TODO(felt): Enable for V3 when the checkbox is added.
|
| - if (GetParam() == 3) return;
|
|
|
| browser()->profile()->GetPrefs()->SetBoolean(
|
| prefs::kSafeBrowsingExtendedReportingEnabled, true);
|
| @@ -980,7 +839,7 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest, ReportingDisabled) {
|
| browser()->tab_strip_model()->GetActiveWebContents()->GetURL());
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| PhishingDontProceed) {
|
| #if defined(OS_WIN) && defined(USE_ASH)
|
| // Disable this test in Metro+Ash for now (http://crbug.com/262796).
|
| @@ -990,30 +849,15 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
|
|
| SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING);
|
|
|
| - if (GetParam() == 2) {
|
| - EXPECT_EQ(HIDDEN, GetVisibility("malware-icon"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("subresource-icon"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("phishing-icon"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("check-report"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed"));
|
| - EXPECT_TRUE(Click("see-more-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("show-diagnostic-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("report-error-link"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("back"));
|
| - } else {
|
| - EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(Click("details-button"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| - EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| - EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| - EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
| - }
|
| + EXPECT_EQ(VISIBLE, GetVisibility("primary-button"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("details"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(Click("details-button"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("details"));
|
| + EXPECT_EQ(VISIBLE, GetVisibility("proceed-link"));
|
| + EXPECT_EQ(HIDDEN, GetVisibility("error-code"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("primary-button"));
|
|
|
| AssertNoInterstitial(false); // Assert the interstitial is gone
|
| EXPECT_EQ(GURL(url::kAboutBlankURL), // We are back to "about:blank".
|
| @@ -1027,15 +871,12 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| #else
|
| #define MAYBE_PhishingProceed PhishingProceed
|
| #endif
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MAYBE_PhishingProceed) {
|
| GURL url = SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING);
|
| LOG(INFO) << "1";
|
|
|
| - if (GetParam() == 2)
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed"));
|
| - else
|
| - EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("proceed-link"));
|
| LOG(INFO) << "2";
|
| AssertNoInterstitial(true); // Assert the interstitial is gone
|
| LOG(INFO) << "3";
|
| @@ -1044,20 +885,6 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| LOG(INFO) << "4";
|
| }
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| - PhishingReportErrorV2) {
|
| - if (GetParam() == 3) return; // Not supported in V3.
|
| - SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING);
|
| -
|
| - EXPECT_TRUE(ClickAndWaitForDetach("report-error-link"));
|
| - AssertNoInterstitial(false); // Assert the interstitial is gone
|
| -
|
| - // We are in the error reporting page.
|
| - EXPECT_EQ(
|
| - "/safebrowsing/report_error/",
|
| - browser()->tab_strip_model()->GetActiveWebContents()->GetURL().path());
|
| -}
|
| -
|
| // See crbug.com/248447
|
| #if defined(OS_WIN)
|
| // Temporarily re-enabled to get some logs.
|
| @@ -1066,15 +893,12 @@ IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| #define MAYBE_PhishingLearnMore PhishingLearnMore
|
| #endif
|
|
|
| -IN_PROC_BROWSER_TEST_P(SafeBrowsingBlockingPageBrowserTest,
|
| +IN_PROC_BROWSER_TEST_F(SafeBrowsingBlockingPageBrowserTest,
|
| MAYBE_PhishingLearnMore) {
|
| SetupWarningAndNavigate(SB_THREAT_TYPE_URL_PHISHING);
|
| LOG(INFO) << "1";
|
|
|
| - if (GetParam() == 2)
|
| - EXPECT_TRUE(ClickAndWaitForDetach("learn-more-link"));
|
| - else
|
| - EXPECT_TRUE(ClickAndWaitForDetach("help-link"));
|
| + EXPECT_TRUE(ClickAndWaitForDetach("help-link"));
|
| LOG(INFO) << "2";
|
| AssertNoInterstitial(false); // Assert the interstitial is gone
|
|
|
|
|