diff options
Diffstat (limited to 'chrome/browser/ssl/ssl_uitest.cc')
-rw-r--r-- | chrome/browser/ssl/ssl_uitest.cc | 66 |
1 files changed, 0 insertions, 66 deletions
diff --git a/chrome/browser/ssl/ssl_uitest.cc b/chrome/browser/ssl/ssl_uitest.cc index 00bd8bd..a29d1c7 100644 --- a/chrome/browser/ssl/ssl_uitest.cc +++ b/chrome/browser/ssl/ssl_uitest.cc @@ -271,72 +271,6 @@ TEST_F(SSLUITest, TestMixedContents) { EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); } -// Visits a page with mixed content. -TEST_F(SSLUITest, TestMixedContentsFilterAll) { - scoped_refptr<HTTPSTestServer> https_server = GoodCertServer(); - scoped_refptr<HTTPTestServer> http_server = PlainServer(); - if (HasFailure()) - return; - - // Now select the block mixed-content pref and reload the page. - scoped_refptr<BrowserProxy> browser_proxy(automation()->GetBrowserWindow(0)); - EXPECT_TRUE(browser_proxy.get()); - EXPECT_TRUE(browser_proxy->SetIntPreference(prefs::kMixedContentFiltering, - FilterPolicy::FILTER_ALL)); - - // Load a page with mixed-content, we've overridden our filtering policy so - // we won't load the mixed content by default. - scoped_refptr<TabProxy> tab(GetActiveTabProxy()); - NavigateTab( - tab.get(), - https_server->TestServerPageW( - L"files/ssl/page_with_mixed_contents.html")); - NavigationEntry::PageType page_type; - EXPECT_TRUE(tab->GetPageType(&page_type)); - EXPECT_EQ(NavigationEntry::NORMAL_PAGE, page_type); - - // The image should be filtered. - int img_width; - EXPECT_TRUE(tab->ExecuteAndExtractInt(L"", - L"window.domAutomationController.send(ImageWidth());", - &img_width)); - // In order to check that the image was not loaded, we check its width. - // The actual image (Google logo) is 114 pixels wide, we assume the broken - // image is less than 100. - EXPECT_GT(100, img_width); - - SecurityStyle security_style; - int cert_status; - int mixed_content_state; - // The state should be OK since we are not showing the resource. - EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, - &mixed_content_state)); - EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, security_style); - EXPECT_EQ(0, cert_status & net::CERT_STATUS_ALL_ERRORS); - EXPECT_EQ(NavigationEntry::SSLStatus::NORMAL_CONTENT, mixed_content_state); - - // There should be one info-bar to show the mixed-content. - int info_bar_count = 0; - EXPECT_TRUE(tab->GetSSLInfoBarCount(&info_bar_count)); - EXPECT_EQ(1, info_bar_count); - - // Activate the link on the info-bar to show the mixed-content. - EXPECT_TRUE(tab->ClickSSLInfoBarLink(0, true)); - - // The image should show now. - EXPECT_TRUE(tab->ExecuteAndExtractInt(L"", - L"window.domAutomationController.send(ImageWidth());", - &img_width)); - EXPECT_LT(100, img_width); - - // And our status should be mixed-content. - EXPECT_TRUE(tab->GetSecurityState(&security_style, &cert_status, - &mixed_content_state)); - EXPECT_EQ(SECURITY_STYLE_AUTHENTICATED, security_style); - EXPECT_EQ(0, cert_status & net::CERT_STATUS_ALL_ERRORS); - EXPECT_EQ(NavigationEntry::SSLStatus::MIXED_CONTENT, mixed_content_state); -} - // Visits a page with an http script that tries to suppress our mixed content // warnings by randomize location.hash. // Based on http://crbug.com/8706 |