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

Unified Diff: tracing/tracing/value/ui/histogram_set_view_test.html

Issue 2747453003: Refactor histogram-set-view to an MVC pattern. (Closed)
Patch Set: Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: tracing/tracing/value/ui/histogram_set_view_test.html
diff --git a/tracing/tracing/value/ui/histogram_set_view_test.html b/tracing/tracing/value/ui/histogram_set_view_test.html
index 95d1211fe0f0427ca1cb782a2fe923c4d71f828e..ae6cbdeba091165122430817b569a06a0965d370 100644
--- a/tracing/tracing/value/ui/histogram_set_view_test.html
+++ b/tracing/tracing/value/ui/histogram_set_view_test.html
@@ -7,14 +7,13 @@ found in the LICENSE file.
<link rel="import" href="/tracing/value/histogram.html">
<link rel="import" href="/tracing/value/histogram_set.html">
-<link rel="import" href="/tracing/value/ui/histogram_set_table.html">
<link rel="import" href="/tracing/value/ui/histogram_set_view.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
- test('instantiate0', function() {
+ test('instantiate0', async function() {
let view = document.createElement('tr-v-ui-histogram-set-view');
let histograms = new tr.v.HistogramSet();
@@ -25,7 +24,49 @@ tr.b.unittest.testSuite(function() {
histograms.addHistogram(hist);
this.addHTMLOutput(view);
- view.histograms = histograms;
+ await view.build(histograms);
+
+ assert.strictEqual('none', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.textContent === 'zero Histograms')).display);
+ assert.strictEqual('block', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.id === 'container')).display);
+ });
+
+ test('implicitUndefinedHistogramSet', async function() {
+ const view = document.createElement('tr-v-ui-histogram-set-view');
+ this.addHTMLOutput(view);
+ assert.strictEqual('block', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.textContent === 'zero Histograms')).display);
+ assert.strictEqual('none', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.id === 'container')).display);
+ });
+
+ test('explicitUndefinedHistogramSet', async function() {
+ const view = document.createElement('tr-v-ui-histogram-set-view');
+ this.addHTMLOutput(view);
+ view.build(undefined);
+ assert.strictEqual('block', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.textContent === 'zero Histograms')).display);
+ assert.strictEqual('none', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.id === 'container')).display);
+ });
+
+ test('emptyHistogramSet', async function() {
+ const view = document.createElement('tr-v-ui-histogram-set-view');
+ this.addHTMLOutput(view);
+ view.build(new tr.v.HistogramSet());
+ assert.strictEqual('block', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.textContent === 'zero Histograms')).display);
+ assert.strictEqual('none', getComputedStyle(
+ tr.b.findDeepElementMatchingPredicate(
+ view, e => e.id === 'container')).display);
});
});
</script>
« no previous file with comments | « tracing/tracing/value/ui/histogram_set_view_state.html ('k') | tracing/tracing/value/ui/histogram_span.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698