| Index: components/safe_browsing_db/v4_database_unittest.cc
|
| diff --git a/components/safe_browsing_db/v4_database_unittest.cc b/components/safe_browsing_db/v4_database_unittest.cc
|
| index 0329871674ffd1301843b46e8ea18d685f32703c..83e361f4662f4132ff24b4170eaf2cde7d39bac8 100644
|
| --- a/components/safe_browsing_db/v4_database_unittest.cc
|
| +++ b/components/safe_browsing_db/v4_database_unittest.cc
|
| @@ -128,17 +128,20 @@ class SafeBrowsingV4DatabaseTest : public PlatformTest {
|
| v4_database_ = std::move(v4_database);
|
| }
|
|
|
| - void PopulateFakeUpdateResponse(StoreStateMap store_state_map,
|
| - std::vector<ListUpdateResponse>* responses) {
|
| + std::unique_ptr<ParsedServerResponse> CreateFakeServerResponse(
|
| + StoreStateMap store_state_map) {
|
| + std::unique_ptr<ParsedServerResponse> parsed_server_response(
|
| + new ParsedServerResponse);
|
| for (const auto& store_state_iter : store_state_map) {
|
| UpdateListIdentifier identifier = store_state_iter.first;
|
| - ListUpdateResponse list_update_response;
|
| - list_update_response.set_platform_type(identifier.platform_type);
|
| - list_update_response.set_threat_entry_type(identifier.threat_entry_type);
|
| - list_update_response.set_threat_type(identifier.threat_type);
|
| - list_update_response.set_new_client_state(store_state_iter.second);
|
| - responses->push_back(list_update_response);
|
| + ListUpdateResponse* list_update_response = new ListUpdateResponse;
|
| + list_update_response->set_platform_type(identifier.platform_type);
|
| + list_update_response->set_threat_entry_type(identifier.threat_entry_type);
|
| + list_update_response->set_threat_type(identifier.threat_type);
|
| + list_update_response->set_new_client_state(store_state_iter.second);
|
| + parsed_server_response->push_back(base::WrapUnique(list_update_response));
|
| }
|
| + return parsed_server_response;
|
| }
|
|
|
| void VerifyExpectedStoresState(bool expect_new_stores) {
|
| @@ -236,9 +239,10 @@ TEST_F(SafeBrowsingV4DatabaseTest, TestApplyUpdateWithNewStates) {
|
| old_stores_map_[store_iter.first] = store;
|
| }
|
|
|
| - std::vector<ListUpdateResponse> update_response;
|
| - PopulateFakeUpdateResponse(expected_store_state_map_, &update_response);
|
| - v4_database_->ApplyUpdate(update_response, callback_db_updated_);
|
| + std::unique_ptr<ParsedServerResponse> parsed_server_response =
|
| + CreateFakeServerResponse(expected_store_state_map_);
|
| + v4_database_->ApplyUpdate(std::move(parsed_server_response),
|
| + callback_db_updated_);
|
|
|
| task_runner_->RunPendingTasks();
|
| base::RunLoop().RunUntilIdle();
|
| @@ -267,9 +271,10 @@ TEST_F(SafeBrowsingV4DatabaseTest, TestApplyUpdateWithNoNewState) {
|
| old_stores_map_[store_iter.first] = store;
|
| }
|
|
|
| - std::vector<ListUpdateResponse> update_response;
|
| - PopulateFakeUpdateResponse(expected_store_state_map_, &update_response);
|
| - v4_database_->ApplyUpdate(update_response, callback_db_updated_);
|
| + std::unique_ptr<ParsedServerResponse> parsed_server_response =
|
| + CreateFakeServerResponse(expected_store_state_map_);
|
| + v4_database_->ApplyUpdate(std::move(parsed_server_response),
|
| + callback_db_updated_);
|
|
|
| task_runner_->RunPendingTasks();
|
| base::RunLoop().RunUntilIdle();
|
| @@ -298,8 +303,10 @@ TEST_F(SafeBrowsingV4DatabaseTest, TestApplyUpdateWithEmptyUpdate) {
|
| old_stores_map_[store_iter.first] = store;
|
| }
|
|
|
| - std::vector<ListUpdateResponse> update_response;
|
| - v4_database_->ApplyUpdate(update_response, callback_db_updated_);
|
| + std::unique_ptr<ParsedServerResponse> parsed_server_response(
|
| + new ParsedServerResponse);
|
| + v4_database_->ApplyUpdate(std::move(parsed_server_response),
|
| + callback_db_updated_);
|
|
|
| task_runner_->RunPendingTasks();
|
| base::RunLoop().RunUntilIdle();
|
|
|