Chromium Code Reviews| 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..b084a30c3e763ee7e7fdbd5b61cc1a41b024f4c9 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,20 @@ 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*>( |
|
meacer
2015/05/15 20:41:18
Do you need the cast here? |CommandReceived| is an
felt
2015/05/15 20:44:43
I need to friend class this test because CommandRe
meacer
2015/05/15 20:53:41
I see. Then perhaps window.domAutomationController
felt
2015/05/15 21:11:44
That test is flaky: the JS call is async, so it ha
meacer
2015/05/15 21:26:57
Well, SafeBrowsingBlockingPageBrowserTest.Redirect
|
| + content::InterstitialPage::GetInterstitialPage( |
| + browser()->tab_strip_model()->GetActiveWebContents()) |
| + ->GetDelegateForTesting()); |
| + interstitial_delegate->CommandReceived( |
| + base::IntToString(SecurityInterstitialPage::CMD_PROCEED)); |
| + EXPECT_TRUE(interstitial); |
| + EXPECT_TRUE(browser() |
| + ->tab_strip_model() |
| + ->GetActiveWebContents() |
| + ->ShowingInterstitialPage()); |
| } |
| #if !defined(OS_CHROMEOS) |