blob: 5bed37a7aeb8c10b51130a90245960d6bb286312 [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/test_utils.html">
<link rel="import" href="/core/selection.html">
<link rel="import" href="/core/analysis/analysis_view.html">
<link rel="import" href="/core/analysis/memory_dump_sub_view_test_utils.html">
<script>
'use strict';
tv.b.unittest.testSuite(function() {
var Selection = tv.c.Selection;
var createTestGlobalMemoryDump = tv.c.analysis.createTestGlobalMemoryDump;
test('instantiate', function() {
var globalMemoryDump = createTestGlobalMemoryDump();
var selection = new Selection();
selection.push(globalMemoryDump);
var viewEl = document.createElement(
'tv-c-single-global-memory-dump-sub-view');
viewEl.selection = selection;
this.addHTMLOutput(viewEl);
var overviewPane = tv.b.findDeepElementMatching(
viewEl, 'tv-c-memory-dump-overview-pane');
var detailsPane = tv.b.findDeepElementMatching(
viewEl, 'tv-c-memory-dump-details-pane');
var overviewTable = tv.b.findDeepElementMatching(
overviewPane, 'tracing-analysis-nested-table');
assert.lengthOf(overviewTable.tableRows, 2);
// The details pane should not contain a table (no cell selected).
var detailsTable = tv.b.findDeepElementMatching(
detailsPane, 'tracing-analysis-nested-table');
assert.isUndefined(detailsTable);
overviewTable.selectedTableRow = overviewTable.tableRows[1];
overviewTable.selectedColumnIndex = 4;
assert.lengthOf(overviewTable.tableRows, 2);
// The details pane should now contain a table (oilpan dump of second
// process selected).
detailsTable = tv.b.findDeepElementMatching(
detailsPane, 'tracing-analysis-nested-table');
assert.lengthOf(detailsTable.tableRows, 1);
});
});
</script>