Commit 4783d850 authored by Daniel Rubery's avatar Daniel Rubery Committed by Commit Bot

Fix bug where the BinaryUploadService always has empty responses

This CL also adds a basic test for this.

Bug: 980784
Change-Id: Ic8696ef13811cf2cc0135268966ee47c04c4185f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1769235
Auto-Submit: Daniel Rubery <drubery@chromium.org>
Reviewed-by: default avatarVarun Khaneja <vakh@chromium.org>
Commit-Queue: Varun Khaneja <vakh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#690115}
parent beb5dbce
...@@ -231,7 +231,7 @@ void BinaryUploadService::OnTimeout(Request* request) { ...@@ -231,7 +231,7 @@ void BinaryUploadService::OnTimeout(Request* request) {
void BinaryUploadService::FinishRequest(Request* request, void BinaryUploadService::FinishRequest(Request* request,
Result result, Result result,
DeepScanningClientResponse response) { DeepScanningClientResponse response) {
request->FinishRequest(result, DeepScanningClientResponse()); request->FinishRequest(result, response);
active_requests_.erase(request); active_requests_.erase(request);
active_timers_.erase(request); active_timers_.erase(request);
active_uploads_.erase(request); active_uploads_.erase(request);
......
...@@ -232,6 +232,9 @@ TEST_F(BinaryUploadServiceTest, HoldsScanResponsesUntilAllReady) { ...@@ -232,6 +232,9 @@ TEST_F(BinaryUploadServiceTest, HoldsScanResponsesUntilAllReady) {
response.mutable_malware_scan_verdict(); response.mutable_malware_scan_verdict();
ReceiveMessageForRequest(raw_request, response); ReceiveMessageForRequest(raw_request, response);
content::RunAllTasksUntilIdle(); content::RunAllTasksUntilIdle();
EXPECT_TRUE(scanning_response.has_dlp_scan_verdict());
EXPECT_TRUE(scanning_response.has_malware_scan_verdict());
EXPECT_EQ(scanning_result, BinaryUploadService::Result::SUCCESS); EXPECT_EQ(scanning_result, BinaryUploadService::Result::SUCCESS);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment