| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2014 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="/core/side_panel/side_panel.html"> |
| <link rel="import" href="/extras/side_panel/time_summary.html"> |
| <link rel="import" href="/core/side_panel/side_panel_container.html"> |
| <link rel="import" href="/core/trace_model/trace_model.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tv.b.unittest.testSuite(function() { |
| function FakeSelectionController() { |
| this.addAllEventsMatchingFilterToSelectionReturnValue = []; |
| |
| this.viewport = undefined; |
| this.model = undefined; |
| this.selection = new tv.c.Selection(); |
| this.highlight = new tv.c.Selection(); |
| } |
| |
| FakeSelectionController.prototype = { |
| addEventListener: function(name, cb) { |
| } |
| }; |
| |
| function createModel() { |
| var m = new tv.c.TraceModel(); |
| m.importTraces([], false, false, function() { |
| var browserProcess = m.getOrCreateProcess(1); |
| var browserMain = browserProcess.getOrCreateThread(2); |
| browserMain.sliceGroup.beginSlice('cat', 'Task', 0); |
| browserMain.sliceGroup.endSlice(10); |
| browserMain.sliceGroup.beginSlice('cat', 'Task', 20); |
| browserMain.sliceGroup.endSlice(30); |
| }); |
| return m; |
| } |
| |
| test('instantiateCollapsed', function() { |
| var selectionController = new FakeSelectionController(); |
| selectionController.model = createModel(); |
| |
| var container = document.createElement('tv-c-side-panel-container'); |
| container.selectionController = selectionController; |
| this.addHTMLOutput(container); |
| }); |
| }); |
| </script> |