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="/perf_insights/mre/mre_result.html"> | 8 <link rel="import" href="/perf_insights/mre/mre_result.html"> |
9 <link rel="import" href="/tracing/core/test_utils.html"> | 9 <link rel="import" href="/tracing/core/test_utils.html"> |
10 <link rel="import" href="/tracing/extras/chrome/chrome_test_utils.html"> | 10 <link rel="import" href="/tracing/extras/chrome/chrome_test_utils.html"> |
(...skipping 23 matching lines...) Expand all Loading... |
34 m.otherProcessMain.sliceGroup.pushSlice(test_utils.newSliceEx({ | 34 m.otherProcessMain.sliceGroup.pushSlice(test_utils.newSliceEx({ |
35 name: 'RendererSlice', | 35 name: 'RendererSlice', |
36 start: 0, duration: 10 | 36 start: 0, duration: 10 |
37 })); | 37 })); |
38 }); | 38 }); |
39 | 39 |
40 var tg = new pi.m.ThreadGrouping(); | 40 var tg = new pi.m.ThreadGrouping(); |
41 tg.autoInitUsingHelpers(m); | 41 tg.autoInitUsingHelpers(m); |
42 | 42 |
43 var allSlices = new tr.model.EventSet(); | 43 var allSlices = new tr.model.EventSet(); |
44 m.iterateAllEvents(function(e) { | 44 for (var e of m.getDescendantEvents()) |
45 if (e instanceof tr.model.Slice) | 45 if (e instanceof tr.model.Slice) |
46 allSlices.push(e); | 46 allSlices.push(e); |
47 }); | |
48 var groups = tg.divideEventSetIntoSubGroups(allSlices); | 47 var groups = tg.divideEventSetIntoSubGroups(allSlices); |
49 var numGrouped = 0; | 48 var numGrouped = 0; |
50 tr.b.iterItems(groups, function(groupName, eventSet) { | 49 tr.b.iterItems(groups, function(groupName, eventSet) { |
51 numGrouped += eventSet.length; | 50 numGrouped += eventSet.length; |
52 }); | 51 }); |
53 assert.equal(numGrouped, allSlices.length); | 52 assert.equal(numGrouped, allSlices.length); |
54 assert.equal(groups.Browser.length, 1); | 53 assert.equal(groups.Browser.length, 1); |
55 assert.equal(groups.Renderer.length, 1); | 54 assert.equal(groups.Renderer.length, 1); |
56 assert.equal(groups.Other.length, 1); | 55 assert.equal(groups.Other.length, 1); |
57 }); | 56 }); |
58 }); | 57 }); |
59 </script> | 58 </script> |
OLD | NEW |