| OLD | NEW |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library trace_test; | 5 library trace_test; |
| 6 | 6 |
| 7 import 'dart:io'; | 7 import 'dart:io'; |
| 8 import 'dart:uri'; | 8 import 'dart:uri'; |
| 9 | 9 |
| 10 import 'package:pathos/path.dart' as path; | 10 import 'package:pathos/path.dart' as path; |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 126 #5 bottom (dart:async-patch:9:11) | 126 #5 bottom (dart:async-patch:9:11) |
| 127 '''); | 127 '''); |
| 128 | 128 |
| 129 expect(trace.terse.toString(), equals(''' | 129 expect(trace.terse.toString(), equals(''' |
| 130 foo.dart 42:21 notCore | 130 foo.dart 42:21 notCore |
| 131 dart:core bottom | 131 dart:core bottom |
| 132 bar.dart 10:20 alsoNotCore | 132 bar.dart 10:20 alsoNotCore |
| 133 dart:async bottom | 133 dart:async bottom |
| 134 ''')); | 134 ''')); |
| 135 }); | 135 }); |
| 136 |
| 137 test('.foldFrames folds frames together bottom-up', () { |
| 138 var trace = new Trace.parse(''' |
| 139 #0 notFoo (foo.dart:42:21) |
| 140 #1 fooTop (bar.dart:0:2) |
| 141 #2 fooBottom (foo.dart:1:100) |
| 142 #3 alsoNotFoo (bar.dart:10:20) |
| 143 #4 fooTop (dart:io:5:10) |
| 144 #5 fooBottom (dart:async-patch:9:11) |
| 145 '''); |
| 146 |
| 147 var folded = trace.foldFrames((frame) => frame.member.startsWith('foo')); |
| 148 expect(folded.toString(), equals(''' |
| 149 foo.dart 42:21 notFoo |
| 150 foo.dart 1:100 fooBottom |
| 151 bar.dart 10:20 alsoNotFoo |
| 152 dart:async-patch fooBottom |
| 153 ''')); |
| 154 }); |
| 136 } | 155 } |
| OLD | NEW |