blob: e7c30c0a648c5d7c0e6170bf9273886fc830dc55 [file] [log] [blame]
Chris Craik93216d02015-03-05 13:58:42 -08001<!DOCTYPE html>
2<!--
3Copyright (c) 2013 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/test_utils.html">
9<link rel="import" href="/extras/importer/linux_perf/linux_perf_importer.html">
10
11<script>
12'use strict';
13
14tv.b.unittest.testSuite(function() { // @suppress longLineCheck
15 test('clock', function() {
16 var lines = [
17 'cfinteractive-23 [000] d..2 8113.233768: clock_set_rate: ' +
18 'fout_apll state=500000000 cpu_id=0',
19
20 'cfinteractive-23 [000] d..2 8113.249509: clock_set_rate: ' +
21 'fout_apll state=300000000 cpu_id=0',
22
23 'cfinteractive-23 [000] d..2 8113.289796: clock_set_rate: ' +
24 'fout_apll state=400000000 cpu_id=0',
25
26 'cfinteractive-23 [000] d..2 8113.294568: clock_set_rate: ' +
27 'fout_apll state=500000000 cpu_id=0',
28
29 'cfinteractive-23 [000] d..2 8113.309509: clock_set_rate: ' +
30 'fout_apll state=800000000 cpu_id=0',
31
32 'cfinteractive-23 [000] d..2 8113.388732: clock_set_rate: ' +
33 'fout_apll state=200000000 cpu_id=0',
34
35 'cfinteractive-23 [000] d..2 8113.410182: clock_set_rate: ' +
36 'fout_apll state=300000000 cpu_id=0',
37
38 'cfinteractive-23 [000] d..2 8113.414872: clock_set_rate: ' +
39 'fout_apll state=600000000 cpu_id=0',
40
41 'cfinteractive-23 [000] d..2 8113.494455: clock_set_rate: ' +
42 'fout_apll state=200000000 cpu_id=0',
43
44 'cfinteractive-23 [000] d..2 8113.515254: clock_set_rate: ' +
45 'fout_apll state=500000000 cpu_id=0'
46 ];
47
48 var m = new tv.c.TraceModel(lines.join('\n'), false);
Chris Craikf516a622015-04-01 17:52:39 -070049 assert.isFalse(m.hasImportWarnings);
Chris Craik93216d02015-03-05 13:58:42 -080050
51 var counters = m.getAllCounters();
Chris Craikf516a622015-04-01 17:52:39 -070052 assert.equal(counters.length, 1);
Chris Craik93216d02015-03-05 13:58:42 -080053
Chris Craikf516a622015-04-01 17:52:39 -070054 assert.equal(counters[0].series[0].samples.length, 10);
Chris Craik93216d02015-03-05 13:58:42 -080055 });
56});
57</script>
58