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

Side by Side Diff: tracing/tracing/value/ui/composition_span_test.html

Issue 2283213002: Rename Histogram.add() to addSample(). (Closed) Base URL: https://github.com/catapult-project/catapult.git@master
Patch Set: rebase Created 4 years, 3 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="/tracing/value/diagnostics/composition.html"> 8 <link rel="import" href="/tracing/value/diagnostics/composition.html">
9 <link rel="import" href="/tracing/value/histogram.html"> 9 <link rel="import" href="/tracing/value/histogram.html">
10 <link rel="import" href="/tracing/value/ui/composition_span.html"> 10 <link rel="import" href="/tracing/value/ui/composition_span.html">
11 <link rel="import" href="/tracing/value/ui/diagnostic_span.html"> 11 <link rel="import" href="/tracing/value/ui/diagnostic_span.html">
12 <link rel="import" href="/tracing/value/value.html"> 12 <link rel="import" href="/tracing/value/value.html">
13 13
14 <script> 14 <script>
15 'use strict'; 15 'use strict';
16 16
17 tr.b.unittest.testSuite(function() { 17 tr.b.unittest.testSuite(function() {
18 test('instantiate_Composition', function() { 18 test('instantiate_Composition', function() {
19 var numeric = new tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs); 19 var numeric = new tr.v.Histogram(tr.v.Unit.byName.timeDurationInMs);
20 var scalar = new tr.v.ScalarNumeric(tr.v.Unit.byName.timeDurationInMs, 42); 20 var scalar = new tr.v.ScalarNumeric(tr.v.Unit.byName.timeDurationInMs, 42);
21 for (var i = 0; i < 1e2; ++i) { 21 for (var i = 0; i < 1e2; ++i) {
22 numeric.add(Math.random()); 22 numeric.addSample(Math.random());
23 } 23 }
24 var composition = new tr.v.d.Composition(); 24 var composition = new tr.v.d.Composition();
25 composition.add(new tr.v.NumericValue('numeric', numeric)); 25 composition.add(new tr.v.NumericValue('numeric', numeric));
26 composition.add(new tr.v.NumericValue('scalar', scalar)); 26 composition.add(new tr.v.NumericValue('scalar', scalar));
27 var span = tr.v.ui.createDiagnosticSpan(composition); 27 var span = tr.v.ui.createDiagnosticSpan(composition);
28 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName); 28 assert.strictEqual('TR-V-UI-COMPOSITION-SPAN', span.tagName);
29 this.addHTMLOutput(span); 29 this.addHTMLOutput(span);
30 }); 30 });
31 }); 31 });
32 </script> 32 </script>
OLDNEW
« no previous file with comments | « tracing/tracing/value/histogram_test.html ('k') | tracing/tracing/value/ui/histogram_span_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698