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

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

Issue 1332633002: Add constructor to create SSLStatus from SSLInfo (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: meacer comments Created 5 years, 3 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/callback.h" 7 #include "base/callback.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/location.h" 9 #include "base/location.h"
10 #include "base/metrics/field_trial.h" 10 #include "base/metrics/field_trial.h"
(...skipping 2336 matching lines...) Expand 10 before | Expand all | Expand 10 after
2347 2347
2348 ProceedThroughInterstitial(tab); 2348 ProceedThroughInterstitial(tab);
2349 EXPECT_TRUE(state->HasAllowException(https_server_host)); 2349 EXPECT_TRUE(state->HasAllowException(https_server_host));
2350 2350
2351 ui_test_utils::NavigateToURL(browser(), 2351 ui_test_utils::NavigateToURL(browser(),
2352 https_server_.GetURL("files/ssl/google.html")); 2352 https_server_.GetURL("files/ssl/google.html"));
2353 ASSERT_FALSE(tab->GetInterstitialPage()); 2353 ASSERT_FALSE(tab->GetInterstitialPage());
2354 EXPECT_FALSE(state->HasAllowException(https_server_host)); 2354 EXPECT_FALSE(state->HasAllowException(https_server_host));
2355 } 2355 }
2356 2356
2357 // Tests that the SSLStatus of a navigation entry for an interstitial
2358 // matches the navigation entry once the interstitial is clicked
2359 // through. https://crbug.com/529456
2360 IN_PROC_BROWSER_TEST_F(SSLUITest,
2361 SSLStatusMatchesOnInterstitialAndAfterProceed) {
2362 ASSERT_TRUE(https_server_expired_.Start());
2363 WebContents* tab = browser()->tab_strip_model()->GetActiveWebContents();
2364 ASSERT_TRUE(tab);
2365
2366 ui_test_utils::NavigateToURL(
2367 browser(), https_server_expired_.GetURL("files/ssl/google.html"));
2368 content::WaitForInterstitialAttach(tab);
2369 EXPECT_TRUE(tab->ShowingInterstitialPage());
2370
2371 content::NavigationEntry* entry = tab->GetController().GetActiveEntry();
2372 ASSERT_TRUE(entry);
2373 content::SSLStatus interstitial_ssl_status = entry->GetSSL();
2374
2375 ProceedThroughInterstitial(tab);
2376 EXPECT_FALSE(tab->ShowingInterstitialPage());
2377 entry = tab->GetController().GetActiveEntry();
2378 ASSERT_TRUE(entry);
2379
2380 content::SSLStatus after_interstitial_ssl_status = entry->GetSSL();
2381 EXPECT_TRUE(interstitial_ssl_status.Equals(after_interstitial_ssl_status));
2382 }
2383
2357 class CommonNameMismatchBrowserTest : public CertVerifierBrowserTest { 2384 class CommonNameMismatchBrowserTest : public CertVerifierBrowserTest {
2358 public: 2385 public:
2359 CommonNameMismatchBrowserTest() : CertVerifierBrowserTest() {} 2386 CommonNameMismatchBrowserTest() : CertVerifierBrowserTest() {}
2360 ~CommonNameMismatchBrowserTest() override {} 2387 ~CommonNameMismatchBrowserTest() override {}
2361 2388
2362 void SetUpCommandLine(base::CommandLine* command_line) override { 2389 void SetUpCommandLine(base::CommandLine* command_line) override {
2363 // Enable finch experiment for SSL common name mismatch handling. 2390 // Enable finch experiment for SSL common name mismatch handling.
2364 command_line->AppendSwitchASCII(switches::kForceFieldTrials, 2391 command_line->AppendSwitchASCII(switches::kForceFieldTrials,
2365 "SSLCommonNameMismatchHandling/Enabled/"); 2392 "SSLCommonNameMismatchHandling/Enabled/");
2366 } 2393 }
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after
2734 2761
2735 // Visit a page over https that contains a frame with a redirect. 2762 // Visit a page over https that contains a frame with a redirect.
2736 2763
2737 // XMLHttpRequest insecure content in synchronous mode. 2764 // XMLHttpRequest insecure content in synchronous mode.
2738 2765
2739 // XMLHttpRequest insecure content in asynchronous mode. 2766 // XMLHttpRequest insecure content in asynchronous mode.
2740 2767
2741 // XMLHttpRequest over bad ssl in synchronous mode. 2768 // XMLHttpRequest over bad ssl in synchronous mode.
2742 2769
2743 // XMLHttpRequest over OK ssl in synchronous mode. 2770 // 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