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 "net/http/transport_security_persister.h" | 5 #include "net/http/transport_security_persister.h" |
6 | 6 |
7 #include <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 13 matching lines...) Expand all Loading... |
24 TransportSecurityPersisterTest() { | 24 TransportSecurityPersisterTest() { |
25 } | 25 } |
26 | 26 |
27 ~TransportSecurityPersisterTest() override { | 27 ~TransportSecurityPersisterTest() override { |
28 base::MessageLoopForIO::current()->RunUntilIdle(); | 28 base::MessageLoopForIO::current()->RunUntilIdle(); |
29 } | 29 } |
30 | 30 |
31 void SetUp() override { | 31 void SetUp() override { |
32 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 32 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
33 persister_.reset(new TransportSecurityPersister( | 33 persister_.reset(new TransportSecurityPersister( |
34 &state_, | 34 &state_, temp_dir_.path(), |
35 temp_dir_.path(), | 35 base::MessageLoopForIO::current()->task_runner(), false)); |
36 base::MessageLoopForIO::current()->message_loop_proxy(), | |
37 false)); | |
38 } | 36 } |
39 | 37 |
40 protected: | 38 protected: |
41 base::ScopedTempDir temp_dir_; | 39 base::ScopedTempDir temp_dir_; |
42 TransportSecurityState state_; | 40 TransportSecurityState state_; |
43 scoped_ptr<TransportSecurityPersister> persister_; | 41 scoped_ptr<TransportSecurityPersister> persister_; |
44 }; | 42 }; |
45 | 43 |
46 TEST_F(TransportSecurityPersisterTest, SerializeData1) { | 44 TEST_F(TransportSecurityPersisterTest, SerializeData1) { |
47 std::string output; | 45 std::string output; |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 EXPECT_EQ(sha1.tag, new_domain_state.pkp.spki_hashes[0].tag); | 200 EXPECT_EQ(sha1.tag, new_domain_state.pkp.spki_hashes[0].tag); |
203 EXPECT_EQ(0, | 201 EXPECT_EQ(0, |
204 memcmp(new_domain_state.pkp.spki_hashes[0].data(), | 202 memcmp(new_domain_state.pkp.spki_hashes[0].data(), |
205 sha1.data(), | 203 sha1.data(), |
206 sha1.size())); | 204 sha1.size())); |
207 } | 205 } |
208 | 206 |
209 } // namespace | 207 } // namespace |
210 | 208 |
211 } // namespace net | 209 } // namespace net |
OLD | NEW |