OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "chrome/browser/ssl/security_state_tab_helper.h" | 5 #include "chrome/browser/ssl/security_state_tab_helper.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/files/file_path.h" | 8 #include "base/files/file_path.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
274 class SecurityStateTabHelperTest : public CertVerifierBrowserTest { | 274 class SecurityStateTabHelperTest : public CertVerifierBrowserTest { |
275 public: | 275 public: |
276 SecurityStateTabHelperTest() | 276 SecurityStateTabHelperTest() |
277 : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { | 277 : https_server_(net::EmbeddedTestServer::TYPE_HTTPS) { |
278 https_server_.ServeFilesFromSourceDirectory(base::FilePath(kDocRoot)); | 278 https_server_.ServeFilesFromSourceDirectory(base::FilePath(kDocRoot)); |
279 } | 279 } |
280 | 280 |
281 void SetUpCommandLine(base::CommandLine* command_line) override { | 281 void SetUpCommandLine(base::CommandLine* command_line) override { |
282 // Browser will both run and display insecure content. | 282 // Browser will both run and display insecure content. |
283 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); | 283 command_line->AppendSwitch(switches::kAllowRunningInsecureContent); |
| 284 command_line->AppendSwitchASCII( |
| 285 security_state::switches::kMarkHttpAs, |
| 286 security_state::switches::kMarkHttpAsNeutral); |
284 } | 287 } |
285 | 288 |
286 protected: | 289 protected: |
287 void SetUpMockCertVerifierForHttpsServer(net::CertStatus cert_status, | 290 void SetUpMockCertVerifierForHttpsServer(net::CertStatus cert_status, |
288 int net_result) { | 291 int net_result) { |
289 scoped_refptr<net::X509Certificate> cert(https_server_.GetCertificate()); | 292 scoped_refptr<net::X509Certificate> cert(https_server_.GetCertificate()); |
290 net::CertVerifyResult verify_result; | 293 net::CertVerifyResult verify_result; |
291 verify_result.is_issued_by_known_root = true; | 294 verify_result.is_issued_by_known_root = true; |
292 verify_result.verified_cert = cert; | 295 verify_result.verified_cert = cert; |
293 verify_result.cert_status = cert_status; | 296 verify_result.cert_status = cert_status; |
(...skipping 1716 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2010 SecurityStateTabHelper* helper = | 2013 SecurityStateTabHelper* helper = |
2011 SecurityStateTabHelper::FromWebContents(web_contents); | 2014 SecurityStateTabHelper::FromWebContents(web_contents); |
2012 ASSERT_TRUE(helper); | 2015 ASSERT_TRUE(helper); |
2013 security_state::SecurityInfo security_info; | 2016 security_state::SecurityInfo security_info; |
2014 helper->GetSecurityInfo(&security_info); | 2017 helper->GetSecurityInfo(&security_info); |
2015 EXPECT_EQ(security_state::SECURE, security_info.security_level); | 2018 EXPECT_EQ(security_state::SECURE, security_info.security_level); |
2016 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); | 2019 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); |
2017 } | 2020 } |
2018 | 2021 |
2019 } // namespace | 2022 } // namespace |
OLD | NEW |