This patch enables running web tests using HtmlUnit. Since not all tests,
particularly layout tests, can run successfully on HtmlUnit, the patch
introduces an annotation @DoNotRunWith. Test methods or classes marked with the
annotation are not run on the platforms specified in the annotation's argument.
There is an additional build target test.web.htmlunit that runs web tests using
HtmlUnit's emulation of FF3. All tests pass currently.
Patch by: amitmanjhi
Review by: scottb,jat
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@5844 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/eclipse/user/.classpath b/eclipse/user/.classpath
index 3f063b0..ac1ea2e 100644
--- a/eclipse/user/.classpath
+++ b/eclipse/user/.classpath
@@ -7,7 +7,21 @@
<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2.jar" sourcepath="/GWT_TOOLS/lib/apache/tapestry-util-text-4.0.2-src.zip"/>
<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/junit/junit-3.8.1.jar" sourcepath="/GWT_TOOLS/lib/junit/junit-3.8.1-src.zip"/>
<classpathentry exported="true" kind="var" path="GWT_TOOLS/lib/tomcat/servlet-api-2.5.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-codec-1.3.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/commons-collections-3.1.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-httpclient-3.1.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-lang-2.4.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/tomcat/commons-logging-1.0.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/apache/commons/commons-io-1.4.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/cssparser/cssparser-0.9.5.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-2.5.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/htmlunit/htmlunit-core-js-2.5.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/nekohtml/nekohtml-1.9.12.jar" />
<classpathentry kind="var" path="GWT_TOOLS/lib/selenium/selenium-java-client-driver.jar"/>
+ <classpathentry kind="var" path="GWT_TOOLS/lib/xalan/xalan-2.7.1.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/xerces/serializer-2.7.1.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xercesImpl-2.8.1.jar" />
+ <classpathentry kind="var" path="GWT_TOOLS/lib/xerces/xml-apis-1.3.04.jar" />
<classpathentry kind="var" path="GWT_TOOLS/lib/w3c/sac/sac-1.3.jar"/>
<classpathentry kind="var" path="GWT_TOOLS/lib/w3c/flute/flute-1.3.jar"/>
<classpathentry combineaccessrules="false" kind="src" path="/gwt-dev-windows"/>
diff --git a/user/build.xml b/user/build.xml
index 7c68dbd..ab524f4 100755
--- a/user/build.xml
+++ b/user/build.xml
@@ -45,6 +45,26 @@
<pathelement location="test_i18n_${gwt.i18n.test.InnerClassChar}" />
</path>
+ <!--
+ Classpaths added for htmlunit libs
+ -->
+ <path id="htmlunit.libs">
+ <pathelement location="${gwt.tools.lib}/apache/commons/commons-codec-1.3.jar" />
+ <pathelement location="${gwt.tools.lib}/tomcat/commons-collections-3.1.jar" />
+ <pathelement location="${gwt.tools.lib}/apache/commons/commons-httpclient-3.1.jar" />
+ <pathelement location="${gwt.tools.lib}/apache/commons/commons-io-1.4.jar" />
+ <pathelement location="${gwt.tools.lib}/apache/commons/commons-lang-2.4.jar" />
+ <pathelement location="${gwt.tools.lib}/tomcat/commons-logging-1.1.jar" />
+ <pathelement location="${gwt.tools.lib}/cssparser/cssparser-0.9.5.jar" />
+ <pathelement location="${gwt.tools.lib}/htmlunit/htmlunit-2.5.jar" />
+ <pathelement location="${gwt.tools.lib}/htmlunit/htmlunit-core-js-2.5.jar" />
+ <pathelement location="${gwt.tools.lib}/nekohtml/nekohtml-1.9.12.jar" />
+ <pathelement location="${gwt.tools.lib}/xalan/xalan-2.7.1.jar" />
+ <pathelement location="${gwt.tools.lib}/xerces/serializer-2.7.1.jar" />
+ <pathelement location="${gwt.tools.lib}/xerces/xercesImpl-2.8.1.jar" />
+ <pathelement location="${gwt.tools.lib}/xerces/xml-apis-1.3.04.jar" />
+ <pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
+ </path>
<!-- Platform shouldn't matter here, just picking one -->
<property.ensure name="gwt.dev.jar" location="${gwt.build.lib}/gwt-dev-${build.host.platform}.jar" />
@@ -59,6 +79,7 @@
<pathelement location="${gwt.tools.lib}/w3c/sac/sac-1.3.jar" />
<pathelement location="${gwt.tools.lib}/w3c/flute/flute-1.3.jar" />
<pathelement location="${gwt.dev.jar}" />
+ <path refid="htmlunit.libs" />
</classpath>
</gwt.javac>
@@ -85,6 +106,7 @@
<pathelement location="${gwt.tools.lib}/junit/junit-3.8.1.jar" />
<pathelement location="${gwt.tools.lib}/selenium/selenium-java-client-driver.jar" />
<pathelement location="${gwt.dev.jar}" />
+ <path refid="htmlunit.libs" />
</classpath>
</gwt.javac>
</target>
@@ -168,6 +190,16 @@
</gwt.junit>
</target>
+ <target name="test.web.htmlunit" depends="compile, compile.tests" description="Run htmlunit web-mode tests for this project.">
+ <!-- TODO: add more browsers later -->
+ <gwt.junit test.args="${test.args} -htmlunit FF3" test.out="${junit.out}/${build.host.platform}-htmlunit-web-mode" test.cases="default.web.tests" >
+ <extraclasspaths>
+ <path refid="test.extraclasspath" />
+ <path refid="htmlunit.libs" />
+ </extraclasspaths>
+ </gwt.junit>
+ </target>
+
<target name="test.web.disableClassMetadata" depends="compile, compile.tests" description="Run only web-mode tests for this project.">
<gwt.junit test.args="${test.args} -XdisableClassMetadata -out www -web -batch module" test.out="${junit.out}/${build.host.platform}-web-mode-disableClassMetadata" test.cases="default.web.tests" >
<extraclasspaths>
@@ -202,6 +234,7 @@
<antcall target="test.noserver"/>
<antcall target="test.web"/>
<antcall target="test.web.disableClassMetadata"/>
+ <antcall target="test.web.htmlunit"/>
<antcall target="test.web.draft"/>
</parallel>
</limit>
diff --git a/user/src/com/google/gwt/junit/DoNotRunWith.java b/user/src/com/google/gwt/junit/DoNotRunWith.java
new file mode 100644
index 0000000..b0e6811
--- /dev/null
+++ b/user/src/com/google/gwt/junit/DoNotRunWith.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.junit;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * When a test method is annotated with DoNotRunWith, it is _not_ executed on
+ * the specified platforms. We chose DoNotRunWith instead of RunWith because we
+ * want each exception to be listed separately here.
+ *
+ * TODO(amitmanjhi): Make this work with batching of test cases.
+ *
+ * <pre>
+ * @DoNotRunWith({HtmlUnit})
+ * public class EmulSuite {
+ * }
+ * </pre>
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ElementType.TYPE,ElementType.METHOD})
+@Inherited
+public @interface DoNotRunWith {
+ Platform[] value();
+}
diff --git a/user/src/com/google/gwt/junit/JUnitShell.java b/user/src/com/google/gwt/junit/JUnitShell.java
index a87a55b..9ab5c7a 100644
--- a/user/src/com/google/gwt/junit/JUnitShell.java
+++ b/user/src/com/google/gwt/junit/JUnitShell.java
@@ -43,9 +43,13 @@
import junit.framework.TestCase;
import junit.framework.TestResult;
+import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.EnumSet;
import java.util.HashMap;
import java.util.Map;
+import java.util.Set;
import java.util.Map.Entry;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
@@ -212,6 +216,37 @@
registerHandler(new ArgHandlerString() {
@Override
public String getPurpose() {
+ return "Runs web mode via HTMLUnit given a list of browsers; "
+ + "e.g. " + RunStyleHtmlUnit.getBrowserList();
+ }
+
+ @Override
+ public String getTag() {
+ return "-htmlunit";
+ }
+
+ @Override
+ public String[] getTagArgs() {
+ return new String[] {"browserNames"};
+ }
+
+ @Override
+ public boolean setString(String str) {
+ String[] targets = str.split(",");
+ try {
+ runStyle = new RunStyleHtmlUnit(JUnitShell.this, targets);
+ numClients = ((RunStyleHtmlUnit) runStyle).numBrowsers();
+ return true;
+ } catch (IllegalArgumentException ex) {
+ System.err.println(ex.getMessage());
+ return false;
+ }
+ }
+ });
+
+ registerHandler(new ArgHandlerString() {
+ @Override
+ public String getPurpose() {
return "Run external browsers in web mode (pass a comma separated list of executables.)";
}
@@ -662,21 +697,66 @@
}
}
- void compileForWebMode(String moduleName, String userAgentString)
+ void compileForWebMode(String moduleName, String... userAgents)
throws UnableToCompleteException {
// Never fresh during JUnit.
ModuleDef module = ModuleDefLoader.loadFromClassPath(getTopLogger(),
moduleName, false);
- if (userAgentString != null) {
+ if (userAgents != null && userAgents.length > 0) {
Properties props = module.getProperties();
Property userAgent = props.find("user.agent");
if (userAgent instanceof BindingProperty) {
- ((BindingProperty) userAgent).setAllowedValues(userAgentString);
+ ((BindingProperty) userAgent).setAllowedValues(userAgents);
}
}
super.compile(getTopLogger(), module);
}
+ /**
+ * returns the set of banned {@code Platform} for a test method.
+ */
+ private Set<Platform> getBannedPlatforms(TestCase testCase) {
+ Class<?> testClass = testCase.getClass();
+ Set<Platform> bannedSet = EnumSet.noneOf(Platform.class);
+ if (testClass.isAnnotationPresent(DoNotRunWith.class)) {
+ bannedSet.addAll(Arrays.asList(testClass.getAnnotation(DoNotRunWith.class).value()));
+ }
+ try {
+ Method testMethod = testClass.getMethod(testCase.getName());
+ if (testMethod.isAnnotationPresent(DoNotRunWith.class)) {
+ bannedSet.addAll(Arrays.asList(testMethod.getAnnotation(
+ DoNotRunWith.class).value()));
+ }
+ } catch (SecurityException e) {
+ // should not happen
+ e.printStackTrace();
+ } catch (NoSuchMethodException e) {
+ // should not happen
+ e.printStackTrace();
+ }
+ return bannedSet;
+ }
+
+ private boolean mostNotExecuteTest(Set<Platform> bannedPlatforms) {
+ // 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);
+ }
+
+ /**
+ * Checks if a testCase should not be executed. Currently, a test is either
+ * executed on all clients (mentioned in this test) or on no clients.
+ *
+ * @param testCase current testCase.
+ * @return true iff the test should not be executed on any of the specified
+ * clients.
+ */
+ private boolean mustNotExecuteTest(TestCase testCase) {
+ // TODO: collect stats on tests that were not run
+ return mostNotExecuteTest(getBannedPlatforms(testCase));
+ }
+
private void processTestResult(TestInfo testInfo, TestCase testCase,
TestResult testResult, Strategy strategy) {
@@ -727,6 +807,10 @@
TestResult testResult, Strategy strategy)
throws UnableToCompleteException {
+ if (mustNotExecuteTest(testCase)) {
+ return;
+ }
+
if (lastLaunchFailed) {
throw new UnableToCompleteException();
}
diff --git a/user/src/com/google/gwt/junit/Platform.java b/user/src/com/google/gwt/junit/Platform.java
new file mode 100644
index 0000000..3928b65
--- /dev/null
+++ b/user/src/com/google/gwt/junit/Platform.java
@@ -0,0 +1,26 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.junit;
+
+/**
+ * An enum to indicate the Platform where a test should run. In general, it
+ * should be able to represent a large matrix such as: Browser * Os_combo *
+ * {hosted, web} * {htmlunit, actual_browser}. For now, we just distinguish
+ * between Htmlunit and non-Htmlunit platforms.
+ */
+public enum Platform {
+ Htmlunit
+}
diff --git a/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java b/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java
new file mode 100644
index 0000000..f58906d
--- /dev/null
+++ b/user/src/com/google/gwt/junit/RunStyleHtmlUnit.java
@@ -0,0 +1,214 @@
+/*
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not
+ * use this file except in compliance with the License. You may obtain a copy of
+ * the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations under
+ * the License.
+ */
+package com.google.gwt.junit;
+
+import com.google.gwt.core.ext.TreeLogger;
+import com.google.gwt.core.ext.UnableToCompleteException;
+
+import com.gargoylesoftware.htmlunit.AlertHandler;
+import com.gargoylesoftware.htmlunit.BrowserVersion;
+import com.gargoylesoftware.htmlunit.FailingHttpStatusCodeException;
+import com.gargoylesoftware.htmlunit.IncorrectnessListener;
+import com.gargoylesoftware.htmlunit.OnbeforeunloadHandler;
+import com.gargoylesoftware.htmlunit.Page;
+import com.gargoylesoftware.htmlunit.WebClient;
+import com.gargoylesoftware.htmlunit.html.HtmlPage;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+/**
+ * Launches a web-mode test via HTMLUnit.
+ */
+public class RunStyleHtmlUnit extends RunStyleRemote {
+
+ /**
+ * Runs HTMLUnit in a separate thread.
+ */
+ protected static class HtmlUnitThread extends Thread implements AlertHandler,
+ IncorrectnessListener, OnbeforeunloadHandler {
+
+ private final BrowserVersion browser;
+ private final String url;
+ private Object waitForUnload = new Object();
+ private final TreeLogger treeLogger;
+
+ public HtmlUnitThread(BrowserVersion browser, String url,
+ TreeLogger treeLogger) {
+ this.browser = browser;
+ this.url = url;
+ this.treeLogger = treeLogger;
+ }
+
+ public void handleAlert(Page page, String message) {
+ treeLogger.log(TreeLogger.ERROR, "Alert: " + message);
+ }
+
+ public boolean handleEvent(Page page, String returnValue) {
+ synchronized (waitForUnload) {
+ waitForUnload.notifyAll();
+ }
+ return true;
+ }
+
+ public void notify(String message, Object origin) {
+ if ("Obsolete content type encountered: 'text/javascript'.".equals(message)) {
+ // silently eat warning about text/javascript MIME type
+ return;
+ }
+ treeLogger.log(TreeLogger.WARN, message);
+ }
+
+ @Override
+ public void run() {
+ WebClient webClient = new WebClient(browser);
+ webClient.setAlertHandler(this);
+ webClient.setIncorrectnessListener(this);
+ webClient.setThrowExceptionOnFailingStatusCode(false);
+ webClient.setThrowExceptionOnScriptError(true);
+ webClient.setOnbeforeunloadHandler(this);
+ setupWebClient(webClient);
+ try {
+ Page page = webClient.getPage(url);
+ // TODO(jat): is this necessary?
+ webClient.waitForBackgroundJavaScriptStartingBefore(2000);
+ page.getEnclosingWindow().getJobManager().waitForJobs(60000);
+ treeLogger.log(TreeLogger.DEBUG, "getPage returned "
+ + ((HtmlPage) page).asXml());
+ } catch (FailingHttpStatusCodeException e) {
+ treeLogger.log(TreeLogger.ERROR, "HTTP request failed", e);
+ return;
+ } catch (MalformedURLException e) {
+ treeLogger.log(TreeLogger.ERROR, "Bad URL", e);
+ return;
+ } catch (IOException e) {
+ treeLogger.log(TreeLogger.ERROR, "I/O error on HTTP request", e);
+ return;
+ }
+ }
+
+ /**
+ * Additional setup of the WebClient before starting test. Hook necessary
+ * for plugging in HtmlUnitHosted.
+ */
+ protected void setupWebClient(WebClient webClient) {
+ }
+ }
+
+ private static final Map<String, BrowserVersion> BROWSER_MAP = createBrowserMap();
+
+ /**
+ * Returns the list of browsers Htmlunit emulates as a comma separated string.
+ */
+ static String getBrowserList() {
+ StringBuffer sb = new StringBuffer();
+ for (String str : BROWSER_MAP.keySet()) {
+ sb.append(str);
+ sb.append(",");
+ }
+ if (sb.length() > 1) {
+ return sb.substring(0, sb.length() - 1);
+ }
+ return sb.toString();
+ }
+
+ private static Map<String, BrowserVersion> createBrowserMap() {
+ Map<String, BrowserVersion> browserMap = new HashMap<String, BrowserVersion>();
+ for (BrowserVersion browser : new BrowserVersion[] {
+ BrowserVersion.FIREFOX_2, BrowserVersion.FIREFOX_3,
+ BrowserVersion.INTERNET_EXPLORER_6, BrowserVersion.INTERNET_EXPLORER_7}) {
+ browserMap.put(browser.getNickname(), browser);
+ }
+ return Collections.unmodifiableMap(browserMap);
+ }
+
+ private final Set<BrowserVersion> browsers;
+ private final List<Thread> threads = new ArrayList<Thread>();
+
+ /**
+ * Create a RunStyle instance with the passed-in browser targets.
+ */
+ public RunStyleHtmlUnit(JUnitShell shell, String[] targetsIn) {
+ super(shell);
+ this.browsers = getBrowserSet(targetsIn);
+ }
+
+ @Override
+ public void launchModule(String moduleName) {
+ for (BrowserVersion browser : browsers) {
+ String url = getMyUrl(moduleName);
+ HtmlUnitThread hut = createHtmlUnitThread(browser, url);
+ shell.getTopLogger().log(TreeLogger.INFO,
+ "Starting " + url + " on browser " + browser.getNickname());
+ /*
+ * TODO (amitmanjhi): Is it worth pausing here and waiting for the main
+ * test thread to get to an "okay" state.
+ */
+ hut.start();
+ threads.add(hut);
+ }
+ }
+
+ @Override
+ public void maybeCompileModule(String moduleName)
+ throws UnableToCompleteException {
+ shell.compileForWebMode(moduleName, getUserAgents());
+ }
+
+ public int numBrowsers() {
+ return browsers.size();
+ }
+
+ protected HtmlUnitThread createHtmlUnitThread(BrowserVersion browser,
+ String url) {
+ return new HtmlUnitThread(browser, url, shell.getTopLogger());
+ }
+
+ private Set<BrowserVersion> getBrowserSet(String[] targetsIn) {
+ Set<BrowserVersion> browserSet = new HashSet<BrowserVersion>();
+ for (String browserName : targetsIn) {
+ BrowserVersion browser = BROWSER_MAP.get(browserName);
+ if (browser == null) {
+ throw new IllegalArgumentException("Expected browser name: one of "
+ + BROWSER_MAP.keySet() + ", actual name: " + browserName);
+ }
+ browserSet.add(browser);
+ }
+ return Collections.unmodifiableSet(browserSet);
+ }
+
+ private String[] getUserAgents() {
+ Map<BrowserVersion, String> userAgentMap = new HashMap<BrowserVersion, String>();
+ userAgentMap.put(BrowserVersion.FIREFOX_2, "gecko1_8");
+ userAgentMap.put(BrowserVersion.FIREFOX_3, "gecko");
+ userAgentMap.put(BrowserVersion.INTERNET_EXPLORER_6, "ie6");
+ userAgentMap.put(BrowserVersion.INTERNET_EXPLORER_7, "ie6");
+
+ String userAgents[] = new String[numBrowsers()];
+ int index = 0;
+ for (BrowserVersion browser : browsers) {
+ userAgents[index++] = userAgentMap.get(browser);
+ }
+ return userAgents;
+ }
+}
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 25545ba..9083605 100644
--- a/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java
+++ b/user/test/com/google/gwt/core/client/impl/StackTraceCreatorTest.java
@@ -19,6 +19,8 @@
import com.google.gwt.core.client.JavaScriptException;
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsArrayString;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
/**
@@ -62,6 +64,7 @@
/**
* Just make sure that reentrant behavior doesn't fail.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public static void testReentrantCalls() {
if (!GWT.isScript()) {
// sample is useless in hosted mode
@@ -78,6 +81,7 @@
assertEquals(start, end);
}
+ @DoNotRunWith({Platform.Htmlunit})
public static void testStackTraces() {
JsArrayString start = sample();
diff --git a/user/test/com/google/gwt/dom/client/ElementTest.java b/user/test/com/google/gwt/dom/client/ElementTest.java
index 5c8ab14..6d19163 100644
--- a/user/test/com/google/gwt/dom/client/ElementTest.java
+++ b/user/test/com/google/gwt/dom/client/ElementTest.java
@@ -18,6 +18,8 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.dom.client.Style.Position;
import com.google.gwt.dom.client.Style.Unit;
+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;
@@ -216,6 +218,7 @@
/**
* scroll[Left|Top], getAbsolute[Left|Top].
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetAbsolutePositionWhenBodyScrolled() {
Document doc = Document.get();
BodyElement body = doc.getBody();
@@ -372,6 +375,7 @@
/**
* offset[Left|Top|Width|Height], offsetParent.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testOffsets() {
DivElement outer = Document.get().createDivElement();
DivElement middle = Document.get().createDivElement();
@@ -458,6 +462,7 @@
/**
* Tests that scrollLeft behaves as expected in RTL mode.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testScrollLeftInRtl() {
final DivElement outer = Document.get().createDivElement();
final DivElement inner = Document.get().createDivElement();
@@ -546,6 +551,7 @@
/**
* style.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testStyle() {
DivElement div = Document.get().createDivElement();
@@ -559,6 +565,7 @@
/**
* Test that styles only allow camelCase.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testStyleCamelCase() {
DivElement div = Document.get().createDivElement();
diff --git a/user/test/com/google/gwt/dom/client/MapTests.java b/user/test/com/google/gwt/dom/client/MapTests.java
index 7708d92..3a0938a 100644
--- a/user/test/com/google/gwt/dom/client/MapTests.java
+++ b/user/test/com/google/gwt/dom/client/MapTests.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
/**
@@ -30,6 +32,7 @@
/**
* getAreas.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetArea() {
Document doc = Document.get();
MapElement map = doc.createMapElement();
diff --git a/user/test/com/google/gwt/dom/client/NodeTest.java b/user/test/com/google/gwt/dom/client/NodeTest.java
index 8ff6956..dc4de50 100644
--- a/user/test/com/google/gwt/dom/client/NodeTest.java
+++ b/user/test/com/google/gwt/dom/client/NodeTest.java
@@ -16,6 +16,8 @@
package com.google.gwt.dom.client;
import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
/**
@@ -153,6 +155,7 @@
/**
* isOrHasChild.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testIsOrHasChild() {
Document doc = Document.get();
DivElement div = doc.createDivElement();
diff --git a/user/test/com/google/gwt/dom/client/StyleInjectorTest.java b/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
index 235a38b..910d09d 100644
--- a/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
+++ b/user/test/com/google/gwt/dom/client/StyleInjectorTest.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.dom.client;
+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;
@@ -29,6 +31,7 @@
return "com.google.gwt.dom.DOMTest";
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testStyleInjector() {
final DivElement elt = Document.get().createDivElement();
elt.setId("styleInjectorTest");
@@ -56,6 +59,7 @@
/**
* Ensure that the IE createStyleSheet compatibility code is exercised.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testLotsOfStyles() {
StyleElement[] elements = new StyleElement[100];
for (int i = 0, j = elements.length; i < j; i++) {
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 5a99183..39fe8a1 100644
--- a/user/test/com/google/gwt/emultest/java/lang/StringTest.java
+++ b/user/test/com/google/gwt/emultest/java/lang/StringTest.java
@@ -15,6 +15,8 @@
*/
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;
/**
@@ -362,6 +364,7 @@
assertEquals("ABABAB", testStr.replace('\u1111', 'A'));
}
+ @DoNotRunWith(Platform.Htmlunit)
public void testReplaceAll() {
String regex = hideFromCompiler("*[").replaceAll(
"([/\\\\\\.\\*\\+\\?\\|\\(\\)\\[\\]\\{\\}])", "\\\\$1");
@@ -386,6 +389,7 @@
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/event/dom/client/DomEventTest.java b/user/test/com/google/gwt/event/dom/client/DomEventTest.java
index e7c211c..b75b7c7 100644
--- a/user/test/com/google/gwt/event/dom/client/DomEventTest.java
+++ b/user/test/com/google/gwt/event/dom/client/DomEventTest.java
@@ -20,6 +20,8 @@
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.event.shared.HandlerRegistration;
import com.google.gwt.event.shared.HandlerTestBase;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.RootPanel;
@@ -131,6 +133,7 @@
"onDoubleClick");
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testMouseEventCoordinates() {
Button b = new Button();
RootPanel.get().add(b);
diff --git a/user/test/com/google/gwt/http/client/RequestBuilderTest.java b/user/test/com/google/gwt/http/client/RequestBuilderTest.java
index 5ade8cd..a0aa582 100644
--- a/user/test/com/google/gwt/http/client/RequestBuilderTest.java
+++ b/user/test/com/google/gwt/http/client/RequestBuilderTest.java
@@ -16,6 +16,8 @@
package com.google.gwt.http.client;
import com.google.gwt.core.client.GWT;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
/**
@@ -71,6 +73,7 @@
* <li>url == "www.freebsd.org" - violates same source
* </ul>
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testRequestBuilderStringString() throws RequestException {
try {
new RequestBuilder((RequestBuilder.Method) null, null);
diff --git a/user/test/com/google/gwt/user/client/EventTest.java b/user/test/com/google/gwt/user/client/EventTest.java
index f2e6490..6490c58 100644
--- a/user/test/com/google/gwt/user/client/EventTest.java
+++ b/user/test/com/google/gwt/user/client/EventTest.java
@@ -23,6 +23,8 @@
import com.google.gwt.event.dom.client.DoubleClickHandler;
import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
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;
import com.google.gwt.user.client.Event.NativePreviewEvent;
import com.google.gwt.user.client.Event.NativePreviewHandler;
@@ -153,6 +155,7 @@
* Test that a double click results in exactly one simulated click event in
* IE. See issue 3392 for more info.
*/
+ @DoNotRunWith(Platform.Htmlunit)
public void testDoubleClickEvent() {
TestLabel label = new TestLabel();
RootPanel.get().add(label);
diff --git a/user/test/com/google/gwt/user/client/WindowTest.java b/user/test/com/google/gwt/user/client/WindowTest.java
index 41f82fa..f25219c 100644
--- a/user/test/com/google/gwt/user/client/WindowTest.java
+++ b/user/test/com/google/gwt/user/client/WindowTest.java
@@ -16,6 +16,8 @@
package com.google.gwt.user.client;
import com.google.gwt.event.logical.shared.ResizeEvent;
+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.ui.Label;
import com.google.gwt.user.client.ui.RootPanel;
@@ -127,6 +129,7 @@
* Tests the ability of the Window to get the client size correctly with and
* without visible scroll bars.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetClientSize() {
// NOTE: We must clear the DOM here so that previous tests do not pollute
@@ -162,6 +165,7 @@
/**
* Tests the ability of scroll the Window and catch scroll events.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testScrolling() {
// Force scroll bars to appear
Window.enableScrolling(true);
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 78a47e4..ff5879c 100644
--- a/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/AbsolutePanelTest.java
@@ -16,6 +16,8 @@
package com.google.gwt.user.client.ui;
import com.google.gwt.dom.client.Document;
+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.Window;
@@ -32,6 +34,7 @@
HasWidgetsTester.testAll(new AbsolutePanel());
}
+ @DoNotRunWith(Platform.Htmlunit)
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 ff15450..8cb74ef 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;
@@ -145,6 +147,7 @@
}
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testEvents() {
Anchor anchor = new Anchor("Trigger obscure JavaScript things");
diff --git a/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java b/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
index 6f4e8e5..5172647 100644
--- a/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/CheckBoxTest.java
@@ -23,6 +23,8 @@
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
import com.google.gwt.event.shared.HandlerManager;
+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;
@@ -66,6 +68,7 @@
* Test accessors.
*/
@SuppressWarnings("deprecation")
+ @DoNotRunWith({Platform.Htmlunit})
public void testAccessors() {
cb.setHTML("test HTML");
assertEquals(cb.getHTML(), "test HTML");
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 8a668a0..c325523 100644
--- a/user/test/com/google/gwt/user/client/ui/CreateEventTest.java
+++ b/user/test/com/google/gwt/user/client/ui/CreateEventTest.java
@@ -21,6 +21,8 @@
import com.google.gwt.dom.client.EventTarget;
import com.google.gwt.dom.client.ImageElement;
import com.google.gwt.dom.client.InputElement;
+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.Event;
import com.google.gwt.user.client.EventListener;
@@ -195,6 +197,7 @@
* Tests that {@link Event#getCurrentEvent()} returns the right value for
* synthesized events.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetCurrentEvent() {
CurrentEventListener listener = new CurrentEventListener();
Event.setEventListener(child, listener);
@@ -214,6 +217,7 @@
/**
* Tests NativeEvent.stopPropagation().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testStopPropagation() {
NonBubbleAssertingEventListener listener = new NonBubbleAssertingEventListener(
"click") {
@@ -237,6 +241,7 @@
/**
* Tests createBlurEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerBlurEvent() {
NonBubbleAssertingEventListener listener = new NonBubbleAssertingEventListener(
"blur") {
@@ -256,6 +261,7 @@
/**
* Tests createChangeEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerChangeEvent() {
BubbleAssertingEventListener listener = new BubbleAssertingEventListener(
"change");
@@ -270,6 +276,7 @@
/**
* Tests createClickEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerClickEvent() {
BubbleAssertingEventListener listener = new BubbleAssertingEventListener(
"click") {
@@ -309,6 +316,7 @@
/**
* Tests createDblClickEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerDblClickEvent() {
BubbleAssertingEventListener listener = new BubbleAssertingEventListener(
"dblclick") {
@@ -339,6 +347,7 @@
/**
* Tests createErrorEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerErrorEvent() {
ImgEventListener listener = new ImgEventListener("error");
Event.setEventListener(parent, listener);
@@ -352,6 +361,7 @@
/**
* Tests createFocusEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerFocusEvent() {
NonBubbleAssertingEventListener listener = new NonBubbleAssertingEventListener(
"focus") {
@@ -371,6 +381,7 @@
/**
* Tests createKeyDownEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerKeyDownEvent() {
KeyEventListener listener = new KeyEventListener("keydown");
Event.setEventListener(parent, listener);
@@ -386,6 +397,7 @@
/**
* Tests createKeyPressEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerKeyPressEvent() {
KeyEventListener listener = new KeyEventListener("keypress");
Event.setEventListener(parent, listener);
@@ -401,6 +413,7 @@
/**
* Tests createKeyUpEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerKeyUpEvent() {
KeyEventListener listener = new KeyEventListener("keyup");
Event.setEventListener(parent, listener);
@@ -429,6 +442,7 @@
/**
* Tests createMouseDownEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerMouseDownEvent() {
MouseEventListener listener = new MouseEventListener("mousedown");
Event.setEventListener(parent, listener);
@@ -445,6 +459,7 @@
/**
* Tests createMouseMoveEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerMouseMoveEvent() {
MouseEventListener listener = new MouseEventListener("mousemove");
Event.setEventListener(parent, listener);
@@ -461,6 +476,7 @@
/**
* Tests createMouseOutEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerMouseOutEvent() {
MouseEventListener listener = new MouseEventListener("mouseout") {
public void onBrowserEvent(Event event) {
@@ -486,6 +502,7 @@
/**
* Tests createMouseOverEvent().
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testTriggerMouseOverEvent() {
MouseEventListener listener = new MouseEventListener("mouseover") {
public void onBrowserEvent(Event event) {
@@ -510,6 +527,7 @@
/**
* 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 025034d..54a35da 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMRtlTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.i18n.client.LocaleInfo;
+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;
@@ -34,6 +36,7 @@
* Tests {@link DOM#getAbsoluteLeft(Element)} for consistency when the element
* contains children and has scrollbars.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetAbsolutePositionWhenScrolled() {
assertTrue(LocaleInfo.getCurrentLocale().isRTL());
final Element outer = DOM.createDiv();
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 5bef50a..e689b72 100644
--- a/user/test/com/google/gwt/user/client/ui/DOMTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DOMTest.java
@@ -22,6 +22,8 @@
import com.google.gwt.dom.client.NativeEvent;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+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.DOM;
@@ -118,6 +120,7 @@
* Tests {@link DOM#getAbsoluteLeft(Element)} and
* {@link DOM#getAbsoluteTop(Element)}.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetAbsolutePosition() {
final int border = 8;
final int margin = 9;
@@ -154,6 +157,7 @@
* contains children and has scrollbars. See issue #1093 for more details.
*
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetAbsolutePositionWhenScrolled() {
final Element outer = DOM.createDiv();
final Element inner = DOM.createDiv();
@@ -188,6 +192,7 @@
* element has a border.
*
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetAbsolutePositionWithPixelBorders() {
final Element outer = DOM.createDiv();
final Element inner = DOM.createDiv();
@@ -218,6 +223,7 @@
* Tests getAbsoluteLeft/Top() for the document.body element. This used to
* cause exceptions to be thrown on Opera (see issue 1556).
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testGetBodyAbsolutePosition() {
try {
// The body's absolute left/top depends upon the browser, but we just
@@ -265,6 +271,7 @@
* Tests that {@link DOM#isOrHasChild(Element, Element)} works consistently
* across browsers.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testIsOrHasChild() {
Element div = DOM.createDiv();
Element childDiv = DOM.createDiv();
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 bfb4d1a..58ed098 100644
--- a/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DateBoxTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.NativeEvent;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.user.datepicker.client.DateBox;
/**
@@ -28,6 +30,7 @@
return "com.google.gwt.user.User";
}
+ @DoNotRunWith(Platform.Htmlunit)
public void testAccessors() {
DateBox db = new DateBox();
assertFalse(db.isDatePickerShowing());
@@ -37,6 +40,7 @@
assertFalse(db.isDatePickerShowing());
}
+ @DoNotRunWith({Platform.Htmlunit})
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 3d0b620..7e11c10 100644
--- a/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DeckPanelTest.java
@@ -16,6 +16,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;
/**
@@ -84,6 +86,7 @@
* 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 ef908a6..d794eea 100644
--- a/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/DialogBoxTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.DOM;
import com.google.gwt.user.client.DeferredCommand;
@@ -85,6 +87,7 @@
assertFalse(dialogBox.isShowing());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testDebugId() {
DialogBox dBox = new DialogBox();
dBox.setAnimationEnabled(false);
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 ed799cc..34f5373 100644
--- a/user/test/com/google/gwt/user/client/ui/HistoryTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HistoryTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
+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.History;
import com.google.gwt.user.client.HistoryListener;
@@ -93,6 +95,7 @@
* Tests against issue #879: Ensure that empty history tokens do not add
* additional characters after the '#' symbol in the URL.
*/
+ @DoNotRunWith(Platform.Htmlunit)
public void testEmptyHistoryTokens() {
delayTestFinish(5000);
@@ -283,6 +286,7 @@
* Test that using an empty history token works properly. There have been
* problems (see issue 2905) with this in the past on Safari.
*/
+ @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 f4b222e..fdb9873 100644
--- a/user/test/com/google/gwt/user/client/ui/ImageTest.java
+++ b/user/test/com/google/gwt/user/client/ui/ImageTest.java
@@ -21,6 +21,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;
/**
@@ -267,6 +269,7 @@
/**
* Tests the creation of an image in clipped mode.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testCreateClippedImage() {
final Image image = new Image("counting-forwards.png", 16, 16, 16, 16);
@@ -338,6 +341,7 @@
* {@link com.google.gwt.user.client.ui.Image#setUrlAndVisibleRect(String,int,int,int,int)}
* on a clipped image.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testSetUrlAndVisibleRectOnClippedImage() {
final Image image = new Image("counting-backwards.png", 12, 12, 12, 12);
@@ -388,6 +392,7 @@
* {@link com.google.gwt.user.client.ui.Image#setVisibleRect(int,int,int,int)}
* on a clipped image.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testSetVisibleRectAndLoadEventsOnClippedImage() {
final Image image = new Image("counting-backwards.png", 16, 16, 16, 16);
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 6e8af4a..1785aeb 100644
--- a/user/test/com/google/gwt/user/client/ui/MenuBarTest.java
+++ b/user/test/com/google/gwt/user/client/ui/MenuBarTest.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.Command;
import com.google.gwt.user.client.DeferredCommand;
@@ -205,6 +207,7 @@
assertNull(bar.getSelectedItem());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testDebugId() {
Command emptyCommand = new Command() {
public void execute() {
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 33ed174..1281c0a 100644
--- a/user/test/com/google/gwt/user/client/ui/PopupTest.java
+++ b/user/test/com/google/gwt/user/client/ui/PopupTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.dom.client.DivElement;
import com.google.gwt.dom.client.Document;
+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.Element;
import com.google.gwt.user.client.Timer;
@@ -202,6 +204,7 @@
assertTrue(popup.isShowing());
}
+ @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/SimpleRadioButtonTest.java b/user/test/com/google/gwt/user/client/ui/SimpleRadioButtonTest.java
index 9910868..c94b96a 100644
--- a/user/test/com/google/gwt/user/client/ui/SimpleRadioButtonTest.java
+++ b/user/test/com/google/gwt/user/client/ui/SimpleRadioButtonTest.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;
/**
@@ -27,6 +29,7 @@
return "com.google.gwt.user.UserTest";
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testProperties() {
SimpleRadioButton radio = new SimpleRadioButton("myName");
assertEquals("myName", radio.getName());
diff --git a/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java b/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java
index feb84c1..9f015e0 100644
--- a/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java
+++ b/user/test/com/google/gwt/user/client/ui/SuggestBoxTest.java
@@ -17,6 +17,8 @@
import com.google.gwt.dom.client.Document;
import com.google.gwt.dom.client.Element;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
import java.util.Arrays;
@@ -34,6 +36,7 @@
/**
* Test the basic accessors.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testAccessors() {
SuggestBox box = createSuggestBox();
@@ -53,6 +56,7 @@
assertTrue(box.isSuggestionListShowing());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testShowAndHide() {
SuggestBox box = createSuggestBox();
assertFalse(box.isSuggestionListShowing());
@@ -81,6 +85,7 @@
assertFalse(box.isSuggestionListShowing());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testDefaults() {
MultiWordSuggestOracle oracle = new MultiWordSuggestOracle();
oracle.setDefaultSuggestionsFromText(Arrays.asList("A", "B"));
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 148319d..67bb7a6 100644
--- a/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TextAreaTest.java
@@ -16,6 +16,9 @@
package com.google.gwt.user.client.ui;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
+
/**
* Tests a {@link TextArea}.
*/
@@ -27,6 +30,7 @@
* 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 58aa3e2..7c71762 100644
--- a/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
+++ b/user/test/com/google/gwt/user/client/ui/TextBoxBaseTestBase.java
@@ -17,6 +17,8 @@
import com.google.gwt.event.logical.shared.ValueChangeEvent;
import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
/**
@@ -46,6 +48,7 @@
* Tests that {@link TextArea#setCursorPos(int)} updates the cursor position
* correctly.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testMovingCursor() {
TextBoxBase area = createTextBoxBase();
RootPanel.get().add(area);
@@ -96,6 +99,7 @@
}
}
+ @DoNotRunWith({Platform.Htmlunit})
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/TreeTest.java b/user/test/com/google/gwt/user/client/ui/TreeTest.java
index d263d9f..5912ed8 100644
--- a/user/test/com/google/gwt/user/client/ui/TreeTest.java
+++ b/user/test/com/google/gwt/user/client/ui/TreeTest.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;
@@ -152,6 +154,7 @@
b.setWidget(null);
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testRemove() {
Tree t = new Tree();
TreeItem item = t.addItem("a");
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 7480a84..dc5055b 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
@@ -19,6 +19,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.user.client.Timer;
import com.google.gwt.user.client.ui.Image;
@@ -81,6 +83,7 @@
* {@link com.google.gwt.user.client.ui.impl.ClippedImagePrototype#applyTo(com.google.gwt.user.client.ui.Image)}
* is called.
*/
+ @DoNotRunWith({Platform.Htmlunit})
public void testApplyToClippedImage() {
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 d613b1e..d0d865e 100644
--- a/user/test/com/google/gwt/xml/client/XMLTest.java
+++ b/user/test/com/google/gwt/xml/client/XMLTest.java
@@ -15,6 +15,8 @@
*/
package com.google.gwt.xml.client;
+import com.google.gwt.junit.DoNotRunWith;
+import com.google.gwt.junit.Platform;
import com.google.gwt.junit.client.GWTTestCase;
import com.google.gwt.xml.client.impl.DOMParseException;
import com.google.gwt.xml.client.impl.XMLParserImplSafari;
@@ -133,6 +135,7 @@
return "com.google.gwt.xml.XML";
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testAttr() {
Document d = createTestDocument();
Element de = d.getDocumentElement();
@@ -144,6 +147,7 @@
assertEquals(de.getAttributeNode("unset"), null);
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testCreate() {
Document d = XMLParser.createDocument();
CDATASection createCDATA;
@@ -199,6 +203,7 @@
}
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testDocument() {
Document d = createTestDocument();
NodeList e1Nodes = d.getElementsByTagName("e1");
@@ -217,6 +222,7 @@
assertEquals(e1Node.toString(), alienNode11.toString());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testElement() {
Document d = createTestDocument();
Element top = d.getDocumentElement();
@@ -258,6 +264,7 @@
}
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testNamedNodeMap() {
Document d = createTestDocument();
NamedNodeMap m = d.getDocumentElement().getAttributes();
@@ -265,6 +272,7 @@
assertEquals(m.getLength(), 2);
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testNavigation() {
Document d = createTestDocument();
Element documentElement = d.getDocumentElement();
@@ -345,6 +353,7 @@
}
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testPrefix() {
Document d = XMLParser.parse("<?xml version=\"1.0\"?>\r\n"
+ "<!-- both namespace prefixes are available throughout -->\r\n"
@@ -358,6 +367,7 @@
assertEquals(d.getElementsByTagName("book").item(0), d.getDocumentElement());
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testProcessingInstruction() {
Document d = createTestDocument();
ProcessingInstruction pi = (ProcessingInstruction) d.getChildNodes().item(0);
@@ -367,6 +377,7 @@
assertEquals(pi.getData(), "other data");
}
+ @DoNotRunWith({Platform.Htmlunit})
public void testText() {
Document d = createTestDocument();
List<Node> textLikeNodes = Arrays.asList(new Node[] {