Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Side by Side Diff: chrome/browser/browsing_data/browsing_data_channel_id_helper_unittest.cc

Issue 2095523002: Make //crypto factories return std::unique_ptr<>s (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: I'm blind Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browsing_data/browsing_data_channel_id_helper.h" 5 #include "chrome/browser/browsing_data/browsing_data_channel_id_helper.h"
6 6
7 #include <memory> 7 #include <memory>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/memory/ptr_util.h" 10 #include "base/memory/ptr_util.h"
(...skipping 26 matching lines...) Expand all
37 } 37 }
38 38
39 void CreateChannelIDsForTest() { 39 void CreateChannelIDsForTest() {
40 net::URLRequestContext* context = 40 net::URLRequestContext* context =
41 testing_profile_->GetRequestContext()->GetURLRequestContext(); 41 testing_profile_->GetRequestContext()->GetURLRequestContext();
42 net::ChannelIDStore* channel_id_store = 42 net::ChannelIDStore* channel_id_store =
43 context->channel_id_service()->GetChannelIDStore(); 43 context->channel_id_service()->GetChannelIDStore();
44 channel_id_store->SetChannelID( 44 channel_id_store->SetChannelID(
45 base::WrapUnique(new net::ChannelIDStore::ChannelID( 45 base::WrapUnique(new net::ChannelIDStore::ChannelID(
46 "https://www.google.com:443", base::Time(), 46 "https://www.google.com:443", base::Time(),
47 base::WrapUnique(crypto::ECPrivateKey::Create())))); 47 crypto::ECPrivateKey::Create())));
48 channel_id_store->SetChannelID( 48 channel_id_store->SetChannelID(
49 base::WrapUnique(new net::ChannelIDStore::ChannelID( 49 base::WrapUnique(new net::ChannelIDStore::ChannelID(
50 "https://www.youtube.com:443", base::Time(), 50 "https://www.youtube.com:443", base::Time(),
51 base::WrapUnique(crypto::ECPrivateKey::Create())))); 51 crypto::ECPrivateKey::Create())));
52 } 52 }
53 53
54 void FetchCallback( 54 void FetchCallback(
55 const net::ChannelIDStore::ChannelIDList& channel_ids) { 55 const net::ChannelIDStore::ChannelIDList& channel_ids) {
56 DCHECK_CURRENTLY_ON(BrowserThread::UI); 56 DCHECK_CURRENTLY_ON(BrowserThread::UI);
57 channel_id_list_ = channel_ids; 57 channel_id_list_ = channel_ids;
58 } 58 }
59 59
60 // net::SSLConfigService::Observer implementation: 60 // net::SSLConfigService::Observer implementation:
61 void OnSSLConfigChanged() override { ssl_config_changed_count_++; } 61 void OnSSLConfigChanged() override { ssl_config_changed_count_++; }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 } 135 }
136 136
137 TEST_F(BrowsingDataChannelIDHelperTest, CannedEmpty) { 137 TEST_F(BrowsingDataChannelIDHelperTest, CannedEmpty) {
138 std::string origin = "https://www.google.com"; 138 std::string origin = "https://www.google.com";
139 139
140 scoped_refptr<CannedBrowsingDataChannelIDHelper> helper( 140 scoped_refptr<CannedBrowsingDataChannelIDHelper> helper(
141 new CannedBrowsingDataChannelIDHelper()); 141 new CannedBrowsingDataChannelIDHelper());
142 142
143 ASSERT_TRUE(helper->empty()); 143 ASSERT_TRUE(helper->empty());
144 helper->AddChannelID(net::ChannelIDStore::ChannelID( 144 helper->AddChannelID(net::ChannelIDStore::ChannelID(
145 origin, base::Time(), base::WrapUnique(crypto::ECPrivateKey::Create()))); 145 origin, base::Time(), crypto::ECPrivateKey::Create()));
146 ASSERT_FALSE(helper->empty()); 146 ASSERT_FALSE(helper->empty());
147 helper->Reset(); 147 helper->Reset();
148 ASSERT_TRUE(helper->empty()); 148 ASSERT_TRUE(helper->empty());
149 } 149 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/browsing_data/browsing_data_remover_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698