| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "content/shell/renderer/layout_test/leak_detector.h" | 5 #include "content/shell/renderer/layout_test/leak_detector.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "content/shell/renderer/layout_test/blink_test_runner.h" | 10 #include "content/shell/renderer/layout_test/blink_test_runner.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 78 } | 78 } |
| 79 if (previous_result_.numberOfLiveResources < result.numberOfLiveResources) { | 79 if (previous_result_.numberOfLiveResources < result.numberOfLiveResources) { |
| 80 base::ListValue* list = new base::ListValue(); | 80 base::ListValue* list = new base::ListValue(); |
| 81 list->AppendInteger(previous_result_.numberOfLiveResources); | 81 list->AppendInteger(previous_result_.numberOfLiveResources); |
| 82 list->AppendInteger(result.numberOfLiveResources); | 82 list->AppendInteger(result.numberOfLiveResources); |
| 83 detail.Set("numberOfLiveResources", list); | 83 detail.Set("numberOfLiveResources", list); |
| 84 } | 84 } |
| 85 | 85 |
| 86 if (!detail.empty()) { | 86 if (!detail.empty()) { |
| 87 std::string detail_str; | 87 std::string detail_str; |
| 88 base::JSONWriter::Write(&detail, &detail_str); | 88 base::JSONWriter::Write(detail, &detail_str); |
| 89 report.detail = detail_str; | 89 report.detail = detail_str; |
| 90 report.leaked = true; | 90 report.leaked = true; |
| 91 } | 91 } |
| 92 | 92 |
| 93 previous_result_ = result; | 93 previous_result_ = result; |
| 94 test_runner_->ReportLeakDetectionResult(report); | 94 test_runner_->ReportLeakDetectionResult(report); |
| 95 } | 95 } |
| 96 | 96 |
| 97 } // namespace content | 97 } // namespace content |
| OLD | NEW |