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

Side by Side Diff: components/safe_browsing_db/database_manager_unittest.cc

Issue 2353413002: Store list information in ListInfo (was: StoreIdAndFIleName) (Closed)
Patch Set: sort the members of ListInfo by member name Created 4 years, 3 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 | « components/safe_browsing_db/BUILD.gn ('k') | components/safe_browsing_db/util.h » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/safe_browsing_db/database_manager.h" 5 #include "components/safe_browsing_db/database_manager.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 db_manager_->StopOnIOThread(false); 71 db_manager_->StopOnIOThread(false);
72 } 72 }
73 73
74 std::string GetStockV4GetHashResponse() { 74 std::string GetStockV4GetHashResponse() {
75 ListIdentifier list_id = GetChromeUrlApiId(); 75 ListIdentifier list_id = GetChromeUrlApiId();
76 FullHash full_hash = crypto::SHA256HashString("example.com/more"); 76 FullHash full_hash = crypto::SHA256HashString("example.com/more");
77 77
78 FindFullHashesResponse response; 78 FindFullHashesResponse response;
79 response.mutable_negative_cache_duration()->set_seconds(600); 79 response.mutable_negative_cache_duration()->set_seconds(600);
80 ThreatMatch* m = response.add_matches(); 80 ThreatMatch* m = response.add_matches();
81 m->set_platform_type(list_id.platform_type); 81 m->set_platform_type(list_id.platform_type());
82 m->set_threat_entry_type(list_id.threat_entry_type); 82 m->set_threat_entry_type(list_id.threat_entry_type());
83 m->set_threat_type(list_id.threat_type); 83 m->set_threat_type(list_id.threat_type());
84 m->mutable_threat()->set_hash(full_hash); 84 m->mutable_threat()->set_hash(full_hash);
85 m->mutable_cache_duration()->set_seconds(300); 85 m->mutable_cache_duration()->set_seconds(300);
86 86
87 ThreatEntryMetadata::MetadataEntry* e = 87 ThreatEntryMetadata::MetadataEntry* e =
88 m->mutable_threat_entry_metadata()->add_entries(); 88 m->mutable_threat_entry_metadata()->add_entries();
89 e->set_key("permission"); 89 e->set_key("permission");
90 e->set_value("GEOLOCATION"); 90 e->set_value("GEOLOCATION");
91 91
92 std::string res_data; 92 std::string res_data;
93 response.SerializeToString(&res_data); 93 response.SerializeToString(&res_data);
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 fetcher->delegate()->OnURLFetchComplete(fetcher); 141 fetcher->delegate()->OnURLFetchComplete(fetcher);
142 142
143 base::RunLoop().RunUntilIdle(); 143 base::RunLoop().RunUntilIdle();
144 144
145 ASSERT_TRUE(client.callback_invoked()); 145 ASSERT_TRUE(client.callback_invoked());
146 ASSERT_EQ(1ul, client.GetBlockedPermissions().size()); 146 ASSERT_EQ(1ul, client.GetBlockedPermissions().size());
147 EXPECT_EQ("GEOLOCATION", *(client.GetBlockedPermissions().begin())); 147 EXPECT_EQ("GEOLOCATION", *(client.GetBlockedPermissions().begin()));
148 } 148 }
149 149
150 } // namespace safe_browsing 150 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « components/safe_browsing_db/BUILD.gn ('k') | components/safe_browsing_db/util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698