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/chrome_security_state_model_client.h" | 5 #include "chrome/browser/ssl/chrome_security_state_model_client.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 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 INVALID_CERTIFICATE, browser()); | 985 INVALID_CERTIFICATE, browser()); |
986 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); | 986 EXPECT_TRUE(observer.latest_explanations().scheme_is_cryptographic); |
987 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); | 987 EXPECT_FALSE(observer.latest_explanations().pkp_bypassed); |
988 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); | 988 EXPECT_TRUE(observer.latest_explanations().info_explanations.empty()); |
989 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); | 989 EXPECT_FALSE(observer.latest_explanations().displayed_insecure_content); |
990 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); | 990 EXPECT_FALSE(observer.latest_explanations().ran_insecure_content); |
991 } | 991 } |
992 | 992 |
993 // Visit a valid HTTPS page, then a broken HTTPS page, and then go back, | 993 // Visit a valid HTTPS page, then a broken HTTPS page, and then go back, |
994 // and test that the observed security style matches. | 994 // and test that the observed security style matches. |
| 995 #if defined(OS_CHROMEOS) |
| 996 // Flaky on Chrome OS. See https://crbug.com/638576. |
| 997 #define MAYBE_SecurityStyleChangedObserverGoBack \ |
| 998 DISABLED_SecurityStyleChangedObserverGoBack |
| 999 #else |
| 1000 #define MAYBE_SecurityStyleChangedObserverGoBack \ |
| 1001 SecurityStyleChangedObserverGoBack |
| 1002 #endif |
995 IN_PROC_BROWSER_TEST_F(SecurityStyleChangedTest, | 1003 IN_PROC_BROWSER_TEST_F(SecurityStyleChangedTest, |
996 SecurityStyleChangedObserverGoBack) { | 1004 MAYBE_SecurityStyleChangedObserverGoBack) { |
997 ASSERT_TRUE(https_server_.Start()); | 1005 ASSERT_TRUE(https_server_.Start()); |
998 | 1006 |
999 net::EmbeddedTestServer https_test_server_expired( | 1007 net::EmbeddedTestServer https_test_server_expired( |
1000 net::EmbeddedTestServer::TYPE_HTTPS); | 1008 net::EmbeddedTestServer::TYPE_HTTPS); |
1001 https_test_server_expired.SetSSLConfig(net::EmbeddedTestServer::CERT_EXPIRED); | 1009 https_test_server_expired.SetSSLConfig(net::EmbeddedTestServer::CERT_EXPIRED); |
1002 https_test_server_expired.ServeFilesFromSourceDirectory( | 1010 https_test_server_expired.ServeFilesFromSourceDirectory( |
1003 base::FilePath(kDocRoot)); | 1011 base::FilePath(kDocRoot)); |
1004 ASSERT_TRUE(https_test_server_expired.Start()); | 1012 ASSERT_TRUE(https_test_server_expired.Start()); |
1005 | 1013 |
1006 content::WebContents* web_contents = | 1014 content::WebContents* web_contents = |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1338 ChromeSecurityStateModelClient* model_client = | 1346 ChromeSecurityStateModelClient* model_client = |
1339 ChromeSecurityStateModelClient::FromWebContents(web_contents); | 1347 ChromeSecurityStateModelClient::FromWebContents(web_contents); |
1340 ASSERT_TRUE(model_client); | 1348 ASSERT_TRUE(model_client); |
1341 const SecurityStateModel::SecurityInfo& security_info = | 1349 const SecurityStateModel::SecurityInfo& security_info = |
1342 model_client->GetSecurityInfo(); | 1350 model_client->GetSecurityInfo(); |
1343 EXPECT_EQ(SecurityStateModel::SECURE, security_info.security_level); | 1351 EXPECT_EQ(SecurityStateModel::SECURE, security_info.security_level); |
1344 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); | 1352 EXPECT_EQ(kTestSCTStatuses, security_info.sct_verify_statuses); |
1345 } | 1353 } |
1346 | 1354 |
1347 } // namespace | 1355 } // namespace |
OLD | NEW |