Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.253
diff -u -p -r1.253 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	30 Nov 2010 19:31:46 -0000	1.253
+++ modules/simpletest/drupal_web_test_case.php	3 Dec 2010 01:51:19 -0000
@@ -2355,7 +2355,8 @@ class DrupalWebTestCase extends DrupalTe
    * @param $path
    *   A path from the internal browser content.
    * @return
-   *   The $path with $base_url prepended, if necessary.
+   *   The $path with the internal browser's base URL or $base_url prepended, if
+   *   necessary.
    */
   protected function getAbsoluteUrl($path) {
     global $base_url, $base_path;
@@ -2364,6 +2365,17 @@ class DrupalWebTestCase extends DrupalTe
     if (empty($parts['host'])) {
       // Ensure that we have a string (and no xpath object).
       $path = (string) $path;
+      // Return an absolute URL based on the internal browser's current URL if
+      // it is not using the internal: scheme.
+      $parts = parse_url($this->getUrl());
+      if ($parts['scheme'] != 'internal') {
+        $port = isset($parts['port']) ? ':' . $parts['port'] : '';
+        // Assume path is a Drupal path if it does not start with "/".
+        if ($path[0] !== '/') {
+          $path = url($path);
+        }
+        return $parts['scheme'] . '://' . $parts['host'] . $port . $path;
+      }
       // Strip $base_path, if existent.
       $length = strlen($base_path);
       if (substr($path, 0, $length) === $base_path) {
