Upgrade to HtmlUnit 2.7 build r5424. Removing annotations for fixed HtmlUnit bugs.
Adding annotations for intermittent failures due to threading issues in HtmlUnit with the HtmlUnitDeThread label.


git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@7614 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/dev/build.xml b/dev/build.xml
index 523258b..12e3f27 100755
--- a/dev/build.xml
+++ b/dev/build.xml
@@ -88,8 +88,8 @@
           <include name="apache/commons/commons-io-1.4.jar" />
           <include name="apache/commons/commons-lang-2.4.jar" />
           <include name="cssparser/cssparser-0.9.5.jar" />
-          <include name="htmlunit/htmlunit-r5070.jar" />
-          <include name="htmlunit/htmlunit-core-js-r5070.jar" />
+	  <include name="htmlunit/htmlunit-r5424/htmlunit-r5424.jar" />
+	  <include name="htmlunit/htmlunit-r5424/htmlunit-core-js-r5424.jar" />
           <include name="nekohtml/nekohtml-1.9.13.jar" />
           <include name="xalan/xalan-2.7.1.jar" />
           <include name="xerces/xerces-2_9_1/serializer.jar" />
@@ -144,8 +144,8 @@
           <zipfileset src="${gwt.tools.lib}/apache/commons/commons-io-1.4.jar" />
           <zipfileset src="${gwt.tools.lib}/apache/commons/commons-lang-2.4.jar" />
           <zipfileset src="${gwt.tools.lib}/cssparser/cssparser-0.9.5.jar" />
-          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-r5070.jar" />
-          <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-core-js-r5070.jar" />
+	  <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-r5424/htmlunit-r5424.jar" />
+	  <zipfileset src="${gwt.tools.lib}/htmlunit/htmlunit-r5424/htmlunit-core-js-r5424.jar" />
           <zipfileset src="${gwt.tools.lib}/nekohtml/nekohtml-1.9.13.jar" />
           <zipfileset src="${gwt.tools.lib}/xalan/xalan-2.7.1.jar" />
           <zipfileset src="${gwt.tools.lib}/xerces/xerces-2_9_1/serializer.jar" />
diff --git a/eclipse/dev/.classpath b/eclipse/dev/.classpath
index ce9361a..89b8987 100644
--- a/eclipse/dev/.classpath
+++ b/eclipse/dev/.classpath
@@ -37,8 +37,8 @@
 	<classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/tomcat-jk2-2.1.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/tomcat-util-5.1.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/sun/swingworker/swing-worker-1.1.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070-sources.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5070-sources.jar"/>
+        <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-core-js-r5424.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-core-js-r5424-sources.jar"/>
+        <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-r5424.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-r5424-sources.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/protobuf/protobuf-2.2.0/protobuf-java-rebased-2.2.0.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/eclipse/user/.classpath b/eclipse/user/.classpath
index 7382b12..27d5e69 100644
--- a/eclipse/user/.classpath
+++ b/eclipse/user/.classpath
@@ -29,7 +29,9 @@
 	<classpathentry kind="var" path="GWT_TOOLS/lib/easymock/easymockclassextension.jar"/>
 	<classpathentry kind="var" path="GWT_TOOLS/lib/objectweb/asm-3.1.jar"/>
 	<classpathentry combineaccessrules="false" kind="src" path="/gwt-dev"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5070-sources.jar"/>
-	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-core-js-r5070-sources.jar"/>
+	<classpathentry kind="lib" path="/home/flin/src/flin-gwthead/google3/third_party/java/gwt/tools/source/svn/lib/htmlunit/htmlunit-r5424d/htmlunit-core-js-r5424.jar"/>
+	<classpathentry kind="lib" path="/home/flin/src/flin-gwthead/google3/third_party/java/gwt/tools/source/svn/lib/htmlunit/htmlunit-r5424d/htmlunit-r5424.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-r5424.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-r5424-sources.jar"/>
+	<classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-core-js-r5424.jar" sourcepath="/GWT_TOOLS/lib/htmlunit/htmlunit-r5424/htmlunit-core-js-r5424-sources.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index 669aefd..b1ae899 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -1084,7 +1084,8 @@
     // TODO (amitmanjhi): Remove this hard-coding. A RunStyle somehow needs to
     // specify how it interacts with the platforms.
     return runStyle instanceof RunStyleHtmlUnit
