| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <!-- | 3 <!-- |
| 4 Copyright (c) 2010 The Chromium Authors. All rights reserved. | 4 Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 5 Use of this source code is governed by a BSD-style license that can be | 5 Use of this source code is governed by a BSD-style license that can be |
| 6 found in the LICENSE file. | 6 found in the LICENSE file. |
| 7 --> | 7 --> |
| 8 <head i18n-values="dir:textdirection;"> | 8 <head i18n-values="dir:textdirection;"> |
| 9 <title>TimelineTrack tests</title> | 9 <title>TimelineTrack tests</title> |
| 10 <script | 10 <script |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 assertEquals(track.slices[1], hits[0]); | 120 assertEquals(track.slices[1], hits[0]); |
| 121 | 121 |
| 122 hits = []; | 122 hits = []; |
| 123 track.pick(6.9, clientRect.top + 5, function(x, y, z) { hits.push(z); }); | 123 track.pick(6.9, clientRect.top + 5, function(x, y, z) { hits.push(z); }); |
| 124 assertEquals(0, hits.length); | 124 assertEquals(0, hits.length); |
| 125 } | 125 } |
| 126 | 126 |
| 127 function testBasicCounter() { | 127 function testBasicCounter() { |
| 128 var testEl = getTestDiv('testBasicCounter'); | 128 var testEl = getTestDiv('testBasicCounter'); |
| 129 | 129 |
| 130 var ctr = new TimelineCounter(undefined, 'testBasicCounter', 'testBasicCount
er'); | 130 var ctr = new TimelineCounter(undefined, |
| 131 'testBasicCounter', 'testBasicCounter'); |
| 131 ctr.numSeries = 1; | 132 ctr.numSeries = 1; |
| 132 ctr.seriesNames = ['value1', 'value2']; | 133 ctr.seriesNames = ['value1', 'value2']; |
| 133 ctr.seriesColors = [tracing.getStringColorId('testBasicCounter.value1'), | 134 ctr.seriesColors = [tracing.getStringColorId('testBasicCounter.value1'), |
| 134 tracing.getStringColorId('testBasicCounter.value2')]; | 135 tracing.getStringColorId('testBasicCounter.value2')]; |
| 135 ctr.timestamps = [0, 1, 2, 3, 4, 5, 6, 7]; | 136 ctr.timestamps = [0, 1, 2, 3, 4, 5, 6, 7]; |
| 136 ctr.samples = [0, 5, | 137 ctr.samples = [0, 5, |
| 137 3, 3, | 138 3, 3, |
| 138 1, 1, | 139 1, 1, |
| 139 2, 1.1, | 140 2, 1.1, |
| 140 3, 0, | 141 3, 0, |
| 141 1, 7, | 142 1, 7, |
| 142 3, 0, | 143 3, 0, |
| 143 3.1, 0.5]; | 144 3.1, 0.5]; |
| 144 ctr.updateBounds(); | 145 ctr.updateBounds(); |
| 145 | 146 |
| 146 var track = TimelineCounterTrack(); | 147 var track = TimelineCounterTrack(); |
| 147 testEl.appendChild(track); | 148 testEl.appendChild(track); |
| 148 track.heading = ctr.name; | 149 track.heading = ctr.name; |
| 149 track.counter = ctr; | 150 track.counter = ctr; |
| 150 track.viewport = new TimelineViewport(testEl); | 151 track.viewport = new TimelineViewport(testEl); |
| 151 track.viewport.setPanAndScale(0, | 152 track.viewport.setPanAndScale(0, |
| 152 track.clientWidth / (1.1 * ctr.maxTimestamp)); | 153 track.clientWidth / (1.1 * ctr.maxTimestamp)); |
| 153 } | 154 } |
| 154 | 155 |
| 155 </script> | 156 </script> |
| 156 </body> | 157 </body> |
| 157 </html> | 158 </html> |
| OLD | NEW |