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

Unified Diff: pkg/analyzer/test/generated/test_support.dart

Issue 627133002: Uncomment and clean up engine_test.dart (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: rollback ServerRefactoring change Created 6 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: pkg/analyzer/test/generated/test_support.dart
diff --git a/pkg/analyzer/test/generated/test_support.dart b/pkg/analyzer/test/generated/test_support.dart
index 56c953380363edb3e1b3704f6e7d2219f3845194..7bf0040cb8528952cc22e14995911a055f5c4fdf 100644
--- a/pkg/analyzer/test/generated/test_support.dart
+++ b/pkg/analyzer/test/generated/test_support.dart
@@ -957,10 +957,33 @@ class TestLogger implements Logger {
class TestSource implements Source {
String _name;
String _contents;
+ int modificationStamp = 0;
+ bool exists2 = true;
+
+ /**
+ * A flag indicating whether an exception should be generated when an attempt
+ * is made to access the contents of this source.
+ */
+ bool generateExceptionOnRead = false;
+
+ /**
+ * The number of times that the contents of this source have been requested.
+ */
+ int readCount = 0;
+
TestSource([this._name = '/test.dart', this._contents]);
+
TimestampedData<String> get contents {
+ readCount++;
+ if (generateExceptionOnRead) {
+ throw new Exception("I/O Exception while getting the contents of " + _name);
+ }
return new TimestampedData<String>(0, _contents);
}
+ void setContents(String value) {
+ modificationStamp = new DateTime.now().millisecondsSinceEpoch;
+ _contents = value;
+ }
String get encoding {
throw new UnsupportedOperationException();
}
@@ -971,9 +994,6 @@ class TestSource implements Source {
bool get isInSystemLibrary {
return false;
}
- int get modificationStamp {
- return 0;
- }
String get shortName {
return _name;
}
@@ -983,10 +1003,13 @@ class TestSource implements Source {
UriKind get uriKind {
throw new UnsupportedOperationException();
}
- bool operator ==(Object object) {
- return object is TestSource;
+ bool operator ==(Object other) {
+ if (other is TestSource) {
+ return other._name == _name;
+ }
+ return false;
}
- bool exists() => true;
+ bool exists() => exists2;
void getContentsToReceiver(Source_ContentReceiver receiver) {
throw new UnsupportedOperationException();
}
« pkg/analyzer/lib/src/generated/engine.dart ('K') | « pkg/analyzer/test/generated/resolver_test.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698