Chris Craik | 93216d0 | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 1 | <!DOCTYPE html> |
| 2 | <!-- |
| 3 | Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 4 | Use of this source code is governed by a BSD-style license that can be |
| 5 | found 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 | |
| 14 | tv.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 Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 49 | assert.isFalse(m.hasImportWarnings); |
Chris Craik | 93216d0 | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 50 | |
| 51 | var counters = m.getAllCounters(); |
Chris Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 52 | assert.equal(counters.length, 1); |
Chris Craik | 93216d0 | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 53 | |
Chris Craik | f516a62 | 2015-04-01 17:52:39 -0700 | [diff] [blame] | 54 | assert.equal(counters[0].series[0].samples.length, 10); |
Chris Craik | 93216d0 | 2015-03-05 13:58:42 -0800 | [diff] [blame] | 55 | }); |
| 56 | }); |
| 57 | </script> |
| 58 | |