-        && bannedPlatforms.contains(Platform.HtmlUnit);
+        && (bannedPlatforms.contains(Platform.HtmlUnitBug) 
+            || bannedPlatforms.contains(Platform.HtmlUnit));
   }
 
   private boolean mustRetry(int numTries) {
diff --git a/user/src/com/google/gwt/junit/Platform.java b/user/src/com/google/gwt/junit/Platform.java
index fb03bf8..1d53155 100644
--- a/user/src/com/google/gwt/junit/Platform.java
+++ b/user/src/com/google/gwt/junit/Platform.java
@@ -22,5 +22,6 @@
  * between HtmlUnit and non-HtmlUnit platforms.
  */
 public enum Platform {
+  HtmlUnitBug,
   HtmlUnit
 }
diff --git a/user/test/com/google/gwt/core/client/SchedulerTest.java b/user/test/com/google/gwt/core/client/SchedulerTest.java
index 78ac9dd..72928cd 100644
--- a/user/test/com/google/gwt/core/client/SchedulerTest.java
+++ b/user/test/com/google/gwt/core/client/SchedulerTest.java
@@ -16,15 +16,11 @@
 package com.google.gwt.core.client;
 
 import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
 /**
  * This is a black-box test of the Scheduler API.
  */
-@DoNotRunWith(Platform.HtmlUnit)
-// TODO(amitmanjhi) This tickles a devmode HtmlUnit deadlock
 public class SchedulerTest extends GWTTestCase {
 
   private static final int TEST_DELAY = 500000;
diff --git a/user/test/com/google/gwt/core/client/impl/SchedulerImplTest.java b/user/test/com/google/gwt/core/client/impl/SchedulerImplTest.java
index 00fb773..1d86550 100644
--- a/user/test/com/google/gwt/core/client/impl/SchedulerImplTest.java
+++ b/user/test/com/google/gwt/core/client/impl/SchedulerImplTest.java
@@ -84,8 +84,11 @@
     return "com.google.gwt.core.Core";
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
-  // TODO(amitmanjhi) This tickles a devmode HtmlUnit deadlock
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testDeferredCommands() {
     final SchedulerImpl impl = new SchedulerImpl();
 
@@ -154,7 +157,11 @@
     });
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testFixedDelayCommands() {
     final SchedulerImpl impl = new SchedulerImpl();
     final int[] values = {0, 4};
@@ -177,7 +184,6 @@
     delayTestFinish(TEST_DELAY);
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testFixedPeriodCommands() {
     final SchedulerImpl impl = new SchedulerImpl();
     final int[] values = {0, 4};
@@ -200,7 +206,6 @@
     delayTestFinish(TEST_DELAY);
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testIncrementalCommands() {
     final SchedulerImpl impl = new SchedulerImpl();
 
diff --git a/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java b/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java
index 112f129..17dd65c 100644
--- a/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java
+++ b/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java
@@ -29,6 +29,12 @@
  * static so that their names can be reliably determined in web mode.
  */
 public class StackTraceCreatorTest extends GWTTestCase {
+  
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public static void testJavaScriptException() {
     JsArrayString start = sample();
     Throwable t = null;
@@ -64,8 +70,10 @@
 
   /**
    * Just make sure that reentrant behavior doesn't fail.
-   */
-  @DoNotRunWith(value = {Platform.HtmlUnit})
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */  
+  @DoNotRunWith({Platform.HtmlUnit})
   public static void testReentrantCalls() {
     if (!GWT.isScript()) {
       // sample is useless in hosted mode
@@ -82,7 +90,11 @@
     assertEquals(start, end);
   }
 
-  @DoNotRunWith(value = {Platform.HtmlUnit})
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public static void testStackTraces() {
     JsArrayString start = sample();
 
@@ -168,6 +180,11 @@
     return "com.google.gwt.core.Core";
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testExtractName() {
     assertEquals("anonymous",
         StackTraceCreator.extractNameFromToString("function(){}"));
@@ -185,6 +202,11 @@
         StackTraceCreator.extractNameFromToString("  function foo (){}"));
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testChromeExtractName() {
     CollectorChrome c = new CollectorChrome();
 
diff --git a/user/test/com/google/gwt/dev/jjs/test/RunAsyncMetricsIntegrationTest.java b/user/test/com/google/gwt/dev/jjs/test/RunAsyncMetricsIntegrationTest.java
index 97d2dc2..37085f6 100644
--- a/user/test/com/google/gwt/dev/jjs/test/RunAsyncMetricsIntegrationTest.java
+++ b/user/test/com/google/gwt/dev/jjs/test/RunAsyncMetricsIntegrationTest.java
@@ -18,8 +18,6 @@
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.JavaScriptObject;
 import com.google.gwt.core.client.RunAsyncCallback;
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.user.client.Command;
 import com.google.gwt.user.client.DeferredCommand;
@@ -121,7 +119,6 @@
     lwmObserver.uninstall();
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testMetricsSignalled() {
     if (!GWT.isScript()) {
       // There are no runAsync lightweight metrics in hosted mode
diff --git a/user/test/com/google/gwt/dom/client/ElementTest.java b/user/test/com/google/gwt/dom/client/ElementTest.java
index 66d8484..79d17a0 100644
--- a/user/test/com/google/gwt/dom/client/ElementTest.java
+++ b/user/test/com/google/gwt/dom/client/ElementTest.java
@@ -176,7 +176,10 @@
 
   /**
    * getAbsolute[Left|Top|Right|Bottom].
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testGetAbsolutePosition() {
     final int border = 8;
     final int margin = 9;
@@ -228,7 +231,6 @@
   /**
    * scroll[Left|Top], getAbsolute[Left|Top].
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testGetAbsolutePositionWhenBodyScrolled() {
     Document doc = Document.get();
     BodyElement body = doc.getBody();
@@ -385,7 +387,6 @@
   /**
    * offset[Left|Top|Width|Height], offsetParent.
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testOffsets() {
     DivElement outer = Document.get().createDivElement();
     DivElement middle = Document.get().createDivElement();
@@ -471,8 +472,10 @@
 
   /**
    * Tests that scrollLeft behaves as expected in RTL mode.
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2941255&group_id=47038&atid=448266
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testScrollLeftInRtl() {
     final DivElement outer = Document.get().createDivElement();
     final DivElement inner = Document.get().createDivElement();
@@ -533,12 +536,7 @@
 
   /**
    * innerText.
-   *
-   * TODO(amitmanjhi): Remove DoNotRunWith after updating to HtmlUnit-2.7.
    */
-  // TODO (amitmanjhi): Remove annotation after updating HtmlUnit. kprobst says
-  // the issue has been fixed in htmlUnit trunk
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetInnerText() {
     Document doc = Document.get();
 
diff --git a/user/test/com/google/gwt/dom/client/StyleInjectorTest.java b/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
index d885fad..bc14ce8 100644
--- a/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
+++ b/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
@@ -33,7 +33,6 @@
     return "com.google.gwt.dom.DOMTest";
   }
 
-  @DoNotRunWith(value = {Platform.HtmlUnit})
   @SuppressWarnings("deprecation")
   public void testOldMethods() {
     final DivElement elt = Document.get().createDivElement();
@@ -62,7 +61,6 @@
   /**
    * Ensure that the IE createStyleSheet compatibility code is exercised.
    */
-  @DoNotRunWith(value = {Platform.HtmlUnit})
   @SuppressWarnings("deprecation")
   public void testOldMethodsWithLotsOfStyles() {
     StyleElement[] elements = new StyleElement[100];
@@ -94,12 +92,17 @@
     });
   }
 
-  @DoNotRunWith(value = {Platform.HtmlUnit})
+  /*
+   * Tests against issue #879: Ensure that empty history tokens do not add
+   * additional characters after the '#' symbol in the URL.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testStyleInjectorBatched() {
     testStyleInjector("testStyleInjectorBatched", false);
   }
 
-  @DoNotRunWith(value = {Platform.HtmlUnit})
   public void testStyleInjectorImmediate() {
     testStyleInjector("testStyleInjectorImmediate", true);
   }
diff --git a/user/test/com/google/gwt/emultest/java/lang/StringTest.java b/user/test/com/google/gwt/emultest/java/lang/StringTest.java
index fed0ffb..a35e195 100644
--- a/user/test/com/google/gwt/emultest/java/lang/StringTest.java
+++ b/user/test/com/google/gwt/emultest/java/lang/StringTest.java
@@ -15,8 +15,6 @@
  */
 package com.google.gwt.emultest.java.lang;
 
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
 /**
@@ -364,7 +362,6 @@
     assertEquals("ABABAB", testStr.replace('\u1111', 'A'));
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testReplaceAll() {
     String regex = hideFromCompiler("*[").replaceAll(
         "([/\\\\\\.\\*\\+\\?\\|\\(\\)\\[\\]\\{\\}])", "\\\\$1");
@@ -389,7 +386,6 @@
     assertEquals("$$x$", x5.replaceAll("(x)", "\\$\\$$1\\$"));
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testReplaceString() {
     assertEquals("foobar", hideFromCompiler("bazbar").replace("baz", "foo"));
     assertEquals("$0bar", hideFromCompiler("foobar").replace("foo", "$0"));
diff --git a/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java b/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java
index 9e3e0f0..6412a92 100644
--- a/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java
+++ b/user/test/com/google/gwt/emultest/java/util/TreeMapTest.java
@@ -17,6 +17,8 @@
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.core.client.JavaScriptException;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 
 import org.apache.commons.collections.TestMap;
 
@@ -1746,7 +1748,10 @@
 
   /**
    * Test method for 'java.lang.Object.toString()'.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testToString() {
     Map<K, V> map = createMap();
     map.put(getKeys()[0], getValues()[0]);
diff --git a/user/test/com/google/gwt/http/client/RequestBuilderTest.java b/user/test/com/google/gwt/http/client/RequestBuilderTest.java
index 48e27b8..70c7d36 100644
--- a/user/test/com/google/gwt/http/client/RequestBuilderTest.java
+++ b/user/test/com/google/gwt/http/client/RequestBuilderTest.java
@@ -92,7 +92,6 @@
    * <li>url == "www.freebsd.org" - violates same source
    * </ul>
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testRequestBuilderStringString() throws RequestException {
     try {
       new RequestBuilder((RequestBuilder.Method) null, null);
@@ -183,7 +182,7 @@
     testSend(builder, SERVLET_GET_RESPONSE);
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testSend_HEAD() throws RequestException {
     RequestBuilder builder = new RequestBuilder(RequestBuilder.HEAD,
         getTestBaseURL());
@@ -198,7 +197,6 @@
     testSend(builder, SERVLET_POST_RESPONSE);
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testSend_PUT() throws RequestException {
     RequestBuilder builder = new RequestBuilder(RequestBuilder.PUT,
         getTestBaseURL());
@@ -219,7 +217,7 @@
     testSendRequest(builder, null, SERVLET_GET_RESPONSE);
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testSendRequest_HEAD() throws RequestException {
     RequestBuilder builder = new RequestBuilder(RequestBuilder.HEAD,
         getTestBaseURL());
@@ -233,7 +231,6 @@
     testSendRequest(builder, "method=test+request", SERVLET_POST_RESPONSE);
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testSendRequest_PUT() throws RequestException {
     RequestBuilder builder = new RequestBuilder(RequestBuilder.PUT,
         getTestBaseURL());
diff --git a/user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java b/user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java
index 0d0cc69..a9bf26c 100644
--- a/user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java
+++ b/user/test/com/google/gwt/jsonp/client/JsonpRequestTest.java
@@ -175,9 +175,12 @@
         Boolean.TRUE));
   }
 
-
+  /**
+   * Fails in devmode with HtmlUnit, JS "null" exception
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @DoNotRunWith(Platform.HtmlUnit)
-  // Fails in devmode with HtmlUnit, JS "null" exception
   public void testCancel() {
     delayTestFinish(2000);
     // setup a server request that will delay for 500ms
@@ -200,6 +203,11 @@
         new AssertSuccessCallback<String>("A"));
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testDouble() {
     delayTestFinish(RESPONSE_DELAY);
     jsonp.requestDouble(echo("123.456"), new AssertSuccessCallback<Double>(
@@ -213,8 +221,12 @@
         new AssertFailureCallback<String>("ERROR"));
   }
 
+  /**
+   * Hangs indefinitely in devmode with HtmlUnit
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @DoNotRunWith(Platform.HtmlUnit)
-  // Hangs indefinitely in devmode with HtmlUnit
   public void testIds() {
     delayTestFinish(RESPONSE_DELAY);
     JsonpRequest<String> reqA = jsonp.requestString(echo("'A'"),
@@ -263,8 +275,11 @@
     jsonp.requestString(echo("null"), new AssertSuccessCallback<String>(null));
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
-  // Hangs indefinitely in devmode with HtmlUnit
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testOverlapped() {
     delayTestFinish(RESPONSE_DELAY);
     Counter counter = new Counter(3);
diff --git a/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java b/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java
index aa74043..56b94b7 100644
--- a/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java
+++ b/user/test/com/google/gwt/junit/client/GWTTestCaseTest.java
@@ -369,7 +369,7 @@
   /*
    * Just setting the htmlunit mode.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testSetRetry() {
     htmlunitMode = false;
   }
diff --git a/user/test/com/google/gwt/layout/client/LayoutTest.java b/user/test/com/google/gwt/layout/client/LayoutTest.java
index a5136dc..7af5cc1 100644
--- a/user/test/com/google/gwt/layout/client/LayoutTest.java
+++ b/user/test/com/google/gwt/layout/client/LayoutTest.java
@@ -41,7 +41,7 @@
 /**
  * Tests for the {@link Layout} class.
  */
-@DoNotRunWith(Platform.HtmlUnit)
+@DoNotRunWith(Platform.HtmlUnitBug)
 public class LayoutTest extends GWTTestCase {
 
   /**
diff --git a/user/test/com/google/gwt/regexp/shared/RegExpTest.java b/user/test/com/google/gwt/regexp/shared/RegExpTest.java
index 7a5fc85..f084672 100644
--- a/user/test/com/google/gwt/regexp/shared/RegExpTest.java
+++ b/user/test/com/google/gwt/regexp/shared/RegExpTest.java
@@ -522,13 +522,17 @@
     checkReplace("Abc", "\\x", "\\xbc");
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testReplace_dollarReplacement() {
     regExp = RegExp.compile("A+");
     checkReplace("the A stops here", "$$", "the $ stops here");
     checkReplace("the A stops here", "$$$$", "the $$ stops here");
   }
 
+  /**
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2949446&group_id=47038&atid=448266
+   */
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testReplace_doubleDigitGroupReplacement() {
     regExp = RegExp.compile("(1)(2)(3)(4)(5)(6)(7)(8)(9)(a)(b)(c)");
     checkReplace("it's 123456789abc.", "[$11]", "it's [b].");
@@ -564,7 +568,6 @@
     checkReplace("AAA AAA", "x", "x x");
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testReplace_groupAmpersandReplacement() {
     regExp = RegExp.compile("A(B+)A");
     checkReplace("he likes ABBBA", "'$&'", "he likes 'ABBBA'");
@@ -595,7 +598,6 @@
     checkReplace("none here", "x", "none here");
   }
   
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testReplace_unsupportedReplacement() {
     regExp = RegExp.compile("foo");
     checkReplaceThrows("", "$`", true);
diff --git a/user/test/com/google/gwt/resources/client/ImageResourceTest.java b/user/test/com/google/gwt/resources/client/ImageResourceTest.java
index 1b0c31c..018e7ab 100644
--- a/user/test/com/google/gwt/resources/client/ImageResourceTest.java
+++ b/user/test/com/google/gwt/resources/client/ImageResourceTest.java
@@ -20,6 +20,8 @@
 import com.google.gwt.event.dom.client.ErrorHandler;
 import com.google.gwt.event.dom.client.LoadEvent;
 import com.google.gwt.event.dom.client.LoadHandler;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.resources.client.ImageResource.ImageOptions;
 import com.google.gwt.resources.client.ImageResource.RepeatStyle;
@@ -101,6 +103,11 @@
     assertFalse(a.getURL().equals(r.i16x16().getURL()));
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testDedup() {
     Resources r = GWT.create(Resources.class);
 
diff --git a/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java b/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
index e20349a..e149b21 100644
--- a/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
+++ b/user/test/com/google/gwt/uibinder/test/client/UiBinderTest.java
@@ -43,7 +43,7 @@
 /**
  * Functional test of UiBinder.
  */
-@DoNotRunWith({Platform.HtmlUnit})
+@DoNotRunWith({Platform.HtmlUnitBug})
 public class UiBinderTest extends GWTTestCase {
   private WidgetBasedUi widgetUi;
   private DomBasedUi domUi;
@@ -336,7 +336,7 @@
     WidgetBasedUi.Style style();
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testNoOverrideInheritedSharedCssClasses() {
     Bundle bundle = GWT.create(Bundle.class);
     WidgetBasedUi ui = GWT.create(WidgetBasedUi.class);
@@ -462,7 +462,7 @@
     assertNotNull(widgetUi.heartCursorResource.getUrl());
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testCssImportedScopes() {
     assertEquals(100, widgetUi.cssImportScopeSample.inner.getOffsetWidth());
   }
diff --git a/user/test/com/google/gwt/user/client/EventTest.java b/user/test/com/google/gwt/user/client/EventTest.java
index 2e6a953..70e4902 100644
--- a/user/test/com/google/gwt/user/client/EventTest.java
+++ b/user/test/com/google/gwt/user/client/EventTest.java
@@ -33,7 +33,10 @@
 
 /**
  * Test Case for {@link Event}.
+ * Failed intermittently due to threading issues with HtmlUnit.
+ * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
  */
+@DoNotRunWith({Platform.HtmlUnit})
 public class EventTest extends GWTTestCase {
   /**
    * An EventPreview used for testing.
@@ -125,7 +128,10 @@
    * Test that concurrent removal of a {@link NativePreviewHandler} does not
    * trigger an exception. The handler should not actually be removed until the
    * end of the event loop.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testConcurrentRemovalOfNativePreviewHandler() {
     // Add handler0
     final TestNativePreviewHandler handler0 = new TestNativePreviewHandler(
@@ -154,8 +160,10 @@
   /**
    * Test that a double click results in exactly one simulated click event in
    * IE. See issue 3392 for more info.
-   */
-  @DoNotRunWith(Platform.HtmlUnit)
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */  
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testDoubleClickEvent() {
     TestLabel label = new TestLabel();
     RootPanel.get().add(label);
diff --git a/user/test/com/google/gwt/user/client/HistoryDisabledTest.java b/user/test/com/google/gwt/user/client/HistoryDisabledTest.java
index 4b4b138..6f70a11 100644
--- a/user/test/com/google/gwt/user/client/HistoryDisabledTest.java
+++ b/user/test/com/google/gwt/user/client/HistoryDisabledTest.java
@@ -18,6 +18,8 @@
 import com.google.gwt.event.logical.shared.ValueChangeEvent;
 import com.google.gwt.event.logical.shared.ValueChangeHandler;
 import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
 /**
@@ -31,6 +33,11 @@
     return "com.google.gwt.user.HistoryDisabledTest";
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   @SuppressWarnings("deprecation")
   public void testAddHistoryListener() {
     HistoryListener listener = new HistoryListener() {
@@ -41,6 +48,11 @@
     History.removeHistoryListener(listener);
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAddValueChangeHandler() {
     HandlerRegistration reg = History.addValueChangeHandler(new ValueChangeHandler<String>() {
       public void onValueChange(ValueChangeEvent<String> event) {
@@ -49,6 +61,11 @@
     assertNull(reg);
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testFireCurrentHistoryState() {
     HandlerRegistration reg = History.addValueChangeHandler(new ValueChangeHandler<String>() {
       public void onValueChange(ValueChangeEvent<String> event) {
@@ -59,6 +76,11 @@
     History.fireCurrentHistoryState();
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   @SuppressWarnings("deprecation")
   public void testOnHistoryChanged() {
     HandlerRegistration reg = History.addValueChangeHandler(new ValueChangeHandler<String>() {
diff --git a/user/test/com/google/gwt/user/client/WindowTest.java b/user/test/com/google/gwt/user/client/WindowTest.java
index 1e962df..3023677 100644
--- a/user/test/com/google/gwt/user/client/WindowTest.java
+++ b/user/test/com/google/gwt/user/client/WindowTest.java
@@ -189,8 +189,10 @@
   /**
    * Tests the ability of the Window to get the client size correctly with and
    * without visible scroll bars.
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2944261&group_id=47038&atid=448266
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testGetClientSize() {
 
     // NOTE: We must clear the DOM here so that previous tests do not pollute
@@ -348,7 +350,7 @@
   /**
    * Tests the ability of resize the Window and catch resize events.
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testResizing() {
     clearBodyContent();
 
@@ -389,8 +391,10 @@
 
   /**
    * Tests the ability of scroll the Window and catch scroll events.
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2897457&group_id=47038&atid=448266
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testScrolling() {
     // Force scroll bars to appear
     Window.enableScrolling(true);
diff --git a/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTest.java b/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTest.java
index 57a7b3f..44509bc 100644
--- a/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTest.java
+++ b/user/test/com/google/gwt/user/client/rpc/UnicodeEscapingTest.java
@@ -129,7 +129,10 @@
    * equivalent in that case.
    * 
    * @throws InvalidCharacterException
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testClientToServerBMPHigh() throws InvalidCharacterException {
     delayTestFinish(TEST_FINISH_DELAY_MS);
     clientToServerVerifyRange(Character.MAX_SURROGATE + 1,
@@ -151,7 +154,10 @@
    * equivalent in that case.
    * 
    * @throws InvalidCharacterException
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testClientToServerBMPLow() throws InvalidCharacterException {
     delayTestFinish(TEST_FINISH_DELAY_MS);
     clientToServerVerifyRange(Character.MIN_CODE_POINT,
@@ -168,7 +174,10 @@
    * equivalent in that case.
    * 
    * @throws InvalidCharacterException
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testClientToServerNonBMP() throws InvalidCharacterException {
     delayTestFinish(TEST_FINISH_DELAY_MS);
     clientToServerVerifyRange(Character.MIN_SUPPLEMENTARY_CODE_POINT,
@@ -185,7 +194,10 @@
    * issue, particularly with combining marks, though they should be logically
    * equivalent in that case.  Surrogate characters are also not tested here,
    * see {@link #disabled_testServerToClientBMPSurrogates()}.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testServerToClientBMP() {
     delayTestFinish(TEST_FINISH_DELAY_MS);
     serverToClientVerify(Character.MIN_CODE_POINT,
@@ -202,7 +214,7 @@
    * 
    * Note that this does not test all possible combinations.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   // TODO(jat): decide if we really want to specify this behavior since some
   // browsers and OOPHM plugins have issues with it -- disabled for now
   public void disabled_testServerToClientBMPSurrogates() {
diff --git a/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java b/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java
index df0ac9a..cd09ea3 100644
--- a/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java
@@ -37,8 +37,12 @@
     absolutePanel.add(label, 10, 10);
     absolutePanel.add(label, 10, 10);
   }
-  
-  @DoNotRunWith(Platform.HtmlUnit)
+
+  /**
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2892289&group_id=47038&atid=448266
+   */
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testPositioning() {
     // Make an absolute panel with a label at (3, 7).
     AbsolutePanel abs = new AbsolutePanel();
diff --git a/user/test/com/google/gwt/user/client/ui/AnchorTest.java b/user/test/com/google/gwt/user/client/ui/AnchorTest.java
index 076e5aa..b0627a5 100644
--- a/user/test/com/google/gwt/user/client/ui/AnchorTest.java
+++ b/user/test/com/google/gwt/user/client/ui/AnchorTest.java
@@ -19,6 +19,8 @@
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.i18n.client.HasDirection;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.user.client.DOM;
 
@@ -52,6 +54,11 @@
     return "com.google.gwt.user.UserTest";
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testProperties() {
     Anchor anchor = new Anchor("foo", TEST_URL0);
     assertEquals("foo", anchor.getText());
@@ -96,6 +103,11 @@
     }
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testNoAttributes() {
     Anchor anchor = new Anchor();
 
@@ -113,6 +125,11 @@
     }
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testScriptAnchor() {
     Anchor anchor = new Anchor("Foo");
 
@@ -129,6 +146,11 @@
     }
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testScriptAnchorWithHTML() {
     Anchor anchor = new Anchor("<span>Foo</span>", true);
 
@@ -145,6 +167,11 @@
     }
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testEvents() {
     Anchor anchor = new Anchor("Trigger obscure JavaScript things");
 
@@ -166,6 +193,11 @@
     assertEquals(anchor, handler.getLastSender());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testLink() {
     Anchor anchor = new Anchor("Click me!", "http://nowhere.org/");
 
diff --git a/user/test/com/google/gwt/user/client/ui/CreateEventTest.java b/user/test/com/google/gwt/user/client/ui/CreateEventTest.java
index 2619e15..e37c2ed 100644
--- a/user/test/com/google/gwt/user/client/ui/CreateEventTest.java
+++ b/user/test/com/google/gwt/user/client/ui/CreateEventTest.java
@@ -239,7 +239,6 @@
   /**
    * Tests createBlurEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerBlurEvent() {
     NonBubbleAssertingEventListener listener = new NonBubbleAssertingEventListener(
         "blur") {
@@ -273,7 +272,6 @@
   /**
    * Tests createClickEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerClickEvent() {
     BubbleAssertingEventListener listener = new BubbleAssertingEventListener(
         "click") {
@@ -313,7 +311,6 @@
   /**
    * Tests createDblClickEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerDblClickEvent() {
     BubbleAssertingEventListener listener = new BubbleAssertingEventListener(
         "dblclick") {
@@ -343,8 +340,10 @@
 
   /**
    * Tests createErrorEvent().
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2888342&group_id=47038&atid=448266
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testTriggerErrorEvent() {
     ImgEventListener listener = new ImgEventListener("error");
     Event.setEventListener(parent, listener);
@@ -358,7 +357,6 @@
   /**
    * Tests createFocusEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerFocusEvent() {
     NonBubbleAssertingEventListener listener = new NonBubbleAssertingEventListener(
         "focus") {
@@ -378,7 +376,6 @@
   /**
    * Tests createKeyDownEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerKeyDownEvent() {
     KeyEventListener listener = new KeyEventListener("keydown");
     Event.setEventListener(parent, listener);
@@ -394,7 +391,6 @@
   /**
    * Tests createKeyPressEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerKeyPressEvent() {
     KeyEventListener listener = new KeyEventListener("keypress");
     Event.setEventListener(parent, listener);
@@ -410,7 +406,6 @@
   /**
    * Tests createKeyUpEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerKeyUpEvent() {
     KeyEventListener listener = new KeyEventListener("keyup");
     Event.setEventListener(parent, listener);
@@ -439,7 +434,6 @@
   /**
    * Tests createMouseDownEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerMouseDownEvent() {
     MouseEventListener listener = new MouseEventListener("mousedown");
     Event.setEventListener(parent, listener);
@@ -456,7 +450,6 @@
   /**
    * Tests createMouseMoveEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerMouseMoveEvent() {
     MouseEventListener listener = new MouseEventListener("mousemove");
     Event.setEventListener(parent, listener);
@@ -473,7 +466,6 @@
   /**
    * Tests createMouseOutEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerMouseOutEvent() {
     MouseEventListener listener = new MouseEventListener("mouseout") {
       public void onBrowserEvent(Event event) {
@@ -499,7 +491,6 @@
   /**
    * Tests createMouseOverEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerMouseOverEvent() {
     MouseEventListener listener = new MouseEventListener("mouseover") {
       public void onBrowserEvent(Event event) {
@@ -524,7 +515,6 @@
   /**
    * Tests createMouseUpEvent().
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testTriggerMouseUpEvent() {
     MouseEventListener listener = new MouseEventListener("mouseup");
     Event.setEventListener(parent, listener);
diff --git a/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java b/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java
index ebe440b..cd3d939 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java
@@ -35,8 +35,10 @@
   /**
    * Tests {@link DOM#getAbsoluteLeft(Element)} for consistency when the element
    * contains children and has scrollbars.
+   * Failed in all modes due to HtmlUnit bug:
+   * https://sourceforge.net/tracker/?func=detail&aid=2897532&group_id=47038&atid=448266
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testGetAbsolutePositionWhenScrolled() {
     assertTrue(LocaleInfo.getCurrentLocale().isRTL());
     final Element outer = DOM.createDiv();
@@ -69,4 +71,4 @@
     RootPanel.getBodyElement().removeChild(outer);
   }
 
-}
\ No newline at end of file
+}
diff --git a/user/test/com/google/gwt/user/client/ui/DOMTest.java b/user/test/com/google/gwt/user/client/ui/DOMTest.java
index 16ce8cd..fd26bfc 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMTest.java
@@ -119,6 +119,8 @@
   /**
    * Tests {@link DOM#getAbsoluteLeft(Element)} and
    * {@link DOM#getAbsoluteTop(Element)}.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
   @DoNotRunWith(Platform.HtmlUnit)
   public void testGetAbsolutePosition() {
@@ -288,12 +290,7 @@
   /**
    * Tests that {@link DOM#setInnerText(Element, String)} works consistently
    * across browsers.
-   * 
-   * TODO(amitmanjhi): Remove DoNotRunWith after updating to HtmlUnit-2.7.
    */
-  // TODO (amitmanjhi): Remove annotation after updating HtmlUnit. kprobst says
-  // the issue has been fixed in htmlUnit trunk
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetInnerText() {
     Element tableElem = DOM.createTable();
 
diff --git a/user/test/com/google/gwt/user/client/ui/DateBoxTest.java b/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
index f6b2035..cb37907 100644
--- a/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
@@ -30,7 +30,7 @@
     return "com.google.gwt.user.User";
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testAccessors() {
     DateBox db = new DateBox();
     assertFalse(db.isDatePickerShowing());
@@ -40,7 +40,7 @@
     assertFalse(db.isDatePickerShowing());
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testValueChangeEvent() {
 
     // Checks setValue(date, true);
diff --git a/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java b/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java
index 7ec84c2..9edc46d 100644
--- a/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java
@@ -16,8 +16,6 @@
 
 package com.google.gwt.user.client.ui;
 
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 
 /**
  * Test for {@link DeckPanel}.
@@ -81,7 +79,6 @@
    * Test that the offsetHeight/Width of a widget are defined when the widget is
    * added to the DeckPanel.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
   public void testWidgetOffsetDimensionsOnload() {
     DeckPanel deck = new DeckPanel();
     RootPanel.get().add(deck);
diff --git a/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java b/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java
index a5d0211..b6d6ee9 100644
--- a/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java
@@ -35,7 +35,10 @@
 
   /**
    * Test the accessors.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   @Override
   public void testAccessors() {
     super.testAccessors();
@@ -72,7 +75,12 @@
     assertEquals("text", dialogBox.getText());
     assertTrue(dialogBox.getHTML().equalsIgnoreCase("<b>text</b>"));
   }
-  
+
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSimpleCloseButtonOnModalDialog() {
     final DialogBox dialogBox = new DialogBox(false, true);
     Button button = new Button();
@@ -87,6 +95,10 @@
     assertFalse(dialogBox.isShowing());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @DoNotRunWith({Platform.HtmlUnit})
   public void testDebugId() {
     DialogBox dBox = new DialogBox();
@@ -113,7 +125,12 @@
     });
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @Override
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testDependantPopupPanel() {
     // Create the dependent popup
     final PopupPanel dependantPopup = createPopupPanel();
diff --git a/user/test/com/google/gwt/user/client/ui/DockPanelTest.java b/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
index 85bf22b..97edd98 100644
--- a/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DockPanelTest.java
@@ -15,6 +15,8 @@
  */
 package com.google.gwt.user.client.ui;
 
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 import com.google.gwt.user.client.DOM;
 import com.google.gwt.user.client.Element;
@@ -113,6 +115,11 @@
     assertTrue(((DockPanel.LayoutData) l4.getLayoutData()).direction == DockPanel.NORTH);
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAttachDetachOrder() {
     HasWidgetsTester.testAll(new DockPanel(), new Adder(), true);
   }
diff --git a/user/test/com/google/gwt/user/client/ui/FormPanelTest.java b/user/test/com/google/gwt/user/client/ui/FormPanelTest.java
index c576969..eb53fd2 100644
--- a/user/test/com/google/gwt/user/client/ui/FormPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/FormPanelTest.java
@@ -19,6 +19,8 @@
 import com.google.gwt.dom.client.Document;
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.InputElement;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.user.client.Timer;
 import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteEvent;
 import com.google.gwt.user.client.ui.FormPanel.SubmitCompleteHandler;
@@ -29,7 +31,10 @@
  * Tests the FormPanel.
  * 
  * @see com.google.gwt.user.server.ui.FormPanelTestServlet
+ * Failed intermittently due to threading issues with HtmlUnit.
+ * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
  */
+@DoNotRunWith({Platform.HtmlUnit})
 public class FormPanelTest extends SimplePanelTestBase<FormPanel> {
   
   /**
@@ -44,6 +49,11 @@
     return "com.google.gwt.user.FormPanelTest";
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testCancelSubmit() {
     TextBox tb = new TextBox();
     tb.setName("q");
@@ -68,7 +78,10 @@
 
   /**
    * Tests uploading a file using post & multipart encoding.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testFileUpload() {
     final FormPanel form = new FormPanel();
     form.setMethod(FormPanel.METHOD_POST);
@@ -98,7 +111,10 @@
   /**
    * Tests submitting using url-encoded get, with all form widgets (other than
    * FileUpload, which requires post/multipart.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testMethodGet() {
     final FormPanel form = new FormPanel();
     form.setMethod(FormPanel.METHOD_GET);
@@ -163,6 +179,11 @@
     form.submit();
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testNamedTargetSubmitEvent() {
     // Create a form and frame in the document we can wrap.
     String iframeId = Document.get().createUniqueId();
@@ -195,6 +216,11 @@
     Document.get().getElementById("submitBtn").<InputElement>cast().click();
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testReset() {
     FormPanel form = new FormPanel();
     RootPanel.get().add(form);
@@ -207,6 +233,11 @@
     RootPanel.get().remove(form);
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSubmitAndHideDialog() {
     final FormPanel form = new FormPanel();
     form.setMethod(FormPanel.METHOD_GET);
@@ -240,7 +271,10 @@
 
   /**
    * Tests submitting an alternate frame.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSubmitFrame() {
     final NamedFrame frame = new NamedFrame("myFrame");
     FormPanel form = new FormPanel(frame);
@@ -319,6 +353,11 @@
     }
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testWrappedFormWithIFrame() {
     // Create a form and frame in the document we can wrap.
     final Element container = Document.get().createDivElement();
diff --git a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
index fee62ce..8e52c98 100644
--- a/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HTMLPanelTest.java
@@ -17,6 +17,8 @@
 
 import com.google.gwt.dom.client.Element;
 import com.google.gwt.dom.client.Node;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.junit.client.GWTTestCase;
 
 /**
@@ -69,7 +71,10 @@
    * move its element to a hidden div so that getElementById() would work.
    * Unfortunately, we didn't move it back to its original parent, causing
    * a problem in the case described in this test.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAddPartiallyAttached() {
     SimplePanel sp = new SimplePanel();
     HTMLPanel p = new HTMLPanel("<div id='foo'></div>");
@@ -88,7 +93,10 @@
 
   /**
    * Tests child attachment order using {@link HasWidgetsTester}.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAttachDetachOrder() {
     HTMLPanel p = new HTMLPanel("<div id='w00t'></div>");
     HasWidgetsTester.testAll(p, new Adder(), true);
@@ -97,7 +105,10 @@
   /**
    * Ensures that attachToDomAndGetElement() puts the HTMLPanel back exactly
    * where it was in the DOM originally.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAttachDoesntMangleChildOrder() {
     FlowPanel fp = new FlowPanel();
 
@@ -140,6 +151,7 @@
    */
   @SuppressWarnings("deprecation")
   public void testAddAndReplaceElementForUserElement() {
+
     HTMLPanel hp = new HTMLPanel("<div id='parent'>foo<span id='placeholder'></span>bar</div>");
 
     RootPanel.get().add(hp);
@@ -240,3 +252,4 @@
         attachedParentElem, attached.getElement().getParentElement());
   }
 }
+
diff --git a/user/test/com/google/gwt/user/client/ui/HistoryTest.java b/user/test/com/google/gwt/user/client/ui/HistoryTest.java
index 7ea5857..2fb3bd5 100644
--- a/user/test/com/google/gwt/user/client/ui/HistoryTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HistoryTest.java
@@ -94,7 +94,10 @@
   /*
    * Tests against issue #879: Ensure that empty history tokens do not add
    * additional characters after the '#' symbol in the URL.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testEmptyHistoryTokens() {
     delayTestFinish(5000);
 
@@ -122,7 +125,10 @@
 
   /**
    * Verify that no events are issued via newItem if there were not reqeuested.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testNoEvents() {
     delayTestFinish(5000);
     addHistoryListenerImpl(new HistoryListener() {
@@ -264,7 +270,10 @@
    * Test against issue #2500. IE6 has a bug that causes it to not report any
    * part of the current fragment after a '?' when read from location.hash; make
    * sure that on affected browsers, we're not relying on this.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testTokenWithQuestionmark() {
     delayTestFinish(5000);
     final String token = "foo?bar";
@@ -284,8 +293,10 @@
   /**
    * Test that using an empty history token works properly. There have been
    * problems (see issue 2905) with this in the past on Safari.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith(Platform.HtmlUnit)
   public void testEmptyHistoryToken() {
     final ArrayList<Object> counter = new ArrayList<Object>();
 
diff --git a/user/test/com/google/gwt/user/client/ui/ImageTest.java b/user/test/com/google/gwt/user/client/ui/ImageTest.java
index f377754..202f61b 100644
--- a/user/test/com/google/gwt/user/client/ui/ImageTest.java
+++ b/user/test/com/google/gwt/user/client/ui/ImageTest.java
@@ -33,7 +33,7 @@
  * Tests for the Image widget. Images in both clipped mode and unclipped mode
  * are tested, along with the transitions between the two modes.
  */
-@DoNotRunWith({Platform.HtmlUnit})
+@DoNotRunWith({Platform.HtmlUnitBug})
 public class ImageTest extends GWTTestCase {
   interface Bundle extends ClientBundle {
     ImageResource prettyPiccy();
diff --git a/user/test/com/google/gwt/user/client/ui/LayoutPanelTest.java b/user/test/com/google/gwt/user/client/ui/LayoutPanelTest.java
index dab9533..19e9ef3 100644
--- a/user/test/com/google/gwt/user/client/ui/LayoutPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/LayoutPanelTest.java
@@ -16,8 +16,6 @@
 package com.google.gwt.user.client.ui;
 
 import com.google.gwt.dom.client.Style.Unit;
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 import com.google.gwt.layout.client.Layout.AnimationCallback;
 import com.google.gwt.layout.client.Layout.Layer;
 import com.google.gwt.user.client.Command;
@@ -28,7 +26,6 @@
  * behavior, not general layout correctness, which is covered by
  * {@link com.google.gwt.layout.client.LayoutTest}.
  */
-@DoNotRunWith(Platform.HtmlUnit)
 public class LayoutPanelTest extends WidgetTestBase {
 
   /**
diff --git a/user/test/com/google/gwt/user/client/ui/ListBoxTest.java b/user/test/com/google/gwt/user/client/ui/ListBoxTest.java
index a251641..3fe246b 100644
--- a/user/test/com/google/gwt/user/client/ui/ListBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/ListBoxTest.java
@@ -40,7 +40,11 @@
     assertEquals(0, lb.getItemCount());
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testDebugId() {
     ListBox list = new ListBox();
     list.addItem("option0", "value0");
diff --git a/user/test/com/google/gwt/user/client/ui/MenuBarTest.java b/user/test/com/google/gwt/user/client/ui/MenuBarTest.java
index 3567400..058f2df 100644
--- a/user/test/com/google/gwt/user/client/ui/MenuBarTest.java
+++ b/user/test/com/google/gwt/user/client/ui/MenuBarTest.java
@@ -128,6 +128,10 @@
     assertNull(l1.getPopup());
   }
 
+  /*
+   * Failed in all modes with HtmlUnit.
+   */
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testBlur() {
     // Create a menu bar with children.
     final MenuBar menu = new MenuBar();
@@ -145,6 +149,11 @@
     assertNull(menu.getSelectedItem());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testEscapeKey() {
     // Create a menu bar with children.
     MenuBar l0 = new MenuBar();
@@ -272,6 +281,10 @@
     assertNull(bar.getSelectedItem());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @DoNotRunWith({Platform.HtmlUnit})
   public void testDebugId() {
     // Create a sub menu
@@ -343,6 +356,11 @@
     assertNull(bar.getSelectedItem());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testTabKey() {
     // Create a menu bar with children.
     MenuBar l0 = new MenuBar();
diff --git a/user/test/com/google/gwt/user/client/ui/PanelTestBase.java b/user/test/com/google/gwt/user/client/ui/PanelTestBase.java
index 9ebdeb6..b87c82d 100644
--- a/user/test/com/google/gwt/user/client/ui/PanelTestBase.java
+++ b/user/test/com/google/gwt/user/client/ui/PanelTestBase.java
@@ -15,6 +15,9 @@
  */
 package com.google.gwt.user.client.ui;
 
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
+
 /**
  * Base tests for classes that extend {@link Panel}
  * 
@@ -29,6 +32,11 @@
         new HasWidgetsTester.DefaultWidgetAdder(), supportsMultipleWidgets());
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testOnAttach() {
     // Used to call onDetach when not attached.
     Widget someWidget = new TextBox();
@@ -42,6 +50,11 @@
     RootPanel.get().setParent(null);
   }
 
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testRemoveWithError() {
     // Create a widget that will throw an exception onUnload.
     BadWidget badWidget = new BadWidget();
diff --git a/user/test/com/google/gwt/user/client/ui/PopupHistoryDisabledTest.java b/user/test/com/google/gwt/user/client/ui/PopupHistoryDisabledTest.java
index 75c3aab..9e42b22 100644
--- a/user/test/com/google/gwt/user/client/ui/PopupHistoryDisabledTest.java
+++ b/user/test/com/google/gwt/user/client/ui/PopupHistoryDisabledTest.java
@@ -22,7 +22,7 @@
 /**
  * Tests for {@link PopupPanel} when history is disabled.
  */
-@DoNotRunWith(Platform.HtmlUnit)
+@DoNotRunWith(Platform.HtmlUnitBug)
 public class PopupHistoryDisabledTest extends GWTTestCase {
 
   @Override
diff --git a/user/test/com/google/gwt/user/client/ui/PopupTest.java b/user/test/com/google/gwt/user/client/ui/PopupTest.java
index cfe61e0..8277412 100644
--- a/user/test/com/google/gwt/user/client/ui/PopupTest.java
+++ b/user/test/com/google/gwt/user/client/ui/PopupTest.java
@@ -30,7 +30,7 @@
 /**
  * Tests for {@link PopupPanel}.
  */
-@DoNotRunWith(Platform.HtmlUnit)
+@DoNotRunWith({Platform.HtmlUnit})
 public class PopupTest extends GWTTestCase {
 
   /**
@@ -147,8 +147,10 @@
   /**
    * Tests that a large PopupPanel is not positioned off the top or left edges
    * of the browser window, making part of the panel unreachable.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testCenterLargePopup() {
     PopupPanel popup = new PopupPanel();
     popup.setHeight("4096px");
@@ -165,7 +167,10 @@
    * into conflicts with the animations. The {@link MenuBar} exhibits this
    * behavior because, when we detach a {@link MenuBar} from the page, it closes
    * all of its sub menus, each located in a different {@link PopupPanel}.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testDependantPopupPanel() {
     // Create the dependent popup
     final PopupPanel dependantPopup = createPopupPanel();
@@ -304,7 +309,11 @@
     }
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testPopup() {
     // Get rid of window margins so we can test absolute position.
     Window.setMargin("0px");
diff --git a/user/test/com/google/gwt/user/client/ui/RichTextAreaTest.java b/user/test/com/google/gwt/user/client/ui/RichTextAreaTest.java
index cd0a41b..3d3c99e 100644
--- a/user/test/com/google/gwt/user/client/ui/RichTextAreaTest.java
+++ b/user/test/com/google/gwt/user/client/ui/RichTextAreaTest.java
@@ -39,8 +39,10 @@
    * Test that removing and re-adding an RTA doesn't destroy its contents (Only
    * IE actually preserves dynamically-created iframe contents across DOM
    * removal/re-adding).
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testAddEditRemoveAdd() {
     final RichTextArea area = new RichTextArea();
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -89,7 +91,11 @@
     }
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testFormatAfterInitialize() {
     final RichTextArea area = new RichTextArea();
 
@@ -126,7 +132,11 @@
     }
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testFormatWhenHidden() {
     final RichTextArea area = new RichTextArea();
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -148,7 +158,11 @@
   /**
    * See that the custom InitializeEvent fires.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testRichTextInitializeEvent() {
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
     final RichTextArea richTextArea = new RichTextArea();
@@ -163,7 +177,11 @@
   /**
    * Test that a delayed call to setEnable is reflected.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetEnabledAfterInit() {
     final RichTextArea richTextArea = new RichTextArea();
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -183,7 +201,11 @@
    * Test that a call to setEnable is reflected immediately, and after the area
    * loads.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetEnabledBeforeInit() {
     final RichTextArea richTextArea = new RichTextArea();
     richTextArea.setEnabled(false);
@@ -203,7 +225,11 @@
    * Test that a delayed set of HTML is reflected. Some platforms have timing
    * subtleties that need to be tested.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetHTMLAfterInit() {
     final RichTextArea richTextArea = new RichTextArea();    
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -221,7 +247,11 @@
    * Test that an immediate set of HTML is reflected immediately and after the
    * area loads. Some platforms have timing subtleties that need to be tested.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetHTMLBeforeInit() {
     final RichTextArea richTextArea = new RichTextArea();
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -245,7 +275,11 @@
    * Test that delayed set of text is reflected. Some platforms have timing
    * subtleties that need to be tested.
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  /**
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetTextAfterInit() {
     final RichTextArea richTextArea = new RichTextArea();
     delayTestFinish(RICH_TEXT_ASYNC_DELAY);
@@ -262,8 +296,10 @@
   /**
    * Test that an immediate set of text is reflected immediately and after the
    * area loads. Some platforms have timing subtleties that need to be tested.
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith({Platform.HtmlUnit})
   public void testSetTextBeforeInit() {
     final RichTextArea richTextArea = new RichTextArea();
     richTextArea.setText("foo");
diff --git a/user/test/com/google/gwt/user/client/ui/SplitPanelTestBase.java b/user/test/com/google/gwt/user/client/ui/SplitPanelTestBase.java
index 9298e3b..72f0172 100644
--- a/user/test/com/google/gwt/user/client/ui/SplitPanelTestBase.java
+++ b/user/test/com/google/gwt/user/client/ui/SplitPanelTestBase.java
@@ -15,6 +15,8 @@
  */
 package com.google.gwt.user.client.ui;
 
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.user.client.DOM;
 
 /**
@@ -38,6 +40,7 @@
   }
 
   @Override
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testAttachDetachOrder() {
     HasWidgetsTester.testAll(createPanel(),
         new HasWidgetsTester.DefaultWidgetAdder(), false);
@@ -46,6 +49,7 @@
   /**
    * Tests creation, widget assignment, null assignment.
    */
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testSplitPanelCreate() {
     final T panel = createPanel();
     final Widget widgetA = createMockWidget();
diff --git a/user/test/com/google/gwt/user/client/ui/StackPanelTest.java b/user/test/com/google/gwt/user/client/ui/StackPanelTest.java
index b6b30fc..718d7e6 100644
--- a/user/test/com/google/gwt/user/client/ui/StackPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/StackPanelTest.java
@@ -56,7 +56,7 @@
     HasWidgetsTester.testAll(createStackPanel(), new Adder(), true);
   }
 
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith(Platform.HtmlUnitBug)
   public void testDebugId() {
     final StackPanel p = createStackPanel();
     Label a = new Label("a");
diff --git a/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java b/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java
index f168b48..5962d09 100644
--- a/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TabLayoutPanelTest.java
@@ -209,7 +209,7 @@
   /**
    * Tests that tabs actually line up properly (see issue 4447).
    */
-  @DoNotRunWith(Platform.HtmlUnit)
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testTabLayout() {
     TabLayoutPanel p = new TabLayoutPanel(2, Unit.EM);
     RootPanel.get().add(p);
diff --git a/user/test/com/google/gwt/user/client/ui/TextAreaTest.java b/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
index 103f1c4..55cbdb7 100644
--- a/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
@@ -16,8 +16,6 @@
 
 package com.google.gwt.user.client.ui;
 
-import com.google.gwt.junit.DoNotRunWith;
-import com.google.gwt.junit.Platform;
 
 /**
  * Tests a {@link TextArea}.
@@ -30,7 +28,6 @@
    * designed to work on all browsers and verifies that the newlines are
    * accounted for in all browsers.
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testNewline() {
     testNewline("Hello World\r\n\r\n\r\n\r\n\r\n", 15, 6, 15);
     testNewline("Hello\r\n\r\n\r\n\r\nWorld, My name is John.", 7, 3, 15);
diff --git a/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java b/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
index a65c876..95a9f62 100644
--- a/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
+++ b/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
@@ -48,7 +48,6 @@
    * Tests that {@link TextArea#setCursorPos(int)} updates the cursor position
    * correctly.
    */
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testMovingCursor() {
     TextBoxBase area = createTextBoxBase();
     RootPanel.get().add(area);
@@ -99,7 +98,10 @@
     }
   }
   
-  @DoNotRunWith({Platform.HtmlUnit})
+  /**
+   * Failed in all modes due to HtmlUnit bug:
+   */
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testValueChangeEvent() {
     TextBoxBase tb = createTextBoxBase();
     // To work cross-platform, the tb must be added to the root panel.
diff --git a/user/test/com/google/gwt/user/client/ui/TreeItemTest.java b/user/test/com/google/gwt/user/client/ui/TreeItemTest.java
index 679f4c2..3c6b443 100644
--- a/user/test/com/google/gwt/user/client/ui/TreeItemTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TreeItemTest.java
@@ -41,6 +41,10 @@
     assertEquals("Test", widget.getText());
   }
 
+  /*
+   * Failed intermittently due to threading issues with HtmlUnit.
+   * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
+   */
   @DoNotRunWith({Platform.HtmlUnit})
   public void testSetWidgetNullWithError() {
     // Create a widget that will throw an exception onUnload.
diff --git a/user/test/com/google/gwt/user/client/ui/TreeTest.java b/user/test/com/google/gwt/user/client/ui/TreeTest.java
index f6a520f..10c607c 100644
--- a/user/test/com/google/gwt/user/client/ui/TreeTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TreeTest.java
@@ -25,7 +25,10 @@
 
 /**
  * Tests the Tree widget.
+ * Failed intermittently due to threading issues with HtmlUnit.
+ * http://code.google.com/p/google-web-toolkit/issues/detail?id=4496
  */
+@DoNotRunWith({Platform.HtmlUnit})
 public class TreeTest extends GWTTestCase {
 
   static class Adder implements HasWidgetsTester.WidgetAdder {
@@ -39,7 +42,6 @@
     return "com.google.gwt.user.DebugTest";
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
   public void testAttachDetachOrder() {
     HasWidgetsTester.testAll(new Tree(), new Adder(), true);
   }
diff --git a/user/test/com/google/gwt/user/client/ui/VerticalSplitPanelTest.java b/user/test/com/google/gwt/user/client/ui/VerticalSplitPanelTest.java
index 41f24d6..bf0c537 100644
--- a/user/test/com/google/gwt/user/client/ui/VerticalSplitPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/VerticalSplitPanelTest.java
@@ -15,6 +15,8 @@
  */
 package com.google.gwt.user.client.ui;
 
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
 import com.google.gwt.user.client.DOM;
 
 /**
@@ -23,6 +25,7 @@
 public class VerticalSplitPanelTest extends
     SplitPanelTestBase<VerticalSplitPanel> {
 
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testDebugId() {
     VerticalSplitPanel vSplit = new VerticalSplitPanel();
     vSplit.ensureDebugId("vsplit");
diff --git a/user/test/com/google/gwt/user/client/ui/impl/ClippedImagePrototypeTest.java b/user/test/com/google/gwt/user/client/ui/impl/ClippedImagePrototypeTest.java
index 8a69f25..c9c54ba 100644
--- a/user/test/com/google/gwt/user/client/ui/impl/ClippedImagePrototypeTest.java
+++ b/user/test/com/google/gwt/user/client/ui/impl/ClippedImagePrototypeTest.java
@@ -85,7 +85,7 @@
    * 
    * TODO(jlabanca): Enable this test when issue 863 is fixed
    */
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void disabledTestApplyToClippedImage() {
     final Image image = new Image("counting-backwards.png", 12, 13, 8, 8);
 
diff --git a/user/test/com/google/gwt/xml/client/XMLTest.java b/user/test/com/google/gwt/xml/client/XMLTest.java
index afe1121..c10e604 100644
--- a/user/test/com/google/gwt/xml/client/XMLTest.java
+++ b/user/test/com/google/gwt/xml/client/XMLTest.java
@@ -138,7 +138,7 @@
     return "com.google.gwt.xml.XML";
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testAttr() {
     Document d = createTestDocument();
     Element de = d.getDocumentElement();
@@ -150,7 +150,7 @@
     assertEquals(de.getAttributeNode("unset"), null);
   }
 
-  @DoNotRunWith({Platform.HtmlUnit})
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testCreate() {
     Document d = XMLParser.createDocument();
     CDATASection createCDATA;
@@ -206,6 +206,7 @@
     }
   }
 
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testDocument() {
     Document d = createTestDocument();
     NodeList e1Nodes = d.getElementsByTagName("e1");
@@ -370,6 +371,7 @@
     assertEquals(pi.getData(), "other data");
   }
 
+  @DoNotRunWith({Platform.HtmlUnitBug})
   public void testText() {
     Document d = createTestDocument();
     List<Node> textLikeNodes = Arrays.asList(new Node[] {