Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(479)

Unified Diff: test/launcher/test_results_tracker.cc

Issue 2045303002: Update to Chromium //base at Chromium commit 3e81715e6d3a4324362635aea46ce1f1a163cca1. (Closed) Base URL: https://chromium.googlesource.com/external/github.com/domokit/base@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/launcher/test_launcher.cc ('k') | test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/launcher/test_results_tracker.cc
diff --git a/test/launcher/test_results_tracker.cc b/test/launcher/test_results_tracker.cc
index 6c52e3c8c5bfec492ab660c2d24effe2f5f6ac90..c65adc7877d3eb8c7681b37a7aad7aaa8853c87e 100644
--- a/test/launcher/test_results_tracker.cc
+++ b/test/launcher/test_results_tracker.cc
@@ -263,16 +263,20 @@ bool TestResultsTracker::SaveSummaryAsJSON(const FilePath& path) const {
"elapsed_time_ms",
static_cast<int>(test_result.elapsed_time.InMilliseconds()));
- // There are no guarantees about character encoding of the output
- // snippet. Escape it and record whether it was losless.
- // It's useful to have the output snippet as string in the summary
- // for easy viewing.
- std::string escaped_output_snippet;
- bool losless_snippet = EscapeJSONString(
- test_result.output_snippet, false, &escaped_output_snippet);
- test_result_value->SetString("output_snippet",
- escaped_output_snippet);
- test_result_value->SetBoolean("losless_snippet", losless_snippet);
+ bool lossless_snippet = false;
+ if (IsStringUTF8(test_result.output_snippet)) {
+ test_result_value->SetString("output_snippet",
+ test_result.output_snippet);
+ lossless_snippet = true;
+ } else {
+ test_result_value->SetString(
+ "output_snippet",
+ "<non-UTF-8 snippet, see output_snippet_base64>");
+ }
+
+ // TODO(phajdan.jr): Fix typo in JSON key (losless -> lossless)
+ // making sure not to break any consumers of this data.
+ test_result_value->SetBoolean("losless_snippet", lossless_snippet);
// Also include the raw version (base64-encoded so that it can be safely
// JSON-serialized - there are no guarantees about character encoding
« no previous file with comments | « test/launcher/test_launcher.cc ('k') | test/launcher/unit_test_launcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698