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

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

Issue 789703004: Reflect the status of a request for accessing a blacklisted url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Tested on Android/Desktop Created 6 years 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 1787 matching lines...) Expand 10 before | Expand all | Expand 10 after
1798 ui_test_utils::NavigateToURL(browser(), 1798 ui_test_utils::NavigateToURL(browser(),
1799 https_server_expired_.GetURL("files/ssl/google.html")); 1799 https_server_expired_.GetURL("files/ssl/google.html"));
1800 CheckAuthenticationBrokenState( 1800 CheckAuthenticationBrokenState(
1801 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); 1801 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL);
1802 1802
1803 content::WindowedNotificationObserver observer( 1803 content::WindowedNotificationObserver observer(
1804 content::NOTIFICATION_LOAD_STOP, 1804 content::NOTIFICATION_LOAD_STOP,
1805 content::Source<NavigationController>(&tab->GetController())); 1805 content::Source<NavigationController>(&tab->GetController()));
1806 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 1806 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
1807 content::RenderViewHost* interstitial_rvh = 1807 content::RenderViewHost* interstitial_rvh =
1808 interstitial_page->GetRenderViewHostForTesting(); 1808 interstitial_page->GetRenderViewHost();
1809 int result = -1; 1809 int result = -1;
1810 std::string javascript = base::StringPrintf( 1810 std::string javascript = base::StringPrintf(
1811 "window.domAutomationController.send(%d);", 1811 "window.domAutomationController.send(%d);",
1812 SSLBlockingPage::CMD_PROCEED); 1812 SSLBlockingPage::CMD_PROCEED);
1813 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 1813 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
1814 interstitial_rvh, javascript, &result)); 1814 interstitial_rvh, javascript, &result));
1815 // The above will hang without the fix. 1815 // The above will hang without the fix.
1816 EXPECT_EQ(1, result); 1816 EXPECT_EQ(1, result);
1817 observer.Wait(); 1817 observer.Wait();
1818 CheckAuthenticationBrokenState( 1818 CheckAuthenticationBrokenState(
(...skipping 11 matching lines...) Expand all
1830 ui_test_utils::NavigateToURL(browser(), 1830 ui_test_utils::NavigateToURL(browser(),
1831 https_server_expired_.GetURL("files/ssl/google.html")); 1831 https_server_expired_.GetURL("files/ssl/google.html"));
1832 CheckAuthenticationBrokenState( 1832 CheckAuthenticationBrokenState(
1833 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL); 1833 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL);
1834 1834
1835 content::WindowedNotificationObserver observer( 1835 content::WindowedNotificationObserver observer(
1836 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED, 1836 content::NOTIFICATION_RENDER_WIDGET_HOST_DESTROYED,
1837 content::NotificationService::AllSources()); 1837 content::NotificationService::AllSources());
1838 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 1838 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
1839 content::RenderViewHost* interstitial_rvh = 1839 content::RenderViewHost* interstitial_rvh =
1840 interstitial_page->GetRenderViewHostForTesting(); 1840 interstitial_page->GetRenderViewHost();
1841 int result = -1; 1841 int result = -1;
1842 std::string javascript = base::StringPrintf( 1842 std::string javascript = base::StringPrintf(
1843 "window.domAutomationController.send(%d);", 1843 "window.domAutomationController.send(%d);",
1844 SSLBlockingPage::CMD_DONT_PROCEED); 1844 SSLBlockingPage::CMD_DONT_PROCEED);
1845 ASSERT_TRUE(content::ExecuteScriptAndExtractInt( 1845 ASSERT_TRUE(content::ExecuteScriptAndExtractInt(
1846 interstitial_rvh, javascript, &result)); 1846 interstitial_rvh, javascript, &result));
1847 // The above will hang without the fix. 1847 // The above will hang without the fix.
1848 EXPECT_EQ(0, result); 1848 EXPECT_EQ(0, result);
1849 observer.Wait(); 1849 observer.Wait();
1850 EXPECT_EQ("about:blank", tab->GetVisibleURL().spec()); 1850 EXPECT_EQ("about:blank", tab->GetVisibleURL().spec());
(...skipping 28 matching lines...) Expand all
1879 1879
1880 // Visit a page over https that contains a frame with a redirect. 1880 // Visit a page over https that contains a frame with a redirect.
1881 1881
1882 // XMLHttpRequest insecure content in synchronous mode. 1882 // XMLHttpRequest insecure content in synchronous mode.
1883 1883
1884 // XMLHttpRequest insecure content in asynchronous mode. 1884 // XMLHttpRequest insecure content in asynchronous mode.
1885 1885
1886 // XMLHttpRequest over bad ssl in synchronous mode. 1886 // XMLHttpRequest over bad ssl in synchronous mode.
1887 1887
1888 // XMLHttpRequest over OK ssl in synchronous mode. 1888 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698