Home | History | Annotate | Download | only in tracks
      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 i18n-values="dir:textdirection;">
      9 <title>Track tests</title>
     10 <style>
     11 .container {
     12   border: 1px solid red;
     13 }
     14 </style>
     15 <script src="/src/base.js"></script>
     16 <script>
     17   base.require('unittest');
     18   base.require('test_utils');
     19   base.require('timeline_track_view');
     20   base.require('model');
     21 </script>
     22 </head>
     23 <body>
     24 <script>
     25   'use strict';
     26 
     27   var Cpu = tracing.model.Cpu;
     28   var CpuTrack = tracing.tracks.CpuTrack;
     29   var Slice = tracing.model.Slice;
     30   var Viewport = tracing.TimelineViewport;
     31 
     32   function testBasicCpu() {
     33     var testEl = this.addHTMLOutput();
     34 
     35     var cpu = new Cpu(7);
     36     cpu.slices = [
     37       new Slice('', 'a', 0, 1, {}, 1),
     38       new Slice('', 'b', 1, 2.1, {}, 4.8)
     39     ];
     40     cpu.updateBounds();
     41 
     42     var track = CpuTrack();
     43     testEl.appendChild(track);
     44     track.heading = 'CPU ' + cpu.cpuNumber;
     45     track.cpu = cpu;
     46     track.viewport = new Viewport(testEl);
     47     track.viewport.xSetWorldBounds(0, 11.1, track.clientWidth);
     48   }
     49 
     50 </script>
     51 </body>
     52 </html>
     53