Removes GWTTestCase.supportsAsync.
GWTTestCase.supportsAsync was just another artifact of Benchmark infra that we recently got rid of.
Change-Id: Ie35e94f8ada80d9e4ae0945199831db6d01cc4a4
diff --git a/tools/api-checker/config/gwt25_26userApi.conf b/tools/api-checker/config/gwt25_26userApi.conf
index c2e5f4f..6c2261a 100644
--- a/tools/api-checker/config/gwt25_26userApi.conf
+++ b/tools/api-checker/config/gwt25_26userApi.conf
@@ -150,6 +150,7 @@
# Removed deprecated benchmark infra
com.google.gwt.benchmarks.client MISSING
+com.google.gwt.junit.client.GWTTestCase::supportsAsync() MISSING
# Split BaseListenerWrapper
com.google.gwt.user.client.BaseListenerWrapper::getSource(Lcom/google/gwt/event/shared/GwtEvent;) MISSING
diff --git a/user/src/com/google/gwt/junit/client/GWTTestCase.java b/user/src/com/google/gwt/junit/client/GWTTestCase.java
index 4f88df7..b4deab1 100644
--- a/user/src/com/google/gwt/junit/client/GWTTestCase.java
+++ b/user/src/com/google/gwt/junit/client/GWTTestCase.java
@@ -435,14 +435,6 @@
}
/**
- * Returns true if this test case supports asynchronous mode. By default, this
- * is set to true.
- */
- protected boolean supportsAsync() {
- return true;
- }
-
- /**
* This method has been made final to prevent you from accidentally running
* client code outside of the GWT environment. Please override
* {@link #gwtTearDown()} instead.
diff --git a/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java b/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
index 56464a5..9fdaa9f 100644
--- a/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
+++ b/user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
@@ -156,43 +156,33 @@
}
protected final void delayTestFinish(int timeoutMillis) {
- if (supportsAsync()) {
- if (timer != null) {
- // Cancel the pending timer
- timer.cancel();
- }
-
- // Set a new timer for the specified new timeout
- timer = new KillTimer(timeoutMillis);
- } else {
- throw new UnsupportedOperationException(
- "This test case does not support asynchronous mode.");
+ if (timer != null) {
+ // Cancel the pending timer
+ timer.cancel();
}
+
+ // Set a new timer for the specified new timeout
+ timer = new KillTimer(timeoutMillis);
}
protected final void finishTest() {
- if (supportsAsync()) {
- if (testIsFinished) {
- // This test is totally done already, just ignore the call.
- return;
- }
+ if (testIsFinished) {
+ // This test is totally done already, just ignore the call.
+ return;
+ }
- if (timer == null) {
- throw new IllegalStateException(
- "This test is not in asynchronous mode; call delayTestFinish() first");
- }
+ if (timer == null) {
+ throw new IllegalStateException(
+ "This test is not in asynchronous mode; call delayTestFinish() first");
+ }
- if (mainTestHasRun) {
- // This is a correct, successful async finish.
- reportResultsAndRunNextMethod(null);
- } else {
- // The user tried to finish the test before the main body returned!
- // Just let the test continue running normally.
- resetAsyncState();
- }
+ if (mainTestHasRun) {
+ // This is a correct, successful async finish.
+ reportResultsAndRunNextMethod(null);
} else {
- throw new UnsupportedOperationException(
- "This test case does not support asynchronous mode.");
+ // The user tried to finish the test before the main body returned!
+ // Just let the test continue running normally.
+ resetAsyncState();
}
}
@@ -237,10 +227,6 @@
}
}
- protected boolean supportsAsync() {
- return true;
- }
-
private void assertTestState() {
// TODO(goktug): Add assertTestState to other calls (e.g. delayTestFinish)
// TODO(goktug): Report any problems via GWTRunner.