| <!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="/core/analysis/related_flows.html"> |
| <link rel="import" href="/core/test_utils.html"> |
| <link rel="import" href="/core/selection.html"> |
| <link rel="import" href="/core/trace_model/trace_model.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tv.b.unittest.testSuite(function() { |
| var newSliceEx = tv.c.test_utils.newSliceEx; |
| var newFlowEventEx = tv.c.test_utils.newFlowEventEx; |
| |
| test('instantiate', function() { |
| var m = tv.c.test_utils.newModel(function(m) { |
| m.p1 = m.getOrCreateProcess(1); |
| |
| m.t2 = m.p1.getOrCreateThread(2); |
| m.t3 = m.p1.getOrCreateThread(3); |
| m.t4 = m.p1.getOrCreateThread(4); |
| |
| m.sA = m.t2.sliceGroup.pushSlice( |
| newSliceEx({title: 'a', start: 0, end: 5})); |
| m.sB = m.t3.sliceGroup.pushSlice( |
| newSliceEx({title: 'b', start: 10, end: 15})); |
| m.sC = m.t4.sliceGroup.pushSlice( |
| newSliceEx({title: 'c', start: 20, end: 20})); |
| |
| m.t2.createSubSlices(); |
| m.t3.createSubSlices(); |
| m.t4.createSubSlices(); |
| |
| m.f1 = newFlowEventEx({ |
| 'title': 'flowish', start: 0, end: 10, |
| startSlice: m.sA, |
| endSlice: m.sB |
| }); |
| m.f2 = newFlowEventEx({ |
| 'title': 'flowish', start: 15, end: 21, |
| startSlice: m.sB, |
| endSlice: m.sC |
| }); |
| }); |
| |
| var inSel = new tv.c.Selection([m.f1]); |
| var outSel = new tv.c.Selection([m.f2]); |
| |
| var viewEl = document.createElement('tv-c-a-related-flows'); |
| viewEl.setFlows(inSel, outSel); |
| this.addHTMLOutput(viewEl); |
| }); |
| |
| }); |
| </script> |