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

Side by Side Diff: ios/web/net/request_tracker_impl_unittest.mm

Issue 2084153003: Remove the test-only X509Certificate constructor (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 4 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 | « extensions/extensions_unittests.isolate ('k') | net/cert/ct_policy_enforcer_unittest.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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ios/web/net/request_tracker_impl.h" 5 #include "ios/web/net/request_tracker_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/scoped_nsobject.h" 10 #include "base/mac/scoped_nsobject.h"
(...skipping 470 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 private: 481 private:
482 ~MockCertificatePolicyCache() override {} 482 ~MockCertificatePolicyCache() override {}
483 }; 483 };
484 484
485 void TwoStartsSSLCallback(bool* called, bool ok) { 485 void TwoStartsSSLCallback(bool* called, bool ok) {
486 *called = true; 486 *called = true;
487 } 487 }
488 488
489 // crbug/386180 489 // crbug/386180
490 TEST_F(RequestTrackerTest, DISABLED_TwoStartsNoEstimate) { 490 TEST_F(RequestTrackerTest, DISABLED_TwoStartsNoEstimate) {
491 net::X509Certificate* cert =
492 new net::X509Certificate("subject", "issuer", base::Time::Now(),
493 base::Time::Max());
494 net::SSLInfo ssl_info; 491 net::SSLInfo ssl_info;
495 ssl_info.cert = cert; 492 ssl_info.cert =
493 net::ImportCertFromFile(net::GetTestCertsDirectory(), "ok_cert.pem");
496 ssl_info.cert_status = net::CERT_STATUS_AUTHORITY_INVALID; 494 ssl_info.cert_status = net::CERT_STATUS_AUTHORITY_INVALID;
497 scoped_refptr<MockCertificatePolicyCache> cache; 495 scoped_refptr<MockCertificatePolicyCache> cache;
498 tracker_->SetCertificatePolicyCacheForTest(cache.get()); 496 tracker_->SetCertificatePolicyCacheForTest(cache.get());
499 TrimRequest(request_group_id_, GetSecureURL(0)); 497 TrimRequest(request_group_id_, GetSecureURL(0));
500 tracker_->StartRequest(GetSecureRequest(0)); 498 tracker_->StartRequest(GetSecureRequest(0));
501 tracker_->StartRequest(GetSecureRequest(1)); 499 tracker_->StartRequest(GetSecureRequest(1));
502 bool request_0_called = false; 500 bool request_0_called = false;
503 bool request_1_called = false; 501 bool request_1_called = false;
504 tracker_->OnSSLCertificateError(GetSecureRequest(0), ssl_info, true, 502 tracker_->OnSSLCertificateError(GetSecureRequest(0), ssl_info, true,
505 base::Bind(&TwoStartsSSLCallback, 503 base::Bind(&TwoStartsSSLCallback,
506 &request_0_called)); 504 &request_0_called));
507 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true, 505 tracker_->OnSSLCertificateError(GetSecureRequest(1), ssl_info, true,
508 base::Bind(&TwoStartsSSLCallback, 506 base::Bind(&TwoStartsSSLCallback,
509 &request_1_called)); 507 &request_1_called));
510 EXPECT_TRUE(request_0_called); 508 EXPECT_TRUE(request_0_called);
511 EXPECT_TRUE(request_1_called); 509 EXPECT_TRUE(request_1_called);
512 } 510 }
513 511
514 } // namespace 512 } // namespace
OLDNEW
« no previous file with comments | « extensions/extensions_unittests.isolate ('k') | net/cert/ct_policy_enforcer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698