Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 | Use of this source code is governed by a BSD-style license that can be |
| 5 | found 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 | |
| 16 | tv.b.unittest.testSuite(function() { |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 17 | var TraceModel = tv.c.TraceModel; |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 18 | var Selection = tv.c.Selection; |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 19 | var GlobalMemoryDump = tv.c.trace_model.GlobalMemoryDump; |
Chris Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 20 | |
| 21 | test('basic', function() { |
| 22 | var m = new tv.c.TraceModel(); |
Chris Craik | 44c2820 | 2015-05-12 17:25:16 -0700 | [diff] [blame^] | 23 | |
| 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 Craik | beca7ae | 2015-04-07 13:29:55 -0700 | [diff] [blame] | 32 | |
| 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> |