Fixing build breakage (WindowTest.testLocation() implicitly depended upon the
current url not having a trailing # character).
Patch by: jgw
Review by: knorton (desk check)
git-svn-id: https://google-web-toolkit.googlecode.com/svn/trunk@3682 8db76d5a-ed1c-0410-87a9-c151d255dfc7
diff --git a/user/test/com/google/gwt/user/client/WindowTest.java b/user/test/com/google/gwt/user/client/WindowTest.java
index 81b86da..a04f83f 100644
--- a/user/test/com/google/gwt/user/client/WindowTest.java
+++ b/user/test/com/google/gwt/user/client/WindowTest.java
@@ -61,6 +61,11 @@
// testing reload, replace, and assign seemed to hang our junit harness.
// Therefore only testing subset of Location that is testable.
+ // Use History to get the #hash part of the url into a known state (if the
+ // url has somehow been set to http://host/#, location.hash returns the
+ // empty string, but location.href includes the trailing hash).
+ History.newItem("foo");
+
// As we have no control over these values we cannot assert much about them.
String hash = Window.Location.getHash();
String host = Window.Location.getHost();
@@ -76,7 +81,7 @@
assertEquals(host, hostName + ":" + port);
assertEquals(href, protocol + "//" + host + path + query + hash);
}
-
+
public void testLocationParsing() {
Map<String, List<String>> map;