diff options
author | hubbe <hubbe@chromium.org> | 2015-05-05 15:56:19 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-05-05 22:57:03 +0000 |
commit | 1a92b387b1b1488d468f65d856924dcf3e99a9af (patch) | |
tree | af8a0400949ba52ae0b9504fceda40cdd37ab377 /content | |
parent | 31ff2c9186e1d18868b3674ed42d1518f7bbefdc (diff) | |
download | chromium_src-1a92b387b1b1488d468f65d856924dcf3e99a9af.zip chromium_src-1a92b387b1b1488d468f65d856924dcf3e99a9af.tar.gz chromium_src-1a92b387b1b1488d468f65d856924dcf3e99a9af.tar.bz2 |
If JSON parsing fails, print out why.
BUG=481764
Review URL: https://codereview.chromium.org/1117203003
Cr-Commit-Position: refs/heads/master@{#328424}
Diffstat (limited to 'content')
-rw-r--r-- | content/common/gpu/client/gl_helper_unittest.cc | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/content/common/gpu/client/gl_helper_unittest.cc b/content/common/gpu/client/gl_helper_unittest.cc index 5f7d3c2..3e46c76 100644 --- a/content/common/gpu/client/gl_helper_unittest.cc +++ b/content/common/gpu/client/gl_helper_unittest.cc @@ -110,7 +110,13 @@ class GLHelperTest : public testing::Test { run_loop.Run(); json_data.append("]"); - scoped_ptr<base::Value> trace_data(base::JSONReader::Read(json_data)); + std::string error_msg; + scoped_ptr<base::Value> trace_data( + base::JSONReader::ReadAndReturnError(json_data, 0, NULL, &error_msg)); + CHECK(trace_data) + << "JSON parsing failed (" << error_msg << ") JSON data:" << std::endl + << json_data; + base::ListValue* list; CHECK(trace_data->GetAsList(&list)); for (size_t i = 0; i < list->GetSize(); i++) { |