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

Unified Diff: compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java

Issue 8395013: DartC User Warning Framework (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Use new ErrorCode enums in single onError() method. Created 9 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: compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java
diff --git a/compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java b/compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java
index 694a2de093a72dbbf77630d18aae5ab87d6e03c2..e297ef7d765a19c62671f6f528b458a9bdd8f654 100644
--- a/compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java
+++ b/compiler/javatests/com/google/dart/compiler/common/LibrarySourceFileTest.java
@@ -7,6 +7,7 @@ package com.google.dart.compiler.common;
import com.google.dart.compiler.AbstractSourceFileTest;
import com.google.dart.compiler.DartCompilationError;
import com.google.dart.compiler.DartCompilerListener;
+import com.google.dart.compiler.ErrorSeverity;
import com.google.dart.compiler.LibrarySource;
import com.google.dart.compiler.UrlLibrarySource;
import com.google.dart.compiler.ast.DartUnit;
@@ -96,20 +97,14 @@ public class LibrarySourceFileTest extends AbstractSourceFileTest {
DartCompilerListener listener = new DartCompilerListener() {
@Override
- public void compilationError(DartCompilationError event) {
- throw new RuntimeException(event.getMessage());
- }
-
- @Override
- public void compilationWarning(DartCompilationError event) {
+ public void onError(DartCompilationError event) {
// Ignore warnings when testing.
- }
-
- @Override
- public void typeError(DartCompilationError event) {
+ if (event.getErrorCode().getErrorSeverity() == ErrorSeverity.WARNING) {
+ return;
+ }
+ // Rethrow error.
throw new RuntimeException(event.getMessage());
}
-
@Override
public void unitCompiled(DartUnit unit) {
}

Powered by Google App Engine
This is Rietveld 408576698