| 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 "chrome/browser/net/quota_policy_channel_id_store.h" | 5 #include "chrome/browser/net/quota_policy_channel_id_store.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 base::ThreadTaskRunnerHandle::Get(), | 61 base::ThreadTaskRunnerHandle::Get(), |
| 62 NULL); | 62 NULL); |
| 63 std::vector<std::unique_ptr<net::DefaultChannelIDStore::ChannelID>> | 63 std::vector<std::unique_ptr<net::DefaultChannelIDStore::ChannelID>> |
| 64 channel_ids; | 64 channel_ids; |
| 65 Load(&channel_ids); | 65 Load(&channel_ids); |
| 66 ASSERT_EQ(0u, channel_ids.size()); | 66 ASSERT_EQ(0u, channel_ids.size()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 void TearDown() override { | 69 void TearDown() override { |
| 70 store_ = NULL; | 70 store_ = NULL; |
| 71 loop_.RunUntilIdle(); | 71 base::RunLoop().RunUntilIdle(); |
| 72 } | 72 } |
| 73 | 73 |
| 74 base::ScopedTempDir temp_dir_; | 74 base::ScopedTempDir temp_dir_; |
| 75 scoped_refptr<QuotaPolicyChannelIDStore> store_; | 75 scoped_refptr<QuotaPolicyChannelIDStore> store_; |
| 76 std::vector<std::unique_ptr<net::DefaultChannelIDStore::ChannelID>> | 76 std::vector<std::unique_ptr<net::DefaultChannelIDStore::ChannelID>> |
| 77 channel_ids_; | 77 channel_ids_; |
| 78 base::MessageLoop loop_; | 78 base::MessageLoop loop_; |
| 79 }; | 79 }; |
| 80 | 80 |
| 81 // Test if data is stored as expected in the QuotaPolicy database. | 81 // Test if data is stored as expected in the QuotaPolicy database. |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 base::ThreadTaskRunnerHandle::Get(), | 192 base::ThreadTaskRunnerHandle::Get(), |
| 193 NULL); | 193 NULL); |
| 194 | 194 |
| 195 // Reload and check that the nonpersistent.com channel IDs have been removed. | 195 // Reload and check that the nonpersistent.com channel IDs have been removed. |
| 196 Load(&channel_ids); | 196 Load(&channel_ids); |
| 197 ASSERT_EQ(2U, channel_ids.size()); | 197 ASSERT_EQ(2U, channel_ids.size()); |
| 198 for (const auto& id : channel_ids) { | 198 for (const auto& id : channel_ids) { |
| 199 ASSERT_NE("nonpersistent.com", id->server_identifier()); | 199 ASSERT_NE("nonpersistent.com", id->server_identifier()); |
| 200 } | 200 } |
| 201 } | 201 } |
| OLD | NEW |