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

Side by Side Diff: pkg/docgen/test/single_library_test.dart

Issue 63483002: Fix some users of removed mirror API. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 library single_library_test; 1 library single_library_test;
2 2
3 import 'dart:io'; 3 import 'dart:io';
4 4
5 import 'package:path/path.dart' as path; 5 import 'package:path/path.dart' as path;
6 import 'package:unittest/unittest.dart'; 6 import 'package:unittest/unittest.dart';
7 7
8 import '../lib/docgen.dart'; 8 import '../lib/docgen.dart';
9 9
10 const String DART_LIBRARY = ''' 10 const String DART_LIBRARY = '''
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 108
109 /// Testing fixReference 109 /// Testing fixReference
110 // Testing Doc comment for class [A]. 110 // Testing Doc comment for class [A].
111 var libraryMirror = mirrorSystem.libraries[testLibraryUri]; 111 var libraryMirror = mirrorSystem.libraries[testLibraryUri];
112 var classMirror = libraryMirror.classes.values.first; 112 var classMirror = libraryMirror.classes.values.first;
113 var classDocComment = fixReference('A', libraryMirror, 113 var classDocComment = fixReference('A', libraryMirror,
114 classMirror, null).children.first.text; 114 classMirror, null).children.first.text;
115 expect(classDocComment == 'test.A', isTrue); 115 expect(classDocComment == 'test.A', isTrue);
116 116
117 // Test for linking to parameter [A] 117 // Test for linking to parameter [A]
118 var methodMirror = classMirror.methods['doThis']; 118 var methodMirror = classMirror.declarations['doThis'];
gbracha 2013/11/07 00:09:11 #doThis?
rmacnak 2013/11/07 00:18:29 Actually, undoing this change. These aren't dart:m
119 var methodParameterDocComment = fixReference('A', libraryMirror, 119 var methodParameterDocComment = fixReference('A', libraryMirror,
120 classMirror, methodMirror).children.first.text; 120 classMirror, methodMirror).children.first.text;
121 // TODO(alanknight) : We're not supporting linking to parameters yet 121 // TODO(alanknight) : We're not supporting linking to parameters yet
122 // expect(methodParameterDocComment == 'test.A.doThis#A', isTrue); 122 // expect(methodParameterDocComment == 'test.A.doThis#A', isTrue);
123 123
124 // Testing trying to refer to doThis function 124 // Testing trying to refer to doThis function
125 var methodDocComment = fixReference('doThis', libraryMirror, 125 var methodDocComment = fixReference('doThis', libraryMirror,
126 classMirror, methodMirror).children.first.text; 126 classMirror, methodMirror).children.first.text;
127 expect(methodDocComment == 'test.A.doThis', isTrue); 127 expect(methodDocComment == 'test.A.doThis', isTrue);
128 128
129 // Testing something with no reference 129 // Testing something with no reference
130 var libraryDocComment = fixReference('foobar', libraryMirror, 130 var libraryDocComment = fixReference('foobar', libraryMirror,
131 classMirror, methodMirror).children.first.text; 131 classMirror, methodMirror).children.first.text;
132 expect(libraryDocComment == 'foobar', isTrue); 132 expect(libraryDocComment == 'foobar', isTrue);
133 })).whenComplete(() => temporaryDir.deleteSync(recursive: true)); 133 })).whenComplete(() => temporaryDir.deleteSync(recursive: true));
134 }); 134 });
135 }); 135 });
136 } 136 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698