blob: 6d1b0d8be8e73749595b9a75c8d08b57886eeef8 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright 2017 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->
<link rel="import" href="/tracing/value/ui/histogram_set_table_row_state.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
test('serialization', function() {
const rowState = new tr.v.ui.HistogramSetTableRowState();
rowState.expanded = true;
rowState.overviewChart = true;
const cellState = new tr.v.ui.HistogramSetTableCellState();
rowState.cells.set('A', cellState);
cellState.isOpen = true;
cellState.brushedBinRange = tr.b.math.Range.fromExplicitRange(2, 4);
cellState.mergeSampleDiagnostics = false;
const clone = rowState.clone();
assert.isTrue(clone.expanded);
assert.isTrue(clone.overviewChart);
assert.isTrue(clone.cells.get('A').isOpen);
assert.strictEqual(2, clone.cells.get('A').brushedBinRange.min);
assert.strictEqual(4, clone.cells.get('A').brushedBinRange.max);
assert.isFalse(clone.cells.get('A').mergeSampleDiagnostics);
});
});
</script>