OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright 2017 The Chromium Authors. All rights reserved. | 3 Copyright 2017 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/ui/histogram_set_table_row_state.html"> | 8 <link rel="import" href="/tracing/value/ui/histogram_set_table_row_state.html"> |
9 | 9 |
10 <script> | 10 <script> |
11 'use strict'; | 11 'use strict'; |
12 | 12 |
13 tr.b.unittest.testSuite(function() { | 13 tr.b.unittest.testSuite(function() { |
14 test('serialization', function() { | 14 test('serialization', function() { |
15 const rowState = new tr.v.ui.HistogramSetTableRowState(); | 15 const rowState = new tr.v.ui.HistogramSetTableRowState(); |
16 rowState.expanded = true; | 16 rowState.expanded = true; |
17 rowState.overviewChart = true; | 17 rowState.overviewChart = true; |
18 const cellState = new tr.v.ui.HistogramSetTableCellState(); | 18 const cellState = new tr.v.ui.HistogramSetTableCellState(); |
19 rowState.cells.set('A', cellState); | 19 rowState.cells.set('A', cellState); |
20 cellState.isOpen = true; | 20 cellState.isOpen = true; |
21 cellState.brushedBinRange = tr.b.Range.fromExplicitRange(2, 4); | 21 cellState.brushedBinRange = tr.b.math.Range.fromExplicitRange(2, 4); |
22 cellState.mergeSampleDiagnostics = false; | 22 cellState.mergeSampleDiagnostics = false; |
23 | 23 |
24 const clone = rowState.clone(); | 24 const clone = rowState.clone(); |
25 assert.isTrue(clone.expanded); | 25 assert.isTrue(clone.expanded); |
26 assert.isTrue(clone.overviewChart); | 26 assert.isTrue(clone.overviewChart); |
27 assert.isTrue(clone.cells.get('A').isOpen); | 27 assert.isTrue(clone.cells.get('A').isOpen); |
28 assert.strictEqual(2, clone.cells.get('A').brushedBinRange.min); | 28 assert.strictEqual(2, clone.cells.get('A').brushedBinRange.min); |
29 assert.strictEqual(4, clone.cells.get('A').brushedBinRange.max); | 29 assert.strictEqual(4, clone.cells.get('A').brushedBinRange.max); |
30 assert.isFalse(clone.cells.get('A').mergeSampleDiagnostics); | 30 assert.isFalse(clone.cells.get('A').mergeSampleDiagnostics); |
31 }); | 31 }); |
32 }); | 32 }); |
33 </script> | 33 </script> |
OLD | NEW |