Commit 1596433b authored by vakh's avatar vakh Committed by Commit bot

Since the verdict field is currently marked as 'required', whenever Chrome (or...

Since the verdict field is currently marked as 'required', whenever Chrome (or Firefox) can't parse this field properly, it leads to an overall failure in parsing the entire proto message.

Making it optional with a default value (SAFE) solves that problem.

See: cl/131841696

BUG=

Review-Url: https://codereview.chromium.org/2292963004
Cr-Commit-Position: refs/heads/master@{#415771}
parent 60fe41ca
......@@ -1079,7 +1079,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) {
ClearClientDownloadRequest();
}
{
// Invalid response should result in UNKNOWN.
// Invalid response should result in SAFE (default value in proto).
ClientDownloadResponse invalid_response;
factory.SetFakeResponse(DownloadProtectionService::GetDownloadRequestUrl(),
invalid_response.SerializePartialAsString(),
......@@ -1089,7 +1089,7 @@ TEST_F(DownloadProtectionServiceTest, CheckClientDownloadSuccess) {
&item, base::Bind(&DownloadProtectionServiceTest::CheckDoneCallback,
base::Unretained(this), run_loop.QuitClosure()));
run_loop.Run();
EXPECT_TRUE(IsResult(DownloadProtectionService::UNKNOWN));
EXPECT_TRUE(IsResult(DownloadProtectionService::SAFE));
EXPECT_TRUE(HasClientDownloadRequest());
ClearClientDownloadRequest();
EXPECT_FALSE(DownloadFeedbackService::GetPingsForDownloadForTesting(
......
......@@ -400,7 +400,7 @@ message ClientDownloadResponse {
// Chrome should show the default warning if configured for this file type.
UNKNOWN = 5;
}
required Verdict verdict = 1;
optional Verdict verdict = 1 [default = SAFE];
message MoreInfo {
// A human-readable string describing the nature of the warning.
......
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