Disable testReplaceItemNoEvent for HtmlUnit platform
When running tests with HtmlUnit, when testReplaceItemNoEvent adds a new
history token with the fire event set to false, the event is not fired
during the test, but some time after, and testEmptyHistoryTokens sees it.
For some reason and randomly testEmptyHistoryTokens does not fail, perhaps
because of the order how the tests are run changes, or depending on how busy
the server is.
Change-Id: I52ee77616770e42e2a33a71ffe4125ad80940bcb
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 ddd6f5e..9093f4a 100644
--- a/user/test/com/google/gwt/user/client/ui/HistoryTest.java
+++ b/user/test/com/google/gwt/user/client/ui/HistoryTest.java
@@ -324,6 +324,12 @@
History.newItem(historyToken1);
}
+ /*
+ * HtmlUnit tends to fire events after adding a new item with fireEvent set
+ * to false. This makes 'testEmptyHistoryTokens' randomly fail after running
+ * this test.
+ */
+ @DoNotRunWith(Platform.HtmlUnitBug)
public void testReplaceItemNoEvent() {
/*
* Sentinel token which should only be seen if tokens are lost during the rest of the test.
@@ -493,11 +499,6 @@
timer.cancel();
timer = null;
}
-
- // HtmlUnit tends to fire events after adding a new item with fireEvent set
- // to false. This makes 'testEmptyHistoryTokens' randomly fail after running
- // 'testReplaceItemNoEvent'. Reseting the hash fragment here fixes the issue.
- History.newItem("");
}
private void addHistoryListenerImpl(ValueChangeHandler<String> handler) {