| <!DOCTYPE html> |
| <!-- |
| Copyright (c) 2013 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/multi_thread_time_slice_sub_view.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"> |
| <link rel="import" href="/extras/importer/linux_perf/linux_perf_importer.html"> |
| |
| <script> |
| 'use strict'; |
| |
| tv.b.unittest.testSuite(function() { |
| function createBasicModel() { |
| var lines = [ |
| 'Android.launcher-584 [001] d..3 12622.506890: sched_switch: prev_comm=Android.launcher prev_pid=584 prev_prio=120 prev_state=R+ ==> next_comm=Binder_1 next_pid=217 next_prio=120', // @suppress longLineCheck |
| ' Binder_1-217 [001] d..3 12622.506918: sched_switch: prev_comm=Binder_1 prev_pid=217 prev_prio=120 prev_state=D ==> next_comm=Android.launcher next_pid=584 next_prio=120', // @suppress longLineCheck |
| 'Android.launcher-584 [001] d..4 12622.506936: sched_wakeup: comm=Binder_1 pid=217 prio=120 success=1 target_cpu=001', // @suppress longLineCheck |
| 'Android.launcher-584 [001] d..3 12622.506950: sched_switch: prev_comm=Android.launcher prev_pid=584 prev_prio=120 prev_state=R+ ==> next_comm=Binder_1 next_pid=217 next_prio=120', // @suppress longLineCheck |
| ' Binder_1-217 [001] ...1 12622.507057: tracing_mark_write: B|128|queueBuffer', // @suppress longLineCheck |
| ' Binder_1-217 [001] ...1 12622.507175: tracing_mark_write: E', |
| ' Binder_1-217 [001] d..3 12622.507253: sched_switch: prev_comm=Binder_1 prev_pid=217 prev_prio=120 prev_state=S ==> next_comm=Android.launcher next_pid=584 next_prio=120' // @suppress longLineCheck |
| ]; |
| |
| return new tv.c.TraceModel(lines.join('\n'), false); |
| } |
| |
| test('instantiate', function() { |
| var m = createBasicModel(); |
| |
| var thread = m.findAllThreadsNamed('Binder_1')[0]; |
| |
| var selection = new tv.c.Selection(); |
| selection.push(thread.timeSlices[0]); |
| selection.push(thread.timeSlices[1]); |
| |
| var viewEl = document.createElement( |
| 'tv-c-a-multi-thread-time-slice-sub-view'); |
| viewEl.selection = selection; |
| this.addHTMLOutput(viewEl); |
| }); |
| |
| }); |
| </script> |