blob: 0ef6bfdf62ec879e6a31b22d5eea67912d8dc464 [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="/core/trace_model/trace_model.html">
<script>
'use strict';
tv.b.unittest.testSuite(function() {
var Selection = tv.c.Selection;
var newSliceEx = tv.c.test_utils.newSliceEx;
test('instantiate', function() {
var slice = newSliceEx({title: 'b', start: 0, duration: 0.002});
var ALERT_INFO_1 = new tv.c.trace_model.EventInfo(
'Alert 1', 'Critical alert', 'https://github.com/google/trace-viewer/');
var alert = new tv.c.trace_model.Alert(ALERT_INFO_1, 5, [slice]);
var selection = new tv.c.Selection();
selection.push(alert);
var subView = document.createElement('tv-c-a-alert-sub-view');
subView.selection = selection;
this.addHTMLOutput(subView);
var table = tv.b.findDeepElementMatching(
subView, 'tracing-analysis-nested-table');
var rows = table.tableRows;
var columns = table.tableColumns;
assert.lengthOf(rows, 4);
assert.lengthOf(columns, 2);
});
});
</script>