blob: 8802ff46eeedb8d36ca6ffac0e055474bc9c8e49 [file] [log] [blame]
<!DOCTYPE html>
<!--
Copyright (c) 2015 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="/base/deep_utils.html">
<link rel="import" href="/core/analysis/analysis_view.html">
<link rel="import" href="/core/test_utils.html">
<link rel="import" href="/core/selection.html">
<link rel="import" href="/model/model.html">
<script>
'use strict';
tr.b.unittest.testSuite(function() {
var Selection = tr.c.Selection;
var newSliceEx = tr.c.test_utils.newSliceEx;
test('instantiate', function() {
var slice = newSliceEx({title: 'b', start: 0, duration: 0.002});
var ALERT_INFO_1 = new tr.model.EventInfo(
'Alert 1', 'Critical alert',
[{
label: 'Project Page',
textContent: 'Trace-Viewer Github Project',
href: 'https://github.com/google/trace-viewer/'
}]);
var alert = new tr.model.Alert(ALERT_INFO_1, 5, [slice]);
var selection = new tr.c.Selection();
selection.push(alert);
var subView = document.createElement('tr-c-a-alert-sub-view');
subView.selection = selection;
this.addHTMLOutput(subView);
var table = tr.b.findDeepElementMatching(
subView, 'tr-b-ui-table');
var rows = table.tableRows;
var columns = table.tableColumns;
assert.lengthOf(rows, 4);
assert.lengthOf(columns, 2);
});
});
</script>