| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Helper functions for use in tracing tests. | 6 * @fileoverview Helper functions for use in tracing tests. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 | 9 |
| 10 /** | 10 /** |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 s.startThread = startThread; | 49 s.startThread = startThread; |
| 50 s.endThread = endThread; | 50 s.endThread = endThread; |
| 51 var subSlice = new tracing.TimelineAsyncSlice(name, 0, start); | 51 var subSlice = new tracing.TimelineAsyncSlice(name, 0, start); |
| 52 subSlice.duration = duration; | 52 subSlice.duration = duration; |
| 53 subSlice.startThread = startThread; | 53 subSlice.startThread = startThread; |
| 54 subSlice.endThread = endThread; | 54 subSlice.endThread = endThread; |
| 55 s.subSlices = [subSlice]; | 55 s.subSlices = [subSlice]; |
| 56 return s; | 56 return s; |
| 57 } | 57 } |
| 58 | 58 |
| 59 function assertArrayishEquals(ref, val) { |
| 60 assertEquals(ref.length, val.length); |
| 61 for (var i = 0; i < ref.length; i++) |
| 62 assertEquals(ref[i], val[i]); |
| 63 } |
| 64 |
| 65 |
| 59 return { | 66 return { |
| 60 getAsync: getAsync, | 67 getAsync: getAsync, |
| 61 newAsyncSlice: newAsyncSlice, | 68 newAsyncSlice: newAsyncSlice, |
| 62 newAsyncSliceNamed: newAsyncSliceNamed | 69 newAsyncSliceNamed: newAsyncSliceNamed, |
| 70 assertArrayishEquals: assertArrayishEquals |
| 63 }; | 71 }; |
| 64 }); | 72 }); |
| OLD | NEW |