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 dump.addChildren(getOption(opt_options, 'children')); | |
benjhayden
2017/09/15 17:30:46
MemoryAllocatorDump doesn't protect its children p
yuzuchan
2017/09/19 07:56:26
Done.
| |
127 return dump; | 128 return dump; |
128 }; | 129 }; |
129 | 130 |
130 /** | 131 /** |
131 * Create a new child memory allocator dump and add it to a parent memory | 132 * Create a new child memory allocator dump and add it to a parent memory |
132 * allocator dump. | 133 * allocator dump. |
133 * | 134 * |
134 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator | 135 * @param {!tr.model.MemoryAllocatorDump} parentDump The parent allocator |
135 * dump. | 136 * dump. |
136 * @param {string} name The name of the child allocator dump (excluding | 137 * @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); | 210 assert.strictEqual(actualRegion.mappedFile, expectedRegion.mappedFile); |
210 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); | 211 assert.deepEqual(actualRegion.byteStats, expectedRegion.byteStats); |
211 } | 212 } |
212 }; | 213 }; |
213 | 214 |
214 return { | 215 return { |
215 MemoryDumpTestUtils, | 216 MemoryDumpTestUtils, |
216 }; | 217 }; |
217 }); | 218 }); |
218 </script> | 219 </script> |
OLD | NEW |