| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2015 The Chromium Authors. All rights reserved. |
| Use of this source code is governed by a BSD-style license that can be |
| found in the LICENSE file. |
| --> |
| |
| <link rel="import" href="/perf_insights/mre/mre_result.html"> |
| <link rel="import" href="/perf_insights_examples/map_process_count.html"> |
| <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| <link rel="import" href="/tracing/core/test_utils.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tr.b.unittest.testSuite(function() { |
| var test_utils = tr.c.TestUtils; |
| test('mapperTest', function() { |
| var m = test_utils.newModel(function(m) { |
| var p1 = m.getOrCreateProcess(1); |
| var t2 = p1.getOrCreateThread(2); |
| t2.sliceGroup.pushSlice(test_utils.newSliceEx({ |
| name: 'some_slice', |
| start: 0, duration: 10 |
| })); |
| }); |
| |
| var result = new pi.mre.MreResult(); |
| pie.mapProcessCountForTest(result, m); |
| |
| assert.equal(tr.b.dictionaryLength(result.pairs), 1); |
| assert.equal(result.failures.length, 0); |
| }); |
| }); |
| |
| </script> |