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

Unified Diff: dart/tests/try/poi/serialize_test.dart

Issue 463323003: Fix crash due to AbstractFieldElement.computeType. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Merged with r39363. Created 6 years, 4 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
« no previous file with comments | « dart/tests/try/poi/data/abstract_field.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: dart/tests/try/poi/serialize_test.dart
diff --git a/dart/tests/try/poi/serialize_test.dart b/dart/tests/try/poi/serialize_test.dart
index 731a4b14f3a2b04b21d7302816b201785fa96afb..06b11c382ca9bf55ff2544e588594f7507fa1b10 100644
--- a/dart/tests/try/poi/serialize_test.dart
+++ b/dart/tests/try/poi/serialize_test.dart
@@ -61,6 +61,26 @@ Future testSubclass(FormattingDiagnosticHandler handler) {
String scope = poi.scopeInformation(element, position);
Expect.stringEquals(
JSON.encode(expectedSubclass), JSON.encode(JSON.decode(scope)), scope);
+
+ return testAbstractField(handler);
+ });
+}
+
+Future testAbstractField(FormattingDiagnosticHandler handler) {
+ int position = 321;
+
+ Uri script = Platform.script.resolve('data/abstract_field.dart');
+
+ Future future = poi.runPoi(script, position, handler.provider, handler);
+ return future.then((Element element) {
+ Uri foundScript = element.compilationUnit.script.resourceUri;
+ Expect.stringEquals('$script', '$foundScript');
+ Expect.stringEquals('method', element.name);
+
+ String scope = poi.scopeInformation(element, position);
+ Expect.stringEquals(
+ JSON.encode(expectedAbstractField), JSON.encode(JSON.decode(scope)),
+ scope);
});
}
@@ -242,6 +262,69 @@ final expectedSubclass = {
}
};
+final expectedAbstractField = {
+ "name": "method",
+ "kind": "function",
+ "type": "() -> dynamic",
+ "enclosing": {
+ "name": "A",
+ "kind": "class side",
+ "members": [
+ {
+ "kind": "generative_constructor",
+ "type": "() -> A"
+ }
+ ],
+ "enclosing": {
+ "name": "A",
+ "kind": "instance side",
+ "members": [
+ {
+ "name": "foo",
+ "kind": "getter"
+ },
+ {
+ "name": "foo",
+ "kind": "setter"
+ },
+ {
+ "name": "method",
+ "kind": "function",
+ "type": "() -> dynamic"
+ }
+ ],
+ "enclosing": {
+ "name": "abstract_field",
+ "kind": "library",
+ "members": [
+ {
+ "name": "A",
+ "kind": "class"
+ },
+ {
+ "name": "bar",
+ "kind": "getter"
+ },
+ {
+ "name": "bar",
+ "kind": "getter"
+ },
+ {
+ "name": "main",
+ "kind": "function",
+ "type": "() -> dynamic"
+ }
+ ],
+ "enclosing": {
+ "kind": "imports",
+ "members": coreImports,
+ "enclosing": object
+ },
+ },
+ },
+ },
+};
+
final coreImports = [
{
"name": "Deprecated",
« no previous file with comments | « dart/tests/try/poi/data/abstract_field.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698