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

Unified Diff: components/safe_browsing_db/v4_update_protocol_manager_unittest.cc

Issue 2103693002: SafeBrowsing PVer4: Send mutable response to the database and the stores (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@02_ReadFromDisk
Patch Set: Minor: Add the explicit keyword for UpdateListIdentifier constructor Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « components/safe_browsing_db/v4_update_protocol_manager.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/safe_browsing_db/v4_update_protocol_manager_unittest.cc
diff --git a/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc b/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc
index b47cced59040b49150b0b24cc5eea2495f4f3c87..6e705aea2a08a29baf84751a1e40f9b377ca55d0 100644
--- a/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc
+++ b/components/safe_browsing_db/v4_update_protocol_manager_unittest.cc
@@ -45,21 +45,21 @@ class V4UpdateProtocolManagerTest : public PlatformTest {
protected:
void ValidateGetUpdatesResults(
const std::vector<ListUpdateResponse>& expected_lurs,
- const std::vector<ListUpdateResponse>& list_update_responses) {
+ std::unique_ptr<ParsedServerResponse> parsed_server_response) {
// The callback should never be called if expect_callback_to_be_called_ is
// false.
EXPECT_TRUE(expect_callback_to_be_called_);
- ASSERT_EQ(expected_lurs.size(), list_update_responses.size());
+ ASSERT_EQ(expected_lurs.size(), parsed_server_response->size());
- for (unsigned int i = 0; i < list_update_responses.size(); ++i) {
+ for (unsigned int i = 0; i < parsed_server_response->size(); ++i) {
const ListUpdateResponse& expected = expected_lurs[i];
- const ListUpdateResponse& actual = list_update_responses[i];
-
- EXPECT_EQ(expected.platform_type(), actual.platform_type());
- EXPECT_EQ(expected.response_type(), actual.response_type());
- EXPECT_EQ(expected.threat_entry_type(), actual.threat_entry_type());
- EXPECT_EQ(expected.threat_type(), actual.threat_type());
- EXPECT_EQ(expected.new_client_state(), actual.new_client_state());
+ const std::unique_ptr<ListUpdateResponse>& actual =
+ (*parsed_server_response)[i];
+ EXPECT_EQ(expected.platform_type(), actual->platform_type());
+ EXPECT_EQ(expected.response_type(), actual->response_type());
+ EXPECT_EQ(expected.threat_entry_type(), actual->threat_entry_type());
+ EXPECT_EQ(expected.threat_type(), actual->threat_type());
+ EXPECT_EQ(expected.new_client_state(), actual->new_client_state());
// TODO(vakh): Test more fields from the proto.
}
« no previous file with comments | « components/safe_browsing_db/v4_update_protocol_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698