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

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

Issue 3002973002: Refactor diagnostic spans to share a polymer behavior. (Closed)
Patch Set: Created 3 years, 4 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/base/fixed_color_scheme.html"> 8 <link rel="import" href="/tracing/base/fixed_color_scheme.html">
9 <link rel="import" href="/tracing/ui/base/deep_utils.html"> 9 <link rel="import" href="/tracing/ui/base/deep_utils.html">
10 <link rel="import" href="/tracing/value/diagnostics/breakdown.html"> 10 <link rel="import" href="/tracing/value/diagnostics/breakdown.html">
(...skipping 19 matching lines...) Expand all
30 breakdown.set('f', foo); 30 breakdown.set('f', foo);
31 31
32 const bar = new tr.v.Histogram('bar', tr.b.Unit.byName.timeDurationInMs); 32 const bar = new tr.v.Histogram('bar', tr.b.Unit.byName.timeDurationInMs);
33 breakdown.add(bar); 33 breakdown.add(bar);
34 34
35 for (let i = 0; i < 1e2; ++i) { 35 for (let i = 0; i < 1e2; ++i) {
36 foo.addSample(i); 36 foo.addSample(i);
37 bar.addSample(i); 37 bar.addSample(i);
38 } 38 }
39 39
40 const span = tr.v.ui.createDiagnosticSpan( 40 const span = tr.v.ui.createDiagnosticSpan(breakdown, '', new tr.v.Histogram(
41 breakdown, new tr.v.Histogram('', tr.b.Unit.byName.timeDurationInMs)); 41 '', tr.b.Unit.byName.timeDurationInMs));
42 assert.strictEqual('TR-V-UI-BREAKDOWN-SPAN', span.tagName); 42 assert.strictEqual('TR-V-UI-BREAKDOWN-SPAN', span.tagName);
43 this.addHTMLOutput(span); 43 this.addHTMLOutput(span);
44 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate( 44 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate(
45 span, e => e.textContent === '9,901.000 ms')); 45 span, e => e.textContent === '9,901.000 ms'));
46 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate( 46 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate(
47 span, e => e.textContent === '4,950.000 ms')); 47 span, e => e.textContent === '4,950.000 ms'));
48 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate( 48 assert.isDefined(tr.ui.b.findDeepElementMatchingPredicate(
49 span, e => e.textContent === '8,000.000 ms')); 49 span, e => e.textContent === '8,000.000 ms'));
50 }); 50 });
51 51
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 breakdown.set('-inf', -Infinity); 114 breakdown.set('-inf', -Infinity);
115 breakdown.set('goose egg', 0); 115 breakdown.set('goose egg', 0);
116 breakdown.set('<0', -1); 116 breakdown.set('<0', -1);
117 117
118 const span = tr.v.ui.createDiagnosticSpan(breakdown); 118 const span = tr.v.ui.createDiagnosticSpan(breakdown);
119 assert.strictEqual('TR-V-UI-BREAKDOWN-SPAN', span.tagName); 119 assert.strictEqual('TR-V-UI-BREAKDOWN-SPAN', span.tagName);
120 this.addHTMLOutput(span); 120 this.addHTMLOutput(span);
121 }); 121 });
122 }); 122 });
123 </script> 123 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698