Commit 217d5e58 authored by Olivier Li's avatar Olivier Li Committed by Commit Bot

Reactivate ProtoChromePromptIPCTest with improved logging and fixed bug.

Bug: 969139
Change-Id: I26fe6a4d739797ca8b5498fd3f7c1d54b0867820
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1762484
Commit-Queue: Oliver Li <olivierli@chromium.org>
Reviewed-by: default avatarJoe Mason <joenotcharles@google.com>
Cr-Commit-Position: refs/heads/master@{#689489}
parent 8ee4ef1c
...@@ -138,7 +138,9 @@ void ProtoChromePromptIPC::RunPromptUserTask( ...@@ -138,7 +138,9 @@ void ProtoChromePromptIPC::RunPromptUserTask(
*chrome_prompt_request.mutable_prompt_user() = prompt_user_message; *chrome_prompt_request.mutable_prompt_user() = prompt_user_message;
std::string request_content; std::string request_content;
DCHECK(chrome_prompt_request.SerializeToString(&request_content)); bool serialize_result =
chrome_prompt_request.SerializeToString(&request_content);
DCHECK(serialize_result);
SendBuffer(request_content); SendBuffer(request_content);
...@@ -161,7 +163,8 @@ void ProtoChromePromptIPC::RunPromptUserTask( ...@@ -161,7 +163,8 @@ void ProtoChromePromptIPC::RunPromptUserTask(
*chrome_prompt_request.mutable_close_connection() = close_connection_request; *chrome_prompt_request.mutable_close_connection() = close_connection_request;
std::string response_content; std::string response_content;
DCHECK(chrome_prompt_request.SerializeToString(&response_content)); serialize_result = chrome_prompt_request.SerializeToString(&response_content);
DCHECK(serialize_result);
SendBuffer(response_content); SendBuffer(response_content);
......
...@@ -94,6 +94,7 @@ class ProtoChromePromptIPC : public ChromePromptIPC { ...@@ -94,6 +94,7 @@ class ProtoChromePromptIPC : public ChromePromptIPC {
OnConnectionError(); OnConnectionError();
return; return;
} }
if (bytes_written != size) { if (bytes_written != size) {
LOG(ERROR) << "Incorrect number of bytes written to the pipe. Should be: " LOG(ERROR) << "Incorrect number of bytes written to the pipe. Should be: "
<< size << " but is :" << bytes_written; << size << " but is :" << bytes_written;
......
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