blob: bfe28224c67ddb5bf10c8b3691907137cd660b55 [file] [log] [blame]
Chris Craik93216d02015-03-05 13:58:42 -08001<!DOCTYPE html>
2<!--
3Copyright (c) 2014 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/side_panel/side_panel.html">
Chris Craikf516a622015-04-01 17:52:39 -07009<link rel="import" href="/extras/side_panel/time_summary.html">
Chris Craik93216d02015-03-05 13:58:42 -080010<link rel="import" href="/core/side_panel/side_panel_container.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 function FakeSelectionController() {
18 this.addAllEventsMatchingFilterToSelectionReturnValue = [];
19
20 this.viewport = undefined;
21 this.model = undefined;
22 this.selection = new tv.c.Selection();
23 this.highlight = new tv.c.Selection();
24 }
25
26 FakeSelectionController.prototype = {
27 addEventListener: function(name, cb) {
28 }
29 };
30
Chris Craik93216d02015-03-05 13:58:42 -080031 function createModel() {
32 var m = new tv.c.TraceModel();
33 m.importTraces([], false, false, function() {
34 var browserProcess = m.getOrCreateProcess(1);
35 var browserMain = browserProcess.getOrCreateThread(2);
36 browserMain.sliceGroup.beginSlice('cat', 'Task', 0);
37 browserMain.sliceGroup.endSlice(10);
38 browserMain.sliceGroup.beginSlice('cat', 'Task', 20);
39 browserMain.sliceGroup.endSlice(30);
40 });
41 return m;
42 }
43
Chris Craikf516a622015-04-01 17:52:39 -070044 test('instantiateCollapsed', function() {
Chris Craik44c28202015-05-12 17:25:16 -070045 var selectionController = new FakeSelectionController();
46 selectionController.model = createModel();
47
Chris Craikf516a622015-04-01 17:52:39 -070048 var container = document.createElement('tv-c-side-panel-container');
Chris Craik44c28202015-05-12 17:25:16 -070049 container.selectionController = selectionController;
Chris Craik93216d02015-03-05 13:58:42 -080050 this.addHTMLOutput(container);
51 });
Chris Craik93216d02015-03-05 13:58:42 -080052});
53</script>