| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #import "ios/web/net/crw_ssl_status_updater.h" | 5 #import "ios/web/net/crw_ssl_status_updater.h" |
| 6 | 6 |
| 7 #include "base/mac/scoped_block.h" | 7 #include "base/mac/scoped_block.h" |
| 8 #include "base/strings/sys_string_conversions.h" | 8 #include "base/strings/sys_string_conversions.h" |
| 9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" | 9 #import "ios/web/navigation/crw_session_controller+private_constructors.h" |
| 10 #import "ios/web/navigation/crw_session_controller.h" | 10 #import "ios/web/navigation/crw_session_controller.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 // Test fixture to test CRWSSLStatusUpdater class. | 73 // Test fixture to test CRWSSLStatusUpdater class. |
| 74 class CRWSSLStatusUpdaterTest : public web::WebTest { | 74 class CRWSSLStatusUpdaterTest : public web::WebTest { |
| 75 protected: | 75 protected: |
| 76 void SetUp() override { | 76 void SetUp() override { |
| 77 web::WebTest::SetUp(); | 77 web::WebTest::SetUp(); |
| 78 | 78 |
| 79 data_source_.reset([[CRWSSLStatusUpdaterTestDataSource alloc] init]); | 79 data_source_.reset([[CRWSSLStatusUpdaterTestDataSource alloc] init]); |
| 80 delegate_.reset([[OCMockObject | 80 delegate_.reset([[OCMockObject |
| 81 mockForProtocol:@protocol(CRWSSLStatusUpdaterDelegate)] retain]); | 81 mockForProtocol:@protocol(CRWSSLStatusUpdaterDelegate)] retain]); |
| 82 | 82 |
| 83 nav_manager_.reset(new NavigationManagerImpl()); | 83 nav_manager_.reset(new NavigationManagerImpl(nullptr, GetBrowserState())); |
| 84 nav_manager_->SetBrowserState(GetBrowserState()); | |
| 85 | 84 |
| 86 ssl_status_updater_.reset([[CRWSSLStatusUpdater alloc] | 85 ssl_status_updater_.reset([[CRWSSLStatusUpdater alloc] |
| 87 initWithDataSource:data_source_ | 86 initWithDataSource:data_source_ |
| 88 navigationManager:nav_manager_.get()]); | 87 navigationManager:nav_manager_.get()]); |
| 89 [ssl_status_updater_ setDelegate:delegate_]; | 88 [ssl_status_updater_ setDelegate:delegate_]; |
| 90 | 89 |
| 91 // Create test cert chain. | 90 // Create test cert chain. |
| 92 scoped_refptr<net::X509Certificate> cert = | 91 scoped_refptr<net::X509Certificate> cert = |
| 93 net::ImportCertFromFile(net::GetTestCertsDirectory(), kCertFileName); | 92 net::ImportCertFromFile(net::GetTestCertsDirectory(), kCertFileName); |
| 94 ASSERT_TRUE(cert); | 93 ASSERT_TRUE(cert); |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 [data_source_ | 356 [data_source_ |
| 358 finishVerificationWithCertStatus:0 | 357 finishVerificationWithCertStatus:0 |
| 359 securityStyle:web::SECURITY_STYLE_AUTHENTICATED]; | 358 securityStyle:web::SECURITY_STYLE_AUTHENTICATED]; |
| 360 | 359 |
| 361 // Make sure that security style and content status did change. | 360 // Make sure that security style and content status did change. |
| 362 EXPECT_EQ(web::SECURITY_STYLE_UNKNOWN, item->GetSSL().security_style); | 361 EXPECT_EQ(web::SECURITY_STYLE_UNKNOWN, item->GetSSL().security_style); |
| 363 EXPECT_EQ(web::SSLStatus::NORMAL_CONTENT, item->GetSSL().content_status); | 362 EXPECT_EQ(web::SSLStatus::NORMAL_CONTENT, item->GetSSL().content_status); |
| 364 } | 363 } |
| 365 | 364 |
| 366 } // namespace web | 365 } // namespace web |
| OLD | NEW |