Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1823)

Unified Diff: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc

Issue 10694107: Revert 145523 - Add a policy to disable proceeding through the Safe Browsing interstitials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc
===================================================================
--- chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc (revision 145621)
+++ chrome/browser/safe_browsing/safe_browsing_blocking_page_test.cc (working copy)
@@ -8,8 +8,6 @@
// they work.
#include "base/bind.h"
-#include "base/utf_string_conversions.h"
-#include "base/values.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
@@ -26,7 +24,6 @@
#include "content/public/browser/interstitial_page.h"
#include "content/public/browser/navigation_controller.h"
#include "content/public/browser/notification_types.h"
-#include "content/public/browser/render_view_host.h"
#include "content/public/browser/web_contents.h"
#include "content/public/browser/web_contents_view.h"
#include "content/public/test/test_browser_thread.h"
@@ -372,27 +369,6 @@
SendCommand("\"proceed\"");
}
- bool GetProceedLinkIsHidden(bool* result) {
- InterstitialPage* interstitial = InterstitialPage::GetInterstitialPage(
- chrome::GetActiveWebContents(browser()));
- if (!interstitial)
- return false;
- content::RenderViewHost* rvh = interstitial->GetRenderViewHostForTesting();
- if (!rvh)
- return false;
- scoped_ptr<base::Value> value(rvh->ExecuteJavascriptAndGetValue(
- string16(),
- ASCIIToUTF16("var isHidden = false;\n"
- "var list = document.querySelectorAll("
- "'div[jsdisplay=\"!proceedDisabled\"]');"
- "if (list.length == 1)\n"
- " isHidden = list[0].style.display === 'none';\n"
- "isHidden;\n")));
- if (!value.get())
- return false;
- return value->GetAsBoolean(result);
- }
-
protected:
TestMalwareDetailsFactory details_factory_;
@@ -430,10 +406,6 @@
ui_test_utils::NavigateToURL(browser(), url);
- bool hidden = false;
- EXPECT_TRUE(GetProceedLinkIsHidden(&hidden));
- EXPECT_FALSE(hidden);
-
SendCommand("\"takeMeBack\""); // Simulate the user clicking "back"
AssertNoInterstitial(false); // Assert the interstitial is gone
EXPECT_EQ(
@@ -590,28 +562,3 @@
EXPECT_EQ(url, chrome::GetActiveWebContents(browser())->GetURL());
AssertReportSent();
}
-
-// 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_F(SafeBrowsingBlockingPageTest, ProceedDisabled) {
- // Simulate a policy disabling the "proceed anyway" link.
- browser()->profile()->GetPrefs()->SetBoolean(
- prefs::kSafeBrowsingProceedAnywayDisabled, true);
-
- GURL url = test_server()->GetURL(kEmptyPage);
- AddURLResult(url, SafeBrowsingService::URL_MALWARE);
- ui_test_utils::NavigateToURL(browser(), url);
-
- // The "proceed anyway" link should be hidden.
- bool hidden = false;
- EXPECT_TRUE(GetProceedLinkIsHidden(&hidden));
- EXPECT_TRUE(hidden);
-
- // The "proceed" command should go back instead, if proceeding is disabled.
- SendCommand("\"proceed\"");
- AssertNoInterstitial(true);
- EXPECT_EQ(
- GURL(chrome::kAboutBlankURL), // Back to "about:blank"
- chrome::GetActiveWebContents(browser())->GetURL());
-}
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_blocking_page.cc ('k') | chrome/common/pref_names.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698