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

Unified Diff: dart/tests/compiler/dart2js/compiler_helper.dart

Issue 10879006: Create an outline of metadata API in dart2js. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 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
Index: dart/tests/compiler/dart2js/compiler_helper.dart
diff --git a/dart/tests/compiler/dart2js/compiler_helper.dart b/dart/tests/compiler/dart2js/compiler_helper.dart
index 86d8f1fc46fef2116554ebeaa4dbd740ed1988ad..02d38465a3abad01d99ec15e92c13d20aa77e055 100644
--- a/dart/tests/compiler/dart2js/compiler_helper.dart
+++ b/dart/tests/compiler/dart2js/compiler_helper.dart
@@ -41,7 +41,17 @@ String compileAll(String code) {
return compiler.assembledCode;
}
-lego.Element findElement(var compiler, String name) {
+Dynamic compileAndCheck(String code,
+ String name,
+ check(MockCompiler compiler, lego.Element element)) {
+ Uri uri = new Uri.fromComponents(scheme: 'source');
+ MockCompiler compiler = compilerFor(code, uri);
+ compiler.runCompiler(uri);
+ lego.Element element = findElement(compiler, name);
+ return check(compiler, element);
+}
+
+lego.Element findElement(compiler, String name) {
var element = compiler.mainApp.find(buildSourceString(name));
Expect.isNotNull(element, 'Could not locate $name.');
return element;
« no previous file with comments | « dart/lib/compiler/implementation/scanner/listener.dart ('k') | dart/tests/compiler/dart2js/metadata_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698