OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/net/transport_security_persister.h" | 5 #include "chrome/browser/net/transport_security_persister.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/file_path.h" | 10 #include "base/file_path.h" |
11 #include "base/file_util.h" | 11 #include "base/file_util.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "base/scoped_temp_dir.h" | 13 #include "base/scoped_temp_dir.h" |
14 #include "content/test/test_browser_thread.h" | 14 #include "content/public/test/test_browser_thread.h" |
15 #include "content/public/browser/browser_thread.h" | |
16 #include "net/base/transport_security_state.h" | 15 #include "net/base/transport_security_state.h" |
17 #include "testing/gtest/include/gtest/gtest.h" | 16 #include "testing/gtest/include/gtest/gtest.h" |
18 | 17 |
19 using net::TransportSecurityState; | 18 using net::TransportSecurityState; |
20 | 19 |
21 class TransportSecurityPersisterTest : public testing::Test { | 20 class TransportSecurityPersisterTest : public testing::Test { |
22 public: | 21 public: |
23 TransportSecurityPersisterTest() | 22 TransportSecurityPersisterTest() |
24 : message_loop_(MessageLoop::TYPE_IO), | 23 : message_loop_(MessageLoop::TYPE_IO), |
25 test_file_thread_(content::BrowserThread::FILE, &message_loop_), | 24 test_file_thread_(content::BrowserThread::FILE, &message_loop_), |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 "\"mode\": \"pinning-only\"" | 222 "\"mode\": \"pinning-only\"" |
224 "}}"); | 223 "}}"); |
225 | 224 |
226 EXPECT_TRUE(persister_->DeserializeFromCommandLine(preload)); | 225 EXPECT_TRUE(persister_->DeserializeFromCommandLine(preload)); |
227 | 226 |
228 TransportSecurityState::DomainState domain_state; | 227 TransportSecurityState::DomainState domain_state; |
229 EXPECT_TRUE(state_.GetDomainState("docs.google.com", true, &domain_state)); | 228 EXPECT_TRUE(state_.GetDomainState("docs.google.com", true, &domain_state)); |
230 EXPECT_FALSE(domain_state.HasPins()); | 229 EXPECT_FALSE(domain_state.HasPins()); |
231 EXPECT_FALSE(domain_state.ShouldRedirectHTTPToHTTPS()); | 230 EXPECT_FALSE(domain_state.ShouldRedirectHTTPToHTTPS()); |
232 } | 231 } |
OLD | NEW |