Use absolute URLs in testRequestFocusNodeHref CTS test.

The previous CTS test was relying on undefined behavior, that is,
calling testRequestFocusNodeHref on a relative link with no base url.

Change-Id: Idc5a23aff79eaa8d46ab5ee903f8029fefc643a7
(cherry picked from commit 7ab6711e21b2091a9e42f50560049b544d44b52a)
diff --git a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
index 63354d4..a9bfd6d 100644
--- a/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
+++ b/tests/tests/webkit/src/android/webkit/cts/TestHtmlConstants.java
@@ -47,6 +47,7 @@
     public static final String NETWORK_STATE_URL = "webkit/network_state.html";
     public static final String TEST_TIMER_URL = "webkit/test_timer.html";
 
+    public static final String HTML_BASE_URL = "http://base/";
     public static final String HTML_URL1 = "webkit/test_firstPage.html";
     public static final String HTML_URL2 = "webkit/test_secondPage.html";
     public static final String HTML_URL3 = "webkit/test_thirdPage.html";
diff --git a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
index 6c66f52..b242ca9 100755
--- a/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
+++ b/tests/tests/webkit/src/android/webkit/cts/WebViewTest.java
@@ -1111,9 +1111,10 @@
     }
 
     public void testRequestFocusNodeHref() throws Throwable {
-        final String links = "<DL><p><DT><A HREF=\"" + TestHtmlConstants.HTML_URL1
-                + "\">HTML_URL1</A><DT><A HREF=\"" + TestHtmlConstants.HTML_URL2
-                + "\">HTML_URL2</A></DL><p>";
+        final String absUrl1 = TestHtmlConstants.HTML_BASE_URL + TestHtmlConstants.HTML_URL1;
+        final String absUrl2 = TestHtmlConstants.HTML_BASE_URL + TestHtmlConstants.HTML_URL2;
+        final String links = "<DL><p><DT><A HREF=\"" + absUrl1 + "\">HTML_URL1</A>"
+                + "<DT><A HREF=\"" + absUrl2 + "\">HTML_URL2</A></DL><p>";
         mOnUiThread.loadDataAndWaitForCompletion("<html><body>" + links + "</body></html>", "text/html", null);
         getInstrumentation().waitForIdleSync();
 
@@ -1142,7 +1143,7 @@
                 return done;
             }
         }.run();
-        assertEquals(TestHtmlConstants.HTML_URL1, handler.getResultUrl());
+        assertEquals(absUrl1, handler.getResultUrl());
 
         // focus on second link
         handler.reset();
@@ -1156,7 +1157,7 @@
                 boolean done = false;
                 if (handler.hasCalledHandleMessage()) {
                     if (handler.mResultUrl != null &&
-                            handler.mResultUrl.equals(TestHtmlConstants.HTML_URL2)) {
+                            handler.mResultUrl.equals(absUrl2)) {
                         done = true;
                     } else {
                         handler.reset();
@@ -1168,7 +1169,7 @@
                 return done;
             }
         }.run();
-        assertEquals(TestHtmlConstants.HTML_URL2, handler.getResultUrl());
+        assertEquals(absUrl2, handler.getResultUrl());
 
         mOnUiThread.requestFocusNodeHref(null);
     }