Goktug Gokdogan has uploaded a new change for review.

  https://gwt-review.googlesource.com/2781


Change subject: Removes GWTTestCase.supportsAsync.
......................................................................

Removes GWTTestCase.supportsAsync.

GWTTestCase.supportsAsync was just another artifact of Benchmark infra that we recently got rid of.

Change-Id: Ie35e94f8ada80d9e4ae0945199831db6d01cc4a4
---
M tools/api-checker/config/gwt25_26userApi.conf
M user/src/com/google/gwt/junit/client/GWTTestCase.java
M user/super/com/google/gwt/junit/translatable/com/google/gwt/junit/client/GWTTestCase.java
3 files changed, 21 insertions(+), 42 deletions(-)



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();
     }
   }

@@ -235,10 +225,6 @@
         synchronousException = ex;
       }
     }
-  }
-
-  protected boolean supportsAsync() {
-    return true;
   }

   private void assertTestState() {

--
To view, visit https://gwt-review.googlesource.com/2781
To unsubscribe, visit https://gwt-review.googlesource.com/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie35e94f8ada80d9e4ae0945199831db6d01cc4a4
Gerrit-PatchSet: 1
Gerrit-Project: gwt
Gerrit-Branch: master
Gerrit-Owner: Goktug Gokdogan <gok...@google.com>

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors
--- You received this message because you are subscribed to the Google Groups "GWT Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to