blob: cb59f9b3468988e306336c29eb3240d47ec3b1d1 [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 createTestProcessMemoryDump = tv.c.analysis.createTestProcessMemoryDump;
test('instantiate', function() {
var processMemoryDump = createTestProcessMemoryDump();
var selection = new Selection();
selection.push(processMemoryDump);
var viewEl = document.createElement(
'tv-c-single-process-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, 1);
// The details pane should not contain a table (no dump selected).
var processTable = tv.b.findDeepElementMatching(
detailsPane, 'tracing-analysis-nested-table');
assert.isUndefined(processTable);
overviewTable.selectedTableRow = overviewTable.tableRows[0];
overviewTable.selectedColumnIndex = 1;
assert.lengthOf(overviewTable.tableRows, 1);
// The details pane should now contain a table (oilpan dump of second
// process selected).
processTable = tv.b.findDeepElementMatching(
detailsPane, 'tracing-analysis-nested-table');
assert.lengthOf(processTable.tableRows, 1);
});
});
</script>