OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2016 The Chromium Authors. All rights reserved. | 3 Copyright 2016 The Chromium Authors. All rights reserved. |
4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
5 found in the LICENSE file. | 5 found in the LICENSE file. |
6 --> | 6 --> |
7 | 7 |
8 <link rel="import" href="/tracing/base/scalar.html"> | 8 <link rel="import" href="/tracing/base/scalar.html"> |
9 <link rel="import" href="/tracing/base/unit.html"> | 9 <link rel="import" href="/tracing/base/unit.html"> |
10 <link rel="import" href="/tracing/model/container_memory_dump.html"> | 10 <link rel="import" href="/tracing/model/container_memory_dump.html"> |
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
117 MemoryDumpTestUtils.newAllocatorDump = function( | 117 MemoryDumpTestUtils.newAllocatorDump = function( |
118 containerDump, fullName, opt_options) { | 118 containerDump, fullName, opt_options) { |
119 const dump = new MemoryAllocatorDump(containerDump, fullName, | 119 const dump = new MemoryAllocatorDump(containerDump, fullName, |
120 getOption(opt_options, 'guid')); | 120 getOption(opt_options, 'guid')); |
121 const numerics = getOption(opt_options, 'numerics'); | 121 const numerics = getOption(opt_options, 'numerics'); |
122 if (numerics) { | 122 if (numerics) { |
123 for (const [numericName, value] of Object.entries(numerics)) { | 123 for (const [numericName, value] of Object.entries(numerics)) { |
124 dump.addNumeric(numericName, castToScalar(value)); | 124 dump.addNumeric(numericName, castToScalar(value)); |
125 } | 125 } |
126 } | 126 } |
| 127 const children = getOption(opt_options, 'children'); |
| 128 if (children) dump.children = children; |
127 return dump; | 129 return dump; |
128 }; | 130 }; |
129 | 131 |
130 /** | 132 /** |
131 * Create a new child memory allocator dump and add it to a parent memory | 133 * Create a new child memory allocator dump and add it to a parent memory |
132 * allocator dump. | 134 * allocator dump. |
133 * | 135 * |
134 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator | 136 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator |
135 * dump. | 137 * dump. |
136 * @param {string} name The name of the child allocator dump (excluding | 138 * @param {string} name The name of the child allocator dump (excluding |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
209 assert.strictEqual(actualRegion.mappedFile, expectedRegion.mappedFile); | 211 assert.strictEqual(actualRegion.mappedFile, expectedRegion.mappedFile); |
210 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); | 212 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); |
211 } | 213 } |
212 }; | 214 }; |
213 | 215 |
214 return { | 216 return { |
215 MemoryDumpTestUtils, | 217 MemoryDumpTestUtils, |
216 }; | 218 }; |
217 }); | 219 }); |
218 </script> | 220 </script> |
OLD | NEW |