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

Side by Side Diff: chrome/browser/ssl/ssl_browser_tests.cc

Issue 981243003: Make commands consistent across security interstitials (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: if -> switch in SafeBrowsingBlockingPage Created 5 years, 9 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 unified diff | Download patch
OLDNEW
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 #include "base/bind.h" 5 #include "base/bind.h"
6 #include "base/bind_helpers.h" 6 #include "base/bind_helpers.h"
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/prefs/pref_service.h" 8 #include "base/prefs/pref_service.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 1827 matching lines...) Expand 10 before | Expand all | Expand 10 after
1838 1838
1839 content::WindowedNotificationObserver observer( 1839 content::WindowedNotificationObserver observer(
1840 content::NOTIFICATION_LOAD_STOP, 1840 content::NOTIFICATION_LOAD_STOP,
1841 content::Source<NavigationController>(&tab->GetController())); 1841 content::Source<NavigationController>(&tab->GetController()));
1842 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 1842 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
1843 content::RenderViewHost* interstitial_rvh = 1843 content::RenderViewHost* interstitial_rvh =
1844 interstitial_page->GetMainFrame()->GetRenderViewHost(); 1844 interstitial_page->GetMainFrame()->GetRenderViewHost();
1845 int result = -1; 1845 int result = -1;
1846 std::string javascript = base::StringPrintf( 1846 std::string javascript = base::StringPrintf(
1847 "window.domAutomationController.send(%d);", 1847 "window.domAutomationController.send(%d);",
1848 SSLBlockingPage::CMD_PROCEED); 1848 SecurityInterstitialPage::CMD_PROCEED);
1849 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 1849 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
1850 interstitial_rvh, javascript, &result)); 1850 interstitial_rvh, javascript, &result));
1851 // The above will hang without the fix. 1851 // The above will hang without the fix.
1852 EXPECT_EQ(1, result); 1852 EXPECT_EQ(1, result);
1853 observer.Wait(); 1853 observer.Wait();
1854 CheckAuthenticationBrokenState( 1854 CheckAuthenticationBrokenState(
1855 tab, net::CERT_STATUS_DATE_INVALID, AuthState::NONE); 1855 tab, net::CERT_STATUS_DATE_INVALID, AuthState::NONE);
1856 } 1856 }
1857 1857
1858 // Verifies that the interstitial can go back, even if JavaScript is disabled. 1858 // Verifies that the interstitial can go back, even if JavaScript is disabled.
(...skipping 11 matching lines...) Expand all
1870 1870
1871 content::WindowedNotificationObserver observer( 1871 content::WindowedNotificationObserver observer(
1872 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1872 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1873 content::NotificationService::AllSources()); 1873 content::NotificationService::AllSources());
1874 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 1874 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
1875 content::RenderViewHost* interstitial_rvh = 1875 content::RenderViewHost* interstitial_rvh =
1876 interstitial_page->GetMainFrame()->GetRenderViewHost(); 1876 interstitial_page->GetMainFrame()->GetRenderViewHost();
1877 int result = -1; 1877 int result = -1;
1878 std::string javascript = base::StringPrintf( 1878 std::string javascript = base::StringPrintf(
1879 "window.domAutomationController.send(%d);", 1879 "window.domAutomationController.send(%d);",
1880 SSLBlockingPage::CMD_DONT_PROCEED); 1880 SecurityInterstitialPage::CMD_DONT_PROCEED);
1881 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 1881 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
1882 interstitial_rvh, javascript, &result)); 1882 interstitial_rvh, javascript, &result));
1883 // The above will hang without the fix. 1883 // The above will hang without the fix.
1884 EXPECT_EQ(0, result); 1884 EXPECT_EQ(0, result);
1885 observer.Wait(); 1885 observer.Wait();
1886 EXPECT_EQ("about:blank", tab->GetVisibleURL().spec()); 1886 EXPECT_EQ("about:blank", tab->GetVisibleURL().spec());
1887 } 1887 }
1888 1888
1889 // Verifies that switching tabs, while showing interstitial page, will not 1889 // Verifies that switching tabs, while showing interstitial page, will not
1890 // affect the visibility of the interestitial. 1890 // affect the visibility of the interestitial.
(...skipping 24 matching lines...) Expand all
1915 1915
1916 // Visit a page over https that contains a frame with a redirect. 1916 // Visit a page over https that contains a frame with a redirect.
1917 1917
1918 // XMLHttpRequest insecure content in synchronous mode. 1918 // XMLHttpRequest insecure content in synchronous mode.
1919 1919
1920 // XMLHttpRequest insecure content in asynchronous mode. 1920 // XMLHttpRequest insecure content in asynchronous mode.
1921 1921
1922 // XMLHttpRequest over bad ssl in synchronous mode. 1922 // XMLHttpRequest over bad ssl in synchronous mode.
1923 1923
1924 // XMLHttpRequest over OK ssl in synchronous mode. 1924 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« chrome/browser/ssl/ssl_blocking_page.cc ('K') | « chrome/browser/ssl/ssl_blocking_page.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698