blob: 3beea7f0fc45aa277606249b9d46b748e1931b77 [file] [log] [blame]
Chris Craikbeca7ae2015-04-07 13:29:55 -07001<!DOCTYPE html>
2<!--
3Copyright (c) 2013 The Chromium Authors. All rights reserved.
4Use of this source code is governed by a BSD-style license that can be
5found in the LICENSE file.
6-->
7
8<link rel="import" href="/core/analysis/analysis_view.html">
9<link rel="import" href="/core/test_utils.html">
10<link rel="import" href="/core/selection.html">
11<link rel="import" href="/core/trace_model/trace_model.html">
12
13<script>
14'use strict';
15
16tv.b.unittest.testSuite(function() {
Chris Craik44c28202015-05-12 17:25:16 -070017 var TraceModel = tv.c.TraceModel;
Chris Craikbeca7ae2015-04-07 13:29:55 -070018 var Selection = tv.c.Selection;
Chris Craik44c28202015-05-12 17:25:16 -070019 var GlobalMemoryDump = tv.c.trace_model.GlobalMemoryDump;
Chris Craikbeca7ae2015-04-07 13:29:55 -070020
21 test('basic', function() {
22 var m = new tv.c.TraceModel();
Chris Craik44c28202015-05-12 17:25:16 -070023
24 function addGlobalMemoryDump(timestamp) {
25 var gmd = new GlobalMemoryDump(m, timestamp);
26 m.globalMemoryDumps.push(gmd);
27 return gmd;
28 }
29
30 var d1 = addGlobalMemoryDump(5);
31 var d2 = addGlobalMemoryDump(20);
Chris Craikbeca7ae2015-04-07 13:29:55 -070032
33 var selection = new Selection();
34 selection.push(d1);
35 selection.push(d2);
36 assert.equal(selection.length, 2);
37
38 var subView = document.createElement(
39 'tv-c-multi-global-memory-dump-sub-view');
40 subView.selection = selection;
41
42 this.addHTMLOutput(subView);
43 });
44});
45</script>