| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <!-- | 2 <!-- |
| 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 4 Use of this source code is governed by a BSD-style license that can be | 4 Use of this source code is governed by a BSD-style license that can be |
| 5 found in the LICENSE file. | 5 found in the LICENSE file. |
| 6 --> | 6 --> |
| 7 | 7 |
| 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> | 8 <link rel="import" href="/tracing/base/iteration_helpers.html"> |
| 9 <link rel="import" href="/tracing/importer/import.html"> | 9 <link rel="import" href="/tracing/importer/import.html"> |
| 10 <link rel="import" href="/tracing/model/counter.html"> | 10 <link rel="import" href="/tracing/model/counter.html"> |
| 11 <link rel="import" href="/tracing/model/model.html"> | 11 <link rel="import" href="/tracing/model/model.html"> |
| 12 <link rel="import" href="/tracing/model/scoped_id.html"> |
| 12 <link rel="import" href="/tracing/model/slice.html"> | 13 <link rel="import" href="/tracing/model/slice.html"> |
| 13 <link rel="import" href="/tracing/model/slice_group.html"> | 14 <link rel="import" href="/tracing/model/slice_group.html"> |
| 14 <link rel="import" href="/tracing/model/stack_frame.html"> | 15 <link rel="import" href="/tracing/model/stack_frame.html"> |
| 15 <link rel="import" href="/tracing/model/thread_time_slice.html"> | 16 <link rel="import" href="/tracing/model/thread_time_slice.html"> |
| 16 <link rel="import" href="/tracing/model/user_model/stub_expectation.html"> | 17 <link rel="import" href="/tracing/model/user_model/stub_expectation.html"> |
| 17 | 18 |
| 18 <script> | 19 <script> |
| 19 'use strict'; | 20 'use strict'; |
| 20 | 21 |
| 21 /** | 22 /** |
| (...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 var frame = undefined; | 262 var frame = undefined; |
| 262 titles.forEach(function(title) { | 263 titles.forEach(function(title) { |
| 263 frame = new tr.model.StackFrame( | 264 frame = new tr.model.StackFrame( |
| 264 frame, tr.b.GUID.allocateSimple(), title, 7); | 265 frame, tr.b.GUID.allocateSimple(), title, 7); |
| 265 if (model) | 266 if (model) |
| 266 model.addStackFrame(frame); | 267 model.addStackFrame(frame); |
| 267 }); | 268 }); |
| 268 return frame; | 269 return frame; |
| 269 }; | 270 }; |
| 270 | 271 |
| 272 TestUtils.newSnapshot = function(model, options) { |
| 273 return model.getOrCreateProcess(options.pid || 1).objects.addSnapshot( |
| 274 new tr.model.ScopedId(options.scope || tr.model.OBJECT_DEFAULT_SCOPE, |
| 275 options.id || '0x1'), |
| 276 options.category || 'cat', |
| 277 options.name || 'A', |
| 278 options.ts || 0, |
| 279 options.args || {}, |
| 280 options.baseTypeName); |
| 281 }; |
| 282 |
| 271 TestUtils.findSliceNamed = function(slices, name) { | 283 TestUtils.findSliceNamed = function(slices, name) { |
| 272 if (slices instanceof tr.model.SliceGroup) | 284 if (slices instanceof tr.model.SliceGroup) |
| 273 slices = slices.slices; | 285 slices = slices.slices; |
| 274 for (var i = 0; i < slices.length; i++) | 286 for (var i = 0; i < slices.length; i++) |
| 275 if (slices[i].title == name) | 287 if (slices[i].title == name) |
| 276 return slices[i]; | 288 return slices[i]; |
| 277 return undefined; | 289 return undefined; |
| 278 }; | 290 }; |
| 279 | 291 |
| 280 TestUtils.newInteractionRecord = function(parentModel, start, duration) { | 292 TestUtils.newInteractionRecord = function(parentModel, start, duration) { |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 var args = options.args || {}; | 474 var args = options.args || {}; |
| 463 return new tr.model.InstantEvent( | 475 return new tr.model.InstantEvent( |
| 464 category, title, colorId, start, args); | 476 category, title, colorId, start, args); |
| 465 }; | 477 }; |
| 466 | 478 |
| 467 return { | 479 return { |
| 468 TestUtils: TestUtils | 480 TestUtils: TestUtils |
| 469 }; | 481 }; |
| 470 }); | 482 }); |
| 471 </script> | 483 </script> |
| OLD | NEW |