OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/files/file_util.h" | 6 #include "base/files/file_util.h" |
7 #include "base/files/scoped_temp_dir.h" | 7 #include "base/files/scoped_temp_dir.h" |
8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
9 #include "base/memory/scoped_vector.h" | 9 #include "base/memory/scoped_vector.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 exploded_time.month = 12; | 66 exploded_time.month = 12; |
67 exploded_time.day_of_week = 0; // Unused. | 67 exploded_time.day_of_week = 0; // Unused. |
68 exploded_time.day_of_month = 13; | 68 exploded_time.day_of_month = 13; |
69 exploded_time.hour = 2; | 69 exploded_time.hour = 2; |
70 exploded_time.minute = 23; | 70 exploded_time.minute = 23; |
71 exploded_time.second = 45; | 71 exploded_time.second = 45; |
72 exploded_time.millisecond = 0; | 72 exploded_time.millisecond = 0; |
73 return base::Time::FromUTCExploded(exploded_time); | 73 return base::Time::FromUTCExploded(exploded_time); |
74 } | 74 } |
75 | 75 |
76 virtual void SetUp() { | 76 void SetUp() override { |
77 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); | 77 ASSERT_TRUE(temp_dir_.CreateUniqueTempDir()); |
78 store_ = new SQLiteChannelIDStore( | 78 store_ = new SQLiteChannelIDStore( |
79 temp_dir_.path().Append(kTestChannelIDFilename), | 79 temp_dir_.path().Append(kTestChannelIDFilename), |
80 base::MessageLoopProxy::current()); | 80 base::MessageLoopProxy::current()); |
81 ScopedVector<DefaultChannelIDStore::ChannelID> channel_ids; | 81 ScopedVector<DefaultChannelIDStore::ChannelID> channel_ids; |
82 Load(&channel_ids); | 82 Load(&channel_ids); |
83 ASSERT_EQ(0u, channel_ids.size()); | 83 ASSERT_EQ(0u, channel_ids.size()); |
84 // Make sure the store gets written at least once. | 84 // Make sure the store gets written at least once. |
85 store_->AddChannelID( | 85 store_->AddChannelID( |
86 DefaultChannelIDStore::ChannelID("google.com", | 86 DefaultChannelIDStore::ChannelID("google.com", |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
505 ASSERT_EQ(GetTestCertExpirationTime(), channel_ids[0]->expiration_time()); | 505 ASSERT_EQ(GetTestCertExpirationTime(), channel_ids[0]->expiration_time()); |
506 ASSERT_EQ(key_data, channel_ids[0]->private_key()); | 506 ASSERT_EQ(key_data, channel_ids[0]->private_key()); |
507 ASSERT_EQ(cert_data, channel_ids[0]->cert()); | 507 ASSERT_EQ(cert_data, channel_ids[0]->cert()); |
508 | 508 |
509 store_ = NULL; | 509 store_ = NULL; |
510 // Make sure we wait until the destructor has run. | 510 // Make sure we wait until the destructor has run. |
511 base::RunLoop().RunUntilIdle(); | 511 base::RunLoop().RunUntilIdle(); |
512 } | 512 } |
513 | 513 |
514 } // namespace net | 514 } // namespace net |
OLD | NEW |