OLD | NEW |
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 // This code was auto-generated, is not intended to be edited, and is subject to | 5 // This code was auto-generated, is not intended to be edited, and is subject to |
6 // significant change. Please see the README file for more information. | 6 // significant change. Please see the README file for more information. |
7 | 7 |
8 library engine.test_support; | 8 library engine.test_support; |
9 | 9 |
10 import 'dart:collection'; | 10 import 'dart:collection'; |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
544 | 544 |
545 @override | 545 @override |
546 void logInformation2(String message, Object exception) { | 546 void logInformation2(String message, Object exception) { |
547 infoCount++; | 547 infoCount++; |
548 } | 548 } |
549 } | 549 } |
550 | 550 |
551 class TestSource extends Source { | 551 class TestSource extends Source { |
552 String _name; | 552 String _name; |
553 String _contents; | 553 String _contents; |
554 int modificationStamp = 0; | 554 int _modificationStamp = 0; |
555 bool exists2 = true; | 555 bool exists2 = true; |
556 | 556 |
557 /** | 557 /** |
558 * A flag indicating whether an exception should be generated when an attempt | 558 * A flag indicating whether an exception should be generated when an attempt |
559 * is made to access the contents of this source. | 559 * is made to access the contents of this source. |
560 */ | 560 */ |
561 bool generateExceptionOnRead = false; | 561 bool generateExceptionOnRead = false; |
562 | 562 |
| 563 @override |
| 564 int get modificationStamp => generateExceptionOnRead ? -1 : _modificationStamp
; |
| 565 |
563 /** | 566 /** |
564 * The number of times that the contents of this source have been requested. | 567 * The number of times that the contents of this source have been requested. |
565 */ | 568 */ |
566 int readCount = 0; | 569 int readCount = 0; |
567 | 570 |
568 TestSource([this._name = '/test.dart', this._contents]); | 571 TestSource([this._name = '/test.dart', this._contents]); |
569 | 572 |
570 TimestampedData<String> get contents { | 573 TimestampedData<String> get contents { |
571 readCount++; | 574 readCount++; |
572 if (generateExceptionOnRead) { | 575 if (generateExceptionOnRead) { |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
604 void getContentsToReceiver(Source_ContentReceiver receiver) { | 607 void getContentsToReceiver(Source_ContentReceiver receiver) { |
605 throw new UnsupportedOperationException(); | 608 throw new UnsupportedOperationException(); |
606 } | 609 } |
607 Source resolve(String uri) { | 610 Source resolve(String uri) { |
608 throw new UnsupportedOperationException(); | 611 throw new UnsupportedOperationException(); |
609 } | 612 } |
610 Uri resolveRelativeUri(Uri uri) { | 613 Uri resolveRelativeUri(Uri uri) { |
611 return new Uri(scheme: 'file', path: _name).resolveUri(uri); | 614 return new Uri(scheme: 'file', path: _name).resolveUri(uri); |
612 } | 615 } |
613 void setContents(String value) { | 616 void setContents(String value) { |
614 modificationStamp = new DateTime.now().millisecondsSinceEpoch; | 617 generateExceptionOnRead = false; |
| 618 _modificationStamp = new DateTime.now().millisecondsSinceEpoch; |
615 _contents = value; | 619 _contents = value; |
616 } | 620 } |
617 @override | 621 @override |
618 String toString() => '$_name'; | 622 String toString() => '$_name'; |
619 } | 623 } |
620 | 624 |
621 class TestSourceWithUri extends TestSource { | 625 class TestSourceWithUri extends TestSource { |
622 final Uri uri; | 626 final Uri uri; |
623 | 627 |
624 TestSourceWithUri(String path, this.uri, [String content]) | 628 TestSourceWithUri(String path, this.uri, [String content]) |
(...skipping 14 matching lines...) Expand all Loading... |
639 if (other is TestSource) { | 643 if (other is TestSource) { |
640 return other.uri == uri; | 644 return other.uri == uri; |
641 } | 645 } |
642 return false; | 646 return false; |
643 } | 647 } |
644 | 648 |
645 Uri resolveRelativeUri(Uri uri) { | 649 Uri resolveRelativeUri(Uri uri) { |
646 return this.uri.resolveUri(uri); | 650 return this.uri.resolveUri(uri); |
647 } | 651 } |
648 } | 652 } |
OLD | NEW |