Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1)

Side by Side Diff: test/frame_test.dart

Issue 1320393003: Improve the display of data: URIs in stack traces. (Closed) Base URL: git@github.com:dart-lang/stack_trace@master
Patch Set: Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 frame_test; 5 library frame_test;
6 6
7 import 'package:path/path.dart' as path; 7 import 'package:path/path.dart' as path;
8 import 'package:stack_trace/stack_trace.dart'; 8 import 'package:stack_trace/stack_trace.dart';
9 import 'package:test/test.dart'; 9 import 'package:test/test.dart';
10 10
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 equals('dart:async/future.dart')); 496 equals('dart:async/future.dart'));
497 expect(new Frame.parseVM('#0 Foo ' 497 expect(new Frame.parseVM('#0 Foo '
498 '(http://dartlang.org/stuff/thing.dart:0:0)').library, 498 '(http://dartlang.org/stuff/thing.dart:0:0)').library,
499 equals('http://dartlang.org/stuff/thing.dart')); 499 equals('http://dartlang.org/stuff/thing.dart'));
500 }); 500 });
501 501
502 test('returns the relative path for file URIs', () { 502 test('returns the relative path for file URIs', () {
503 expect(new Frame.parseVM('#0 Foo (foo/bar.dart:0:0)').library, 503 expect(new Frame.parseVM('#0 Foo (foo/bar.dart:0:0)').library,
504 equals(path.join('foo', 'bar.dart'))); 504 equals(path.join('foo', 'bar.dart')));
505 }); 505 });
506
507 test('truncates data: URIs', () {
508 var frame = new Frame.parseVM(
509 '#0 Foo (data:application/dart;charset=utf-8,blah:0:0)');
510 expect(frame.library, equals('data:...'));
511 });
506 }); 512 });
507 513
508 group('.location', () { 514 group('.location', () {
509 test('returns the library and line/column numbers for non-core ' 515 test('returns the library and line/column numbers for non-core '
510 'libraries', () { 516 'libraries', () {
511 expect(new Frame.parseVM('#0 Foo ' 517 expect(new Frame.parseVM('#0 Foo '
512 '(http://dartlang.org/thing.dart:5:10)').location, 518 '(http://dartlang.org/thing.dart:5:10)').location,
513 equals('http://dartlang.org/thing.dart 5:10')); 519 equals('http://dartlang.org/thing.dart 5:10'));
514 expect(new Frame.parseVM('#0 Foo (foo/bar.dart:1:2)').location, 520 expect(new Frame.parseVM('#0 Foo (foo/bar.dart:1:2)').location,
515 equals('${path.join('foo', 'bar.dart')} 1:2')); 521 equals('${path.join('foo', 'bar.dart')} 1:2'));
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
558 equals('$relative 5:10 in Foo')); 564 equals('$relative 5:10 in Foo'));
559 }); 565 });
560 }); 566 });
561 } 567 }
562 568
563 void expectIsUnparsed(Frame constructor(String text), String text) { 569 void expectIsUnparsed(Frame constructor(String text), String text) {
564 var frame = constructor(text); 570 var frame = constructor(text);
565 expect(frame, new isInstanceOf<UnparsedFrame>()); 571 expect(frame, new isInstanceOf<UnparsedFrame>());
566 expect(frame.toString(), equals(text)); 572 expect(frame.toString(), equals(text));
567 } 573 }
OLDNEW
« no previous file with comments | « pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698