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

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

Issue 321253003: Ensure show/hide are properly called on interstitial pages if present. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test compilation, add test case for the bug. Created 6 years, 6 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
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/command_line.h" 5 #include "base/command_line.h"
6 #include "base/path_service.h" 6 #include "base/path_service.h"
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 12 matching lines...) Expand all
23 #include "chrome/common/pref_names.h" 23 #include "chrome/common/pref_names.h"
24 #include "chrome/test/base/in_process_browser_test.h" 24 #include "chrome/test/base/in_process_browser_test.h"
25 #include "chrome/test/base/ui_test_utils.h" 25 #include "chrome/test/base/ui_test_utils.h"
26 #include "components/web_modal/web_contents_modal_dialog_manager.h" 26 #include "components/web_modal/web_contents_modal_dialog_manager.h"
27 #include "content/public/browser/browser_context.h" 27 #include "content/public/browser/browser_context.h"
28 #include "content/public/browser/interstitial_page.h" 28 #include "content/public/browser/interstitial_page.h"
29 #include "content/public/browser/navigation_controller.h" 29 #include "content/public/browser/navigation_controller.h"
30 #include "content/public/browser/navigation_entry.h" 30 #include "content/public/browser/navigation_entry.h"
31 #include "content/public/browser/notification_service.h" 31 #include "content/public/browser/notification_service.h"
32 #include "content/public/browser/render_view_host.h" 32 #include "content/public/browser/render_view_host.h"
33 #include "content/public/browser/render_widget_host_view.h"
33 #include "content/public/browser/web_contents.h" 34 #include "content/public/browser/web_contents.h"
34 #include "content/public/browser/web_contents_observer.h" 35 #include "content/public/browser/web_contents_observer.h"
35 #include "content/public/common/security_style.h" 36 #include "content/public/common/security_style.h"
36 #include "content/public/common/ssl_status.h" 37 #include "content/public/common/ssl_status.h"
37 #include "content/public/test/browser_test_utils.h" 38 #include "content/public/test/browser_test_utils.h"
38 #include "content/public/test/download_test_observer.h" 39 #include "content/public/test/download_test_observer.h"
39 #include "content/public/test/test_renderer_host.h" 40 #include "content/public/test/test_renderer_host.h"
40 #include "crypto/nss_util.h" 41 #include "crypto/nss_util.h"
41 #include "net/base/crypto_module.h" 42 #include "net/base/crypto_module.h"
42 #include "net/base/net_errors.h" 43 #include "net/base/net_errors.h"
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
1743 interstitial_page->GetRenderViewHostForTesting(); 1744 interstitial_page->GetRenderViewHostForTesting();
1744 bool result = false; 1745 bool result = false;
1745 ASSERT_TRUE(content::ExecuteScriptAndExtractBool( 1746 ASSERT_TRUE(content::ExecuteScriptAndExtractBool(
1746 interstitial_rvh, 1747 interstitial_rvh,
1747 "window.domAutomationController.send(true);", 1748 "window.domAutomationController.send(true);",
1748 &result)); 1749 &result));
1749 // The above will hang without the fix. 1750 // The above will hang without the fix.
1750 ASSERT_TRUE(result); 1751 ASSERT_TRUE(result);
1751 } 1752 }
1752 1753
1754 // Verifies that switching tabs, while showing interstitial page, will not
1755 // affect the visibility of the interestitial.
1756 // https://crbug.com/381439
1757 IN_PROC_BROWSER_TEST_F(SSLUITest, InterstitialNotAffectedByHideShow) {
1758 ASSERT_TRUE(https_server_expired_.Start());
1759 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
1760 EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
1761 ui_test_utils::NavigateToURL(
1762 browser(), https_server_expired_.GetURL("files/ssl/google.html"));
1763 CheckAuthenticationBrokenState(
1764 tab, net::CERT_STATUS_DATE_INVALID, AuthState::SHOWING_INTERSTITIAL);
1765 EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
1766
1767 AddTabAtIndex(0,
1768 https_server_.GetURL("files/ssl/google.html"),
1769 content::PAGE_TRANSITION_TYPED);
1770 EXPECT_EQ(2, browser()->tab_strip_model()->count());
1771 EXPECT_EQ(0, browser()->tab_strip_model()->active_index());
1772 EXPECT_EQ(tab, browser()->tab_strip_model()->GetWebContentsAt(1));
1773 EXPECT_FALSE(tab->GetRenderWidgetHostView()->IsShowing());
1774
1775 browser()->tab_strip_model()->ActivateTabAt(1, true);
1776 EXPECT_TRUE(tab->GetRenderWidgetHostView()->IsShowing());
1777 }
1778
1753 // TODO(jcampan): more tests to do below. 1779 // TODO(jcampan): more tests to do below.
1754 1780
1755 // Visit a page over https that contains a frame with a redirect. 1781 // Visit a page over https that contains a frame with a redirect.
1756 1782
1757 // XMLHttpRequest insecure content in synchronous mode. 1783 // XMLHttpRequest insecure content in synchronous mode.
1758 1784
1759 // XMLHttpRequest insecure content in asynchronous mode. 1785 // XMLHttpRequest insecure content in asynchronous mode.
1760 1786
1761 // XMLHttpRequest over bad ssl in synchronous mode. 1787 // XMLHttpRequest over bad ssl in synchronous mode.
1762 1788
1763 // XMLHttpRequest over OK ssl in synchronous mode. 1789 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW
« no previous file with comments | « no previous file | content/browser/site_per_process_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698