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

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

Issue 1551503002: Convert Pass()→std::move() in //chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 12 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 <utility>
6
5 #include "base/base_switches.h" 7 #include "base/base_switches.h"
6 #include "base/bind.h" 8 #include "base/bind.h"
7 #include "base/bind_helpers.h" 9 #include "base/bind_helpers.h"
8 #include "base/callback.h" 10 #include "base/callback.h"
9 #include "base/command_line.h" 11 #include "base/command_line.h"
10 #include "base/location.h" 12 #include "base/location.h"
11 #include "base/macros.h" 13 #include "base/macros.h"
12 #include "base/metrics/field_trial.h" 14 #include "base/metrics/field_trial.h"
13 #include "base/prefs/pref_service.h" 15 #include "base/prefs/pref_service.h"
14 #include "base/single_thread_task_runner.h" 16 #include "base/single_thread_task_runner.h"
(...skipping 461 matching lines...) Expand 10 before | Expand all | Expand 10 after
476 AuthState::SHOWING_INTERSTITIAL); 478 AuthState::SHOWING_INTERSTITIAL);
477 479
478 scoped_ptr<SSLCertReporter> ssl_cert_reporter = 480 scoped_ptr<SSLCertReporter> ssl_cert_reporter =
479 certificate_reporting_test_utils::SetUpMockSSLCertReporter( 481 certificate_reporting_test_utils::SetUpMockSSLCertReporter(
480 &run_loop, expect_report); 482 &run_loop, expect_report);
481 483
482 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr); 484 ASSERT_TRUE(tab->GetInterstitialPage() != nullptr);
483 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>( 485 SSLBlockingPage* interstitial_page = static_cast<SSLBlockingPage*>(
484 tab->GetInterstitialPage()->GetDelegateForTesting()); 486 tab->GetInterstitialPage()->GetDelegateForTesting());
485 ASSERT_TRUE(interstitial_page != nullptr); 487 ASSERT_TRUE(interstitial_page != nullptr);
486 interstitial_page->SetSSLCertReporterForTesting(ssl_cert_reporter.Pass()); 488 interstitial_page->SetSSLCertReporterForTesting(
489 std::move(ssl_cert_reporter));
487 490
488 EXPECT_EQ(std::string(), GetLatestHostnameReported()); 491 EXPECT_EQ(std::string(), GetLatestHostnameReported());
489 492
490 // Leave the interstitial (either by proceeding or going back) 493 // Leave the interstitial (either by proceeding or going back)
491 if (proceed == SSL_INTERSTITIAL_PROCEED) { 494 if (proceed == SSL_INTERSTITIAL_PROCEED) {
492 ProceedThroughInterstitial(tab); 495 ProceedThroughInterstitial(tab);
493 } else { 496 } else {
494 // Click "Take me back" 497 // Click "Take me back"
495 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 498 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
496 ASSERT_TRUE(interstitial_page); 499 ASSERT_TRUE(interstitial_page);
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 540
538 scoped_ptr<SSLCertReporter> ssl_cert_reporter = 541 scoped_ptr<SSLCertReporter> ssl_cert_reporter =
539 certificate_reporting_test_utils::SetUpMockSSLCertReporter( 542 certificate_reporting_test_utils::SetUpMockSSLCertReporter(
540 &run_loop, expect_report); 543 &run_loop, expect_report);
541 544
542 InterstitialPage* interstitial_page = tab->GetInterstitialPage(); 545 InterstitialPage* interstitial_page = tab->GetInterstitialPage();
543 ASSERT_EQ(BadClockBlockingPage::kTypeForTesting, 546 ASSERT_EQ(BadClockBlockingPage::kTypeForTesting,
544 interstitial_page->GetDelegateForTesting()->GetTypeForTesting()); 547 interstitial_page->GetDelegateForTesting()->GetTypeForTesting());
545 BadClockBlockingPage* clock_page = static_cast<BadClockBlockingPage*>( 548 BadClockBlockingPage* clock_page = static_cast<BadClockBlockingPage*>(
546 tab->GetInterstitialPage()->GetDelegateForTesting()); 549 tab->GetInterstitialPage()->GetDelegateForTesting());
547 clock_page->SetSSLCertReporterForTesting(ssl_cert_reporter.Pass()); 550 clock_page->SetSSLCertReporterForTesting(std::move(ssl_cert_reporter));
548 551
549 EXPECT_EQ(std::string(), GetLatestHostnameReported()); 552 EXPECT_EQ(std::string(), GetLatestHostnameReported());
550 553
551 interstitial_page->DontProceed(); 554 interstitial_page->DontProceed();
552 555
553 if (expect_report == 556 if (expect_report ==
554 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) { 557 certificate_reporting_test_utils::CERT_REPORT_EXPECTED) {
555 // Check that the mock reporter received a request to send a report. 558 // Check that the mock reporter received a request to send a report.
556 run_loop.Run(); 559 run_loop.Run();
557 EXPECT_EQ(https_server_expired_.GetURL("/").host(), 560 EXPECT_EQ(https_server_expired_.GetURL("/").host(),
(...skipping 2368 matching lines...) Expand 10 before | Expand all | Expand 10 after
2926 2929
2927 // Visit a page over https that contains a frame with a redirect. 2930 // Visit a page over https that contains a frame with a redirect.
2928 2931
2929 // XMLHttpRequest insecure content in synchronous mode. 2932 // XMLHttpRequest insecure content in synchronous mode.
2930 2933
2931 // XMLHttpRequest insecure content in asynchronous mode. 2934 // XMLHttpRequest insecure content in asynchronous mode.
2932 2935
2933 // XMLHttpRequest over bad ssl in synchronous mode. 2936 // XMLHttpRequest over bad ssl in synchronous mode.
2934 2937
2935 // XMLHttpRequest over OK ssl in synchronous mode. 2938 // XMLHttpRequest over OK ssl in synchronous mode.
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698