Reviewers: scottb,

Description:
Update HistoryTest to ensure that non-safari browsers also:
- run testHistory
- verify the current hash value as part of testTokenEscaping and
testTokenNonescaping


Please review this at http://gwt-code-reviews.appspot.com/855801/show

Affected files:
  M user/test/com/google/gwt/user/client/ui/HistoryTest.java


Index: user/test/com/google/gwt/user/client/ui/HistoryTest.java
===================================================================
--- user/test/com/google/gwt/user/client/ui/HistoryTest.java    (revision 8728)
+++ user/test/com/google/gwt/user/client/ui/HistoryTest.java    (working copy)
@@ -47,11 +47,19 @@
   }-*/;

   /*
-   * Copied from HistoryImplSafari.
+   * Copied from UserAgent.gwt.xml and HistoryImplSafari.
    */
   private static native boolean isSafari2() /*-{
+    var ua = navigator.userAgent;
+
+    // copied from UserAgent.gwt.xml
+    if (ua.indexOf("webkit") == -1) {
+      return false;
+    }
+
+    // copied from HistoryImplSafari
     var exp = / AppleWebKit\/([\d]+)/;
-    var result = exp.exec(navigator.userAgent);
+    var result = exp.exec(ua);
     if (result) {
       // The standard history implementation works fine on WebKit >= 522
       // (Safari 3 beta).
@@ -62,7 +70,7 @@

// The standard history implementation works just fine on the iPhone, which
     // unfortunately reports itself as WebKit/420+.
-    if (navigator.userAgent.indexOf('iPhone') != -1) {
+    if (ua.indexOf('iPhone') != -1) {
       return false;
     }



--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to