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

Side by Side Diff: pkg/analyzer/test/generated/test_support.dart

Issue 1831133005: Consolidate duplicate code for resloving URIs. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Sort Created 4 years, 9 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
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 analyzer.test.generated.test_support; 5 library analyzer.test.generated.test_support;
6 6
7 import 'dart:collection'; 7 import 'dart:collection';
8 8
9 import 'package:analyzer/dart/ast/ast.dart' show AstNode, SimpleIdentifier; 9 import 'package:analyzer/dart/ast/ast.dart' show AstNode, SimpleIdentifier;
10 import 'package:analyzer/dart/element/element.dart'; 10 import 'package:analyzer/dart/element/element.dart';
(...skipping 606 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 617
618 bool exists() => exists2; 618 bool exists() => exists2;
619 void getContentsToReceiver(Source_ContentReceiver receiver) { 619 void getContentsToReceiver(Source_ContentReceiver receiver) {
620 throw new UnsupportedOperationException(); 620 throw new UnsupportedOperationException();
621 } 621 }
622 622
623 Source resolve(String uri) { 623 Source resolve(String uri) {
624 throw new UnsupportedOperationException(); 624 throw new UnsupportedOperationException();
625 } 625 }
626 626
627 Uri resolveRelativeUri(Uri uri) {
628 return new Uri(scheme: 'file', path: _name).resolveUri(uri);
629 }
630
631 void setContents(String value) { 627 void setContents(String value) {
632 generateExceptionOnRead = false; 628 generateExceptionOnRead = false;
633 _modificationStamp = new DateTime.now().millisecondsSinceEpoch; 629 _modificationStamp = new DateTime.now().millisecondsSinceEpoch;
634 _contents = value; 630 _contents = value;
635 } 631 }
636 632
637 @override 633 @override
638 String toString() => '$_name'; 634 String toString() => '$_name';
639 } 635 }
640 636
(...skipping 15 matching lines...) Expand all
656 } 652 }
657 return UriKind.FILE_URI; 653 return UriKind.FILE_URI;
658 } 654 }
659 655
660 bool operator ==(Object other) { 656 bool operator ==(Object other) {
661 if (other is TestSource) { 657 if (other is TestSource) {
662 return other.uri == uri; 658 return other.uri == uri;
663 } 659 }
664 return false; 660 return false;
665 } 661 }
666
667 Uri resolveRelativeUri(Uri uri) {
668 return this.uri.resolveUri(uri);
669 }
670 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698