Chromium Code Reviews| Index: components/security_state/security_state_model_unittest.cc |
| diff --git a/chrome/browser/ssl/security_state_model_unittest.cc b/components/security_state/security_state_model_unittest.cc |
| similarity index 87% |
| rename from chrome/browser/ssl/security_state_model_unittest.cc |
| rename to components/security_state/security_state_model_unittest.cc |
| index 788106c4cad791236ace5558a8ae383d53ff10b0..f9e8b962eeb08e2f31f8cfeef2928ee14e5fbb25 100644 |
| --- a/chrome/browser/ssl/security_state_model_unittest.cc |
| +++ b/components/security_state/security_state_model_unittest.cc |
| @@ -2,17 +2,11 @@ |
| // Use of this source code is governed by a BSD-style license that can be |
| // found in the LICENSE file. |
| -#include "chrome/browser/ssl/security_state_model.h" |
| +#include "components/security_state/security_state_model.h" |
| #include <stdint.h> |
| -#include "chrome/browser/ssl/security_state_model_client.h" |
| -#include "chrome/test/base/chrome_render_view_host_test_harness.h" |
| -#include "chrome/test/base/testing_profile.h" |
| -#include "content/public/browser/cert_store.h" |
| -#include "content/public/common/origin_util.h" |
| -#include "content/public/test/mock_render_process_host.h" |
| -#include "content/public/test/test_browser_thread_bundle.h" |
| +#include "components/security_state/security_state_model_client.h" |
| #include "net/base/test_data_directory.h" |
| #include "net/cert/x509_certificate.h" |
| #include "net/ssl/ssl_connection_status_flags.h" |
| @@ -20,6 +14,8 @@ |
| #include "net/test/test_certificate_data.h" |
| #include "testing/gtest/include/gtest/gtest.h" |
| +namespace security_state { |
| + |
| namespace { |
| const char kUrl[] = "https://foo.test"; |
| @@ -79,9 +75,7 @@ class TestSecurityStateModelClient : public SecurityStateModelClient { |
| bool UsedPolicyInstalledCertificate() override { return false; } |
| - bool IsOriginSecure(const GURL& url) override { |
| - return content::IsOriginSecure(url); |
| - } |
| + bool IsOriginSecure(const GURL& url) override { return true; } |
|
eroman
2016/01/11 18:12:12
Without knowing more about this test, why is this
estark
2016/01/11 18:15:52
The former (all tests are using secure origins). I
|
| private: |
| SecurityStateModel::SecurityLevel initial_security_level_; |
| @@ -92,11 +86,9 @@ class TestSecurityStateModelClient : public SecurityStateModelClient { |
| bool ran_mixed_content_; |
| }; |
| -class SecurityStateModelTest : public ChromeRenderViewHostTestHarness {}; |
| - |
| // Tests that SHA1-signed certificates expiring in 2016 downgrade the |
| // security state of the page. |
| -TEST_F(SecurityStateModelTest, SHA1Warning) { |
| +TEST(SecurityStateModelTest, SHA1Warning) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -109,7 +101,7 @@ TEST_F(SecurityStateModelTest, SHA1Warning) { |
| // Tests that SHA1 warnings don't interfere with the handling of mixed |
| // content. |
| -TEST_F(SecurityStateModelTest, SHA1WarningMixedContent) { |
| +TEST(SecurityStateModelTest, SHA1WarningMixedContent) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -136,7 +128,7 @@ TEST_F(SecurityStateModelTest, SHA1WarningMixedContent) { |
| // Tests that SHA1 warnings don't interfere with the handling of major |
| // cert errors. |
| -TEST_F(SecurityStateModelTest, SHA1WarningBrokenHTTPS) { |
| +TEST(SecurityStateModelTest, SHA1WarningBrokenHTTPS) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -151,7 +143,7 @@ TEST_F(SecurityStateModelTest, SHA1WarningBrokenHTTPS) { |
| // Tests that |security_info.is_secure_protocol_and_ciphersuite| is |
| // computed correctly. |
| -TEST_F(SecurityStateModelTest, SecureProtocolAndCiphersuite) { |
| +TEST(SecurityStateModelTest, SecureProtocolAndCiphersuite) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -166,7 +158,7 @@ TEST_F(SecurityStateModelTest, SecureProtocolAndCiphersuite) { |
| EXPECT_TRUE(security_info.is_secure_protocol_and_ciphersuite); |
| } |
| -TEST_F(SecurityStateModelTest, NonsecureProtocol) { |
| +TEST(SecurityStateModelTest, NonsecureProtocol) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -181,7 +173,7 @@ TEST_F(SecurityStateModelTest, NonsecureProtocol) { |
| EXPECT_FALSE(security_info.is_secure_protocol_and_ciphersuite); |
| } |
| -TEST_F(SecurityStateModelTest, NonsecureCiphersuite) { |
| +TEST(SecurityStateModelTest, NonsecureCiphersuite) { |
| TestSecurityStateModelClient client; |
| SecurityStateModel model; |
| model.SetClient(&client); |
| @@ -197,3 +189,5 @@ TEST_F(SecurityStateModelTest, NonsecureCiphersuite) { |
| } |
| } // namespace |
| + |
| +} // namespace security_state |