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

Side by Side Diff: tracing/tracing/metrics/metric_map_function_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
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="/perf_insights/mre/mre_result.html"> 8 <link rel="import" href="/perf_insights/mre/mre_result.html">
9 <link rel="import" href="/tracing/core/test_utils.html"> 9 <link rel="import" href="/tracing/core/test_utils.html">
10 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html"> 10 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html">
(...skipping 28 matching lines...) Expand all
39 type: ThreadSlice, 39 type: ThreadSlice,
40 name: 'some_slice', 40 name: 'some_slice',
41 start: 20, end: 30 41 start: 20, end: 30
42 })); 42 }));
43 } 43 }
44 }); 44 });
45 45
46 assert.throw(function() { 46 assert.throw(function() {
47 var result = new pi.mre.MreResult(); 47 var result = new pi.mre.MreResult();
48 tr.metrics.metricMapFunction(result, m, {}); 48 tr.metrics.metricMapFunction(result, m, {});
49 }, Error, 'A metric name should be specified.'); 49 }, Error, 'Metric names should be specified.');
50 50
51 assert.throw(function() { 51 assert.throw(function() {
52 var result = new pi.mre.MreResult(); 52 var result = new pi.mre.MreResult();
53 tr.metrics.metricMapFunction(result, m, {'metric': 'wrongMetric'}); 53 tr.metrics.metricMapFunction(result, m, {'metrics': ['wrongMetric']});
54 }, Error, '"wrongMetric" is not a registered metric.'); 54 }, Error, '"wrongMetric" is not a registered metric.');
55 55
56 var result = new pi.mre.MreResult(); 56 var result = new pi.mre.MreResult();
57 tr.metrics.metricMapFunction(result, m, {'metric': 'sampleMetric'}); 57 tr.metrics.metricMapFunction(result, m, {'metrics': ['sampleMetric']});
58 assert.property(result.pairs, 'values'); 58 assert.property(result.pairs, 'values');
59 assert.equal(result.pairs.values.length, 9);
60
61 var result2 = new pi.mre.MreResult();
62 tr.metrics.metricMapFunction(
63 result2, m, {'metrics': ['sampleMetric', 'sampleMetric2']});
64 assert.property(result2.pairs, 'values');
59 }); 65 });
60 }); 66 });
61 </script> 67 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/metrics/metric_map_function.html ('k') | tracing/tracing/metrics/metric_runner.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698