Commit 9984a7a1 authored by donnd's avatar donnd Committed by Commit bot

[TTS] Log diagnostic output log for Contextual Cards.

When Contextual Cards integration is enabled we now check for server
diagnostic data in the response and output it to the log when on a
debug build.

BUG=644934

Review-Url: https://codereview.chromium.org/2542813002
Cr-Commit-Position: refs/heads/master@{#435662}
parent 9921fa1d
...@@ -558,18 +558,16 @@ void ContextualSearchDelegate::DecodeSearchTermFromJsonResponse( ...@@ -558,18 +558,16 @@ void ContextualSearchDelegate::DecodeSearchTermFromJsonResponse(
base::FeatureList::IsEnabled( base::FeatureList::IsEnabled(
chrome::android::kContextualSearchSingleActions)) { chrome::android::kContextualSearchSingleActions)) {
// Any Contextual Cards integration. // Any Contextual Cards integration.
// For testing purposes check if there was a Contextual Cards backend // For testing purposes check if there was a diagnostic from Contextual
// failure and flag that in the log. // Cards and output that into the log.
// TODO(donnd): remove after full Contextual Cards integration. // TODO(donnd): remove after full Contextual Cards integration.
bool contextual_cards_backend_responded = true; std::string contextual_cards_diagnostic;
dict->GetBoolean("coca_responded", &contextual_cards_backend_responded); dict->GetString("diagnostic", &contextual_cards_diagnostic);
if (!contextual_cards_backend_responded) { if (contextual_cards_diagnostic.empty()) {
DVLOG(0) << ""; DVLOG(0) << "No diagnostic data in the response.";
DVLOG(0) << "!!! CONTEXTUAL SEARCH WARNING !!!"; } else {
DVLOG(0) DVLOG(0) << "The Contextual Cards backend response: ";
<< "The Contextual Cards backend did not respond to this " DVLOG(0) << contextual_cards_diagnostic;
"request!!! The backend server may not be configured or is down.";
DVLOG(0) << "";
} }
} }
} }
......
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