OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <!-- | 2 <!-- |
3 Copyright (c) 2013 The Chromium Authors. All rights reserved. | 3 Copyright (c) 2013 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/core/test_utils.html"> | 8 <link rel="import" href="/tracing/core/test_utils.html"> |
9 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html"> | 9 <link rel="import" href="/tracing/extras/importer/trace_event_importer.html"> |
10 <link rel="import" href="/tracing/importer/import.html"> | 10 <link rel="import" href="/tracing/importer/import.html"> |
(...skipping 214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 var t = m.getOrCreateProcess(1).getOrCreateThread(1); | 225 var t = m.getOrCreateProcess(1).getOrCreateThread(1); |
226 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); | 226 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); |
227 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); | 227 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); |
228 t.sliceGroup.pushSlice(new ThreadSlice('categoryB', 'a', 0, 1, {}, 3)); | 228 t.sliceGroup.pushSlice(new ThreadSlice('categoryB', 'a', 0, 1, {}, 3)); |
229 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); | 229 t.sliceGroup.pushSlice(new ThreadSlice('categoryA', 'a', 0, 1, {}, 3)); |
230 t.sliceGroup.pushSlice(new ThreadSlice('', 'a', 0, 1, {}, 3)); | 230 t.sliceGroup.pushSlice(new ThreadSlice('', 'a', 0, 1, {}, 3)); |
231 m.updateCategories_(); | 231 m.updateCategories_(); |
232 assert.deepEqual(['categoryA', 'categoryB'], m.categories); | 232 assert.deepEqual(['categoryA', 'categoryB'], m.categories); |
233 }); | 233 }); |
234 | 234 |
235 test('model_iterateAllEvents', function() { | |
236 var m = createModelWithOneOfEverything(); | |
237 var wasCalled = false; | |
238 m.iterateAllEvents(function(event) { | |
239 assert.isTrue(event instanceof tr.model.Event); | |
240 wasCalled = true; | |
241 }); | |
242 assert.isTrue(wasCalled); | |
243 }); | |
244 | |
245 test('getEventByStableId', function() { | 235 test('getEventByStableId', function() { |
246 var m = new tr.Model(); | 236 var m = new tr.Model(); |
247 var p = m.getOrCreateProcess(0); | 237 var p = m.getOrCreateProcess(0); |
248 var t = p.getOrCreateThread(1); | 238 var t = p.getOrCreateThread(1); |
249 var slice = tr.c.TestUtils.newSliceEx({start: 0, duration: 10}); | 239 var slice = tr.c.TestUtils.newSliceEx({start: 0, duration: 10}); |
250 t.sliceGroup.pushSlice(slice); | 240 t.sliceGroup.pushSlice(slice); |
251 var ue = tr.c.TestUtils.newInteractionRecord(m, 0, 10); | 241 var ue = tr.c.TestUtils.newInteractionRecord(m, 0, 10); |
252 m.userModel.expectations.push(ue); | 242 m.userModel.expectations.push(ue); |
253 var gie = tr.c.TestUtils.newInstantEvent({ | 243 var gie = tr.c.TestUtils.newInstantEvent({ |
254 title: 'gie', | 244 title: 'gie', |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 scope: typeName, | 332 scope: typeName, |
343 id_ref: '0x1' | 333 id_ref: '0x1' |
344 } | 334 } |
345 }); | 335 }); |
346 m.joinRefs(); | 336 m.joinRefs(); |
347 assert.equal(s1.refCount, 1); | 337 assert.equal(s1.refCount, 1); |
348 assert.equal(s2.refCount, 0); | 338 assert.equal(s2.refCount, 0); |
349 }); | 339 }); |
350 }); | 340 }); |
351 </script> | 341 </script> |
OLD | NEW |