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/model/frame.html"> | 9 <link rel="import" href="/tracing/model/frame.html"> |
10 <link rel="import" href="/tracing/model/global_memory_dump.html"> | 10 <link rel="import" href="/tracing/model/global_memory_dump.html"> |
(...skipping 26 matching lines...) Expand all Loading... |
37 var slice = new tr.model.ThreadSlice('', 'a', 0, 1, {}, 4); | 37 var slice = new tr.model.ThreadSlice('', 'a', 0, 1, {}, 4); |
38 var frame = | 38 var frame = |
39 new tr.model.Frame([slice], [{thread: thread, start: 100, end: 200}]); | 39 new tr.model.Frame([slice], [{thread: thread, start: 100, end: 200}]); |
40 process.frames.push(frame); | 40 process.frames.push(frame); |
41 | 41 |
42 var memoryDump = new tr.model.GlobalMemoryDump(model, 100); | 42 var memoryDump = new tr.model.GlobalMemoryDump(model, 100); |
43 process.memoryDumps.push(memoryDump); | 43 process.memoryDumps.push(memoryDump); |
44 | 44 |
45 var shiftCount = 0; | 45 var shiftCount = 0; |
46 thread.shiftTimestampsForward = function(ts) { | 46 thread.shiftTimestampsForward = function(ts) { |
47 if (ts === 0.32) | 47 if (ts === 0.32) { |
48 shiftCount++; | 48 shiftCount++; |
| 49 } |
49 }; | 50 }; |
50 ctr.shiftTimestampsForward = function(ts) { | 51 ctr.shiftTimestampsForward = function(ts) { |
51 if (ts === 0.32) | 52 if (ts === 0.32) { |
52 shiftCount++; | 53 shiftCount++; |
| 54 } |
53 }; | 55 }; |
54 | 56 |
55 process.shiftTimestampsForward(0.32); | 57 process.shiftTimestampsForward(0.32); |
56 assert.equal(shiftCount, 2); | 58 assert.equal(shiftCount, 2); |
57 assert.equal(instantEvent.start, 100.32); | 59 assert.equal(instantEvent.start, 100.32); |
58 assert.equal(frame.start, 100.32); | 60 assert.equal(frame.start, 100.32); |
59 assert.equal(frame.end, 200.32); | 61 assert.equal(frame.end, 200.32); |
60 assert.equal(memoryDump.start, 100.32); | 62 assert.equal(memoryDump.start, 100.32); |
61 }); | 63 }); |
62 | 64 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 | 118 |
117 var p2 = new tr.model.Process(model, 2); | 119 var p2 = new tr.model.Process(model, 2); |
118 p2.name = 'Renderer'; | 120 p2.name = 'Renderer'; |
119 p2.uptime_seconds = 20; | 121 p2.uptime_seconds = 20; |
120 | 122 |
121 assert.isBelow(p1.compareTo(p2), 0); | 123 assert.isBelow(p1.compareTo(p2), 0); |
122 }); | 124 }); |
123 }); | 125 }); |
124 </script> | 126 </script> |
125 | 127 |
OLD | NEW |