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

Unified Diff: chrome/browser/policy/policy_browsertest.cc

Issue 1119963004: Extend the enterprise policy for SSL overrides to the "danger" command (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check type after cast Created 5 years, 7 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 | « no previous file | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/policy/policy_browsertest.cc
diff --git a/chrome/browser/policy/policy_browsertest.cc b/chrome/browser/policy/policy_browsertest.cc
index 629b966b3053f9037e6019c9d53784e4c224c553..8db03ba2e7a4766b1b033a1a37dff16cb483d180 100644
--- a/chrome/browser/policy/policy_browsertest.cc
+++ b/chrome/browser/policy/policy_browsertest.cc
@@ -19,6 +19,7 @@
#include "base/prefs/pref_service.h"
#include "base/run_loop.h"
#include "base/strings/string16.h"
+#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/stringprintf.h"
#include "base/strings/utf_string_conversions.h"
@@ -62,6 +63,7 @@
#include "chrome/browser/search/instant_service_factory.h"
#include "chrome/browser/search/search.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
+#include "chrome/browser/ssl/ssl_blocking_page.h"
#include "chrome/browser/translate/chrome_translate_client.h"
#include "chrome/browser/translate/cld_data_harness.h"
#include "chrome/browser/translate/cld_data_harness_factory.h"
@@ -3652,7 +3654,8 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, SSLErrorOverridingAllowed) {
}
// Test that when SSL error overriding is disallowed by policy, the
-// proceed link does not appear on SSL blocking pages.
+// proceed link does not appear on SSL blocking pages and users should not
+// be able to proceed.
IN_PROC_BROWSER_TEST_F(PolicyTest, SSLErrorOverridingDisallowed) {
net::SpawnedTestServer https_server_expired(
net::SpawnedTestServer::TYPE_HTTPS,
@@ -3685,6 +3688,22 @@ IN_PROC_BROWSER_TEST_F(PolicyTest, SSLErrorOverridingDisallowed) {
// The interstitial should not display the proceed link.
EXPECT_FALSE(chrome_browser_interstitials::IsInterstitialDisplayingText(
interstitial, "proceed-link"));
+
+ // The interstitial should not proceed, even if the command is sent in
+ // some other way (e.g., via the keyboard shortcut).
+ SSLBlockingPage* interstitial_delegate = static_cast<SSLBlockingPage*>(
+ content::InterstitialPage::GetInterstitialPage(
+ browser()->tab_strip_model()->GetActiveWebContents())
+ ->GetDelegateForTesting());
+ ASSERT_EQ(SSLBlockingPage::kTypeForTesting,
+ interstitial_delegate->GetTypeForTesting());
meacer 2015/05/15 21:26:57 nit: I think it's better to do this before doing t
felt 2015/05/15 21:48:34 Ah I now realize what you meant. Done.
+ interstitial_delegate->CommandReceived(
+ base::IntToString(SecurityInterstitialPage::CMD_PROCEED));
+ EXPECT_TRUE(interstitial);
+ EXPECT_TRUE(browser()
+ ->tab_strip_model()
+ ->GetActiveWebContents()
+ ->ShowingInterstitialPage());
}
#if !defined(OS_CHROMEOS)
« no previous file with comments | « no previous file | chrome/browser/ssl/ssl_blocking_page.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698