Home | History | Annotate | Download | only in src
      1 <!DOCTYPE html>
      2 <html>
      3 <!--
      4 Copyright (c) 2012 The Chromium Authors. All rights reserved.
      5 Use of this source code is governed by a BSD-style license that can be
      6 found in the LICENSE file.
      7 -->
      8 <head>
      9 <title>LinuxPerfClockParser tests</title>
     10 <script src="base.js"></script>
     11 </head>
     12 <body>
     13 <script>
     14 'use strict';
     15 
     16 base.require('unittest');
     17 base.require('test_utils');
     18 base.require('linux_perf_importer');
     19 
     20 function testClock() {
     21   var lines = [
     22   'cfinteractive-23    [000] d..2  8113.233768: clock_set_rate: ' + 
     23   'fout_apll state=500000000 cpu_id=0',
     24   
     25   'cfinteractive-23    [000] d..2  8113.249509: clock_set_rate: ' +
     26   'fout_apll state=300000000 cpu_id=0',
     27   
     28   'cfinteractive-23    [000] d..2  8113.289796: clock_set_rate: ' +
     29   'fout_apll state=400000000 cpu_id=0',
     30   
     31   'cfinteractive-23    [000] d..2  8113.294568: clock_set_rate: ' + 
     32   'fout_apll state=500000000 cpu_id=0',
     33   
     34   'cfinteractive-23    [000] d..2  8113.309509: clock_set_rate: ' + 
     35   'fout_apll state=800000000 cpu_id=0',
     36   
     37   'cfinteractive-23    [000] d..2  8113.388732: clock_set_rate: ' +
     38   'fout_apll state=200000000 cpu_id=0',
     39   
     40   'cfinteractive-23    [000] d..2  8113.410182: clock_set_rate: ' +
     41   'fout_apll state=300000000 cpu_id=0',
     42   
     43   'cfinteractive-23    [000] d..2  8113.414872: clock_set_rate: ' +
     44   'fout_apll state=600000000 cpu_id=0',
     45   
     46   'cfinteractive-23    [000] d..2  8113.494455: clock_set_rate: ' +
     47   'fout_apll state=200000000 cpu_id=0',
     48   
     49   'cfinteractive-23    [000] d..2  8113.515254: clock_set_rate: ' +
     50   'fout_apll state=500000000 cpu_id=0',
     51   ];
     52 
     53   var m = new tracing.TimelineModel(lines.join('\n'), false);
     54   assertEquals(0, m.importErrors.length);
     55   console.log(m);
     56 
     57   var counters = m.getAllCounters();
     58   console.log(counters);
     59   assertEquals(1, counters.length);
     60 
     61   assertEquals(10, counters[0].samples.length);
     62 }
     63 
     64 </script>
     65 </body>
     66 </html>