Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Side by Side Diff: perf_insights/perf_insights/mappers/trace_stats_test.html

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <!--
3 Copyright 2015 The Chromium Authors. All rights reserved.
4 Use of this source code is governed by a BSD-style license that can be
5 found in the LICENSE file.
6 -->
7
8 <link rel="import" href="/perf_insights/mappers/trace_stats.html">
9 <link rel="import" href="/perf_insights/mre/mre_result.html">
10 <link rel="import" href="/tracing/base/iteration_helpers.html">
11 <link rel="import" href="/tracing/core/test_utils.html">
12
13 <script>
14 'use strict';
15
16 tr.b.unittest.testSuite(function() {
17 var test_utils = tr.c.TestUtils;
18 var ThreadSlice = tr.model.ThreadSlice;
19
20 test('traceStatsTest', function() {
21 var m = test_utils.newModel(function(m) {
22 var p1 = m.getOrCreateProcess(1);
23 var t2 = p1.getOrCreateThread(2);
24 t2.sliceGroup.pushSlice(test_utils.newSliceEx({
25 name: 'some_slice',
26 start: 0, duration: 10
27 }));
28 });
29
30 var result = new pi.mre.MreResult();
31 pi.m.traceStatsFunctionForTest(result, m);
32
33 assert.equal(tr.b.dictionaryLength(result.pairs), 1);
34 var dict = result.pairs.stats;
35 assert.equal(dict.totalEvents, 1);
36 assert.equal(dict.firstTimeInMS, 0);
37 assert.equal(dict.lastTimeInMS, 10);
38 assert.equal(dict.durationInMS, 10);
39 assert.equal(dict.eventsPerSecond, 100);
40 });
41 });
42
43 </script>
OLDNEW
« no previous file with comments | « perf_insights/perf_insights/mappers/trace_stats.html ('k') | perf_insights/perf_insights/mappers/v8_map_function.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698