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/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
9 <link rel="import" href="/tracing/base/multi_dimensional_view.html"> | 9 <link rel="import" href="/tracing/base/multi_dimensional_view.html"> |
10 <link rel="import" href="/tracing/core/test_utils.html"> | 10 <link rel="import" href="/tracing/core/test_utils.html"> |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 node.values, | 366 node.values, |
367 function(value) { | 367 function(value) { |
368 generator.push('{'); | 368 generator.push('{'); |
369 generator.indentBlock(2, true /* break line */, | 369 generator.indentBlock(2, true /* break line */, |
370 function() { | 370 function() { |
371 generator.push('total: ', String(value.total), ','); | 371 generator.push('total: ', String(value.total), ','); |
372 generator.breakLine(); | 372 generator.breakLine(); |
373 generator.push('self: ', String(value.self), ','); | 373 generator.push('self: ', String(value.self), ','); |
374 generator.breakLine(); | 374 generator.breakLine(); |
375 generator.push('totalState: '); | 375 generator.push('totalState: '); |
376 const totalStateName = | 376 |
377 tr.b.findFirstKeyInDictMatching( | 377 let totalStateName; |
378 MultiDimensionalViewNode.TotalState, | 378 for (const [name, state] of Object.entries( |
379 (n, s) => s === value.totalState); | 379 MultiDimensionalViewNode.TotalState)) { |
| 380 if (state === value.totalState) { |
| 381 totalStateName = name; |
| 382 break; |
| 383 } |
| 384 } |
380 if (totalStateName === undefined) { | 385 if (totalStateName === undefined) { |
381 throw new Error( | 386 throw new Error( |
382 'Unknown total state: ' + value.totalState); | 387 'Unknown total state: ' + value.totalState); |
383 } | 388 } |
384 generator.push(totalStateName); | 389 generator.push(totalStateName); |
385 generator.breakLine(); | 390 generator.breakLine(); |
386 }); | 391 }); |
387 generator.push('}'); | 392 generator.push('}'); |
388 }); | 393 }); |
389 generator.push(','); | 394 generator.push(','); |
(...skipping 12978 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
13368 // Interleaved repetition. | 13373 // Interleaved repetition. |
13369 checkZFunction([1, 2, 1, 3, 1, 2, 1], [0, 0, 1, 0, 3, 0, 1]); | 13374 checkZFunction([1, 2, 1, 3, 1, 2, 1], [0, 0, 1, 0, 3, 0, 1]); |
13370 checkZFunction('AAABAAB', [0, 2, 1, 0, 2, 1, 0]); | 13375 checkZFunction('AAABAAB', [0, 2, 1, 0, 2, 1, 0]); |
13371 | 13376 |
13372 // Complex patterns. | 13377 // Complex patterns. |
13373 checkZFunction([7, 9, 7, 9, 7, 9, 7, 9], [0, 0, 6, 0, 4, 0, 2, 0]); | 13378 checkZFunction([7, 9, 7, 9, 7, 9, 7, 9], [0, 0, 6, 0, 4, 0, 2, 0]); |
13374 checkZFunction('CCGTCCCGTACC', [0, 1, 0, 0, 2, 4, 1, 0, 0, 0, 2, 1]); | 13379 checkZFunction('CCGTCCCGTACC', [0, 1, 0, 0, 2, 4, 1, 0, 0, 0, 2, 1]); |
13375 }); | 13380 }); |
13376 }); | 13381 }); |
13377 </script> | 13382 </script> |
OLD | NEW |