? .DS_Store
? abstract-browser-into-its-own-class.patch
? abstract-browser-into-its-own-class.patch.1
? abstract-browser-into-its-own-class_1.patch
? abstract-browser-into-its-own-class_4.patch
? cache_registry_parse_3.patch
? test.txt
? modules/.DS_Store
? profiles/.DS_Store
? profiles/single_user_blog
? sites/.DS_Store
? sites/default/files
? sites/default/settings.php
? themes/garland/.DS_Store
Index: CHANGELOG.txt
===================================================================
RCS file: /cvs/drupal/drupal/CHANGELOG.txt,v
retrieving revision 1.289
diff -u -p -r1.289 CHANGELOG.txt
--- CHANGELOG.txt	25 Nov 2008 02:37:31 -0000	1.289
+++ CHANGELOG.txt	30 Nov 2008 16:22:02 -0000
@@ -79,6 +79,10 @@ Drupal 7.0, xxxx-xx-xx (development vers
       preserved but renamed to file_unmanaged_*().
 - Added aliased multi-site support:
     * Added support for mapping domain names to sites directories.
+- Added a code-based browser:
+    * The code-based browser can trigger both GET and POST requests on any website,
+      and is based on cURL.
+    * The browser is used by the Testing framework.
 
 Drupal 6.0, 2008-02-13
 ----------------------
Index: includes/browser.inc
===================================================================
RCS file: includes/browser.inc
diff -N includes/browser.inc
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ includes/browser.inc	30 Nov 2008 16:22:03 -0000
@@ -0,0 +1,566 @@
+<?php
+
+class DrupalBrowser {
+  /**
+   * The handle of the current cURL connection.
+   *
+   * @var resource
+   */
+  public $curlHandle;
+
+  /**
+   * The content of the page currently loaded in the internal browser.
+   *
+   * @var string
+   */
+  public $content;
+
+  /**
+   * The URL of the current page.
+   *
+   * @var string
+   */
+  public $url;
+
+  /**
+   * The parsed version of the page.
+   *
+   * @var SimpleXMLElement
+   */
+  protected $elements = NULL;
+
+  /**
+   * The current cookie file used by cURL.
+   *
+   * We do not reuse the cookies in further runs, so we do not need a file
+   * but we still need cookie handling, so we set the jar to NULL.
+   */
+  public $cookieFile = NULL;
+
+  /**
+   * Additional cURL options.
+   *
+   * DrupalBrowser itself never sets this but always obeys what is set.
+   */
+  public $additionalCurlOptions = array();
+
+  /**
+   * Initializes the cURL connection.
+   *
+   * This function will add authentication headers as specified in the
+   * simpletest_httpauth_username and simpletest_httpauth_pass variables. Also,
+   * see the description of $curl_options among the properties.
+   */
+  protected function curlInitialize() {
+    global $base_url, $db_prefix;
+    if (!isset($this->curlHandle)) {
+      $this->curlHandle = curl_init();
+      $curl_options = $this->additionalCurlOptions + array(
+        CURLOPT_COOKIEJAR => $this->cookieFile,
+        CURLOPT_URL => $base_url,
+        CURLOPT_FOLLOWLOCATION => TRUE,
+        CURLOPT_RETURNTRANSFER => TRUE,
+        CURLOPT_SSL_VERIFYPEER => FALSE,  // Required to make the tests run on https://
+        CURLOPT_SSL_VERIFYHOST => FALSE,  // Required to make the tests run on https://
+        CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderCallback'),
+      );
+      if (preg_match('/simpletest\d+/', $db_prefix, $matches)) {
+        $curl_options[CURLOPT_USERAGENT] = $matches[0];
+      }
+      if (!isset($curl_options[CURLOPT_USERPWD]) && ($auth = variable_get('simpletest_httpauth_username', ''))) {
+        if ($pass = variable_get('simpletest_httpauth_pass', '')) {
+          $auth .= ':' . $pass;
+        }
+        $curl_options[CURLOPT_USERPWD] = $auth;
+      }
+      curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
+    }
+  }
+
+  /**
+   * Performs a cURL exec with the specified options after calling curlConnect().
+   *
+   * @param $curl_options
+   *   Custom cURL options.
+   * @return
+   *   Content returned from the exec.
+   */
+  protected function curlExec($curl_options) {
+    $this->curlInitialize();
+    $this->elements = NULL;
+    $url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
+    curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
+    $this->content = curl_exec($this->curlHandle);
+    $this->url = curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL);
+    $this->debug($this->content !== FALSE, t('!method to !url, response is !length bytes.', array('!method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'), '!url' => $url, '!length' => strlen($this->content))), t('Browser'));
+    return $this->content;
+  }
+
+  /**
+   * Reads headers and registers errors received from the tested site.
+   *
+   * @see _drupal_log_error().
+   *
+   * @param $curlHandler
+   *   The cURL handler.
+   * @param $header
+   *   An header.
+   */
+  protected function curlHeaderCallback($curlHandler, $header) {
+    // Errors are being sent via X-Drupal-Assertion-* headers,
+    // generated by _drupal_log_error() in the exact form required
+    // by DrupalWebTestCase::error().
+    if (preg_match('/^X-Drupal-Assertion-[0-9]+: (.*)$/', $header, $matches)) {
+      // Call DrupalWebTestCase::error() with the parameters from the header.
+      call_user_func_array(array(&$this, 'error'), unserialize(urldecode($matches[1])));
+    }
+    // This is required by cURL.
+    return strlen($header);
+  }
+
+  /**
+   * Close the cURL handler and unset the handler.
+   */
+  public function curlClose() {
+    if (isset($this->curlHandle)) {
+      curl_close($this->curlHandle);
+      unset($this->curlHandle);
+    }
+  }
+
+  /**
+   * Parse content returned from curlExec using DOM and SimpleXML.
+   *
+   * @return
+   *   A SimpleXMLElement or FALSE on failure.
+   */
+  public function parseHTMLcontent() {
+    if (!$this->elements) {
+      // DOM can load HTML soup. But, HTML soup can throw warnings, supress
+      // them.
+      @$htmlDom = DOMDocument::loadHTML($this->content);
+      if ($htmlDom) {
+        $this->debug(TRUE, t('Valid HTML found on "@path"', array('@path' => $this->url)), t('Browser'));
+        // It's much easier to work with simplexml than DOM, luckily enough
+        // we can just simply import our DOM tree.
+        $this->elements = simplexml_import_dom($htmlDom);
+      }
+    }
+    if (!$this->elements) {
+      $this->debug(FALSE, t('Parsed page successfully.'), t('Browser'));
+    }
+
+    return $this->elements;
+  }
+
+  /**
+   * Retrieves a Drupal path or an absolute path.
+   *
+   * @param $path
+   *   Drupal path or URL to load into internal browser
+   * @param $options
+   *   Options to be forwarded to url().
+   * @return
+   *   The retrieved HTML string, also available as $this->drupalGetContent()
+   */
+  public function get($path, $options = array()) {
+    $options['absolute'] = TRUE;
+
+    // We re-using a CURL connection here.  If that connection still has certain
+    // options set, it might change the GET into a POST.  Make sure we clear out
+    // previous options.
+    $out = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($path, $options), CURLOPT_HEADER => FALSE, CURLOPT_NOBODY => FALSE));
+    $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
+
+    // Replace original page output with new output from redirected page(s).
+    if (($new = $this->checkForMetaRefresh())) {
+      $out = $new;
+    }
+    return $out;
+  }
+
+  /**
+   * Execute a POST request on a Drupal page.
+   * It will be done as usual POST request with SimpleBrowser.
+   *
+   * @param $path
+   *   Location of the post form. Either a Drupal path or an absolute path or
+   *   NULL to post to the current page. For multi-stage forms you can set the
+   *   path to NULL and have it post to the last received page. Example:
+   *
+   *   // First step in form.
+   *   $edit = array(...);
+   *   $this->drupalPost('some_url', $edit, t('Save'));
+   *
+   *   // Second step in form.
+   *   $edit = array(...);
+   *   $this->drupalPost(NULL, $edit, t('Save'));
+   * @param  $edit
+   *   Field data in an assocative array. Changes the current input fields
+   *   (where possible) to the values indicated. A checkbox can be set to
+   *   TRUE to be checked and FALSE to be unchecked. Note that when a form
+   *   contains file upload fields, other fields cannot start with the '@'
+   *   character.
+   *
+   *   Multiple select fields can be set using name[] and setting each of the
+   *   possible values. Example:
+   *   $edit = array();
+   *   $edit['name[]'] = array('value1', 'value2');
+   * @param $submit
+   *   Value of the submit button.
+   * @param $options
+   *   Options to be forwarded to url().
+   */
+  public function post($path, $edit, $submit, $options = array()) {
+    $submit_matches = FALSE;
+    if (isset($path)) {
+      $html = $this->get($path, $options);
+    }
+    if ($this->parseHTMLcontent()) {
+      $edit_save = $edit;
+      // Let's iterate over all the forms.
+      $forms = $this->xpath('//form');
+      foreach ($forms as $form) {
+        // We try to set the fields of this form as specified in $edit.
+        $edit = $edit_save;
+        $post = array();
+        $upload = array();
+        $submit_matches = $this->handleForm($post, $edit, $upload, $submit, $form);
+        $action = isset($form['action']) ? $this->getAbsoluteUrl($form['action']) : $this->url;
+
+        // We post only if we managed to handle every field in edit and the
+        // submit button matches.
+        if (!$edit && $submit_matches) {
+          if ($upload) {
+            // TODO: cURL handles file uploads for us, but the implementation
+            // is broken. This is a less than elegant workaround. Alternatives
+            // are being explored at #253506.
+            foreach ($upload as $key => $file) {
+              $file = realpath($file);
+              if ($file && is_file($file)) {
+                $post[$key] = '@' . $file;
+              }
+            }
+          }
+          else {
+            file_put_contents('test.txt', print_r($post, 1), FILE_APPEND);
+            foreach ($post as $key => $value) {
+              // Encode according to application/x-www-form-urlencoded
+              // Both names and values needs to be urlencoded, according to
+              // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
+              $post[$key] = urlencode($key) . '=' . urlencode($value);
+            }
+            $post = implode('&', $post);
+          }
+          $out = $this->curlExec(array(CURLOPT_URL => $action, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $post, CURLOPT_HEADER => FALSE));
+          // Ensure that any changes to variables in the other thread are picked up.
+          $this->refreshVariables();
+
+          // Replace original page output with new output from redirected page(s).
+          if (($new = $this->checkForMetaRefresh())) {
+            $out = $new;
+          }
+          return $out;
+        }
+      }
+      // We have not found a form which contained all fields of $edit.
+      foreach ($edit as $name => $value) {
+        $this->debug(FALSE, t('Failed to set field @name to @value', array('@name' => $name, '@value' => $value)));
+      }
+      $this->debug($submit_matches, t('Found the @submit button', array('@submit' => $submit)));
+      $this->debug(FALSE, t('Found the requested form fields at @path', array('@path' => $path)));
+    }
+  }
+
+  /**
+   * Check for meta refresh tag and if found call drupalGet() recursively. This
+   * function looks for the http-equiv attribute to be set to "Refresh"
+   * and is case-sensitive.
+   *
+   * @return
+   *   Either the new page content or FALSE.
+   */
+  protected function checkForMetaRefresh() {
+    if ($this->content != '' && $this->parseHTMLcontent()) {
+      $refresh = $this->xpath('//meta[@http-equiv="Refresh"]');
+      if (!empty($refresh)) {
+        // Parse the content attribute of the meta tag for the format:
+        // "[delay]: URL=[page_to_redirect_to]".
+        if (preg_match('/\d+;\s*URL=(?P<url>.*)/i', $refresh[0]['content'], $match)) {
+          return $this->get($this->getAbsoluteUrl(decode_entities($match['url'])));
+        }
+      }
+    }
+    return FALSE;
+  }
+
+  /**
+   * Retrieves only the headers for a Drupal path or an absolute path.
+   *
+   * @param $path
+   *   Drupal path or URL to load into internal browser
+   * @param $options
+   *   Options to be forwarded to url().
+   * @return
+   *   The retrieved headers, also available as $this->drupalGetContent()
+   */
+  public function head($path, Array $options = array()) {
+    $options['absolute'] = TRUE;
+    $out = $this->curlExec(array(CURLOPT_HEADER => TRUE, CURLOPT_NOBODY => TRUE, CURLOPT_URL => url($path, $options)));
+    $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
+    return $out;
+  }
+
+  /**
+   * Handle form input related to drupalPost(). Ensure that the specified fields
+   * exist and attempt to create POST data in the correct manner for the particular
+   * field type.
+   *
+   * @param $post
+   *   Reference to array of post values.
+   * @param $edit
+   *   Reference to array of edit values to be checked against the form.
+   * @param $submit
+   *   Form submit button value.
+   * @param $form
+   *   Array of form elements.
+   * @return
+   *   Submit value matches a valid submit input in the form.
+   */
+  protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
+    // Retrieve the form elements.
+    $elements = $form->xpath('.//input|.//textarea|.//select');
+    $submit_matches = FALSE;
+    foreach ($elements as $element) {
+      // SimpleXML objects need string casting all the time.
+      $name = (string) $element['name'];
+      // This can either be the type of <input> or the name of the tag itself
+      // for <select> or <textarea>.
+      $type = isset($element['type']) ? (string)$element['type'] : $element->getName();
+      $value = isset($element['value']) ? (string)$element['value'] : '';
+      $done = FALSE;
+      if (isset($edit[$name])) {
+        switch ($type) {
+          case 'text':
+          case 'textarea':
+          case 'password':
+            $post[$name] = $edit[$name];
+            unset($edit[$name]);
+            break;
+          case 'radio':
+            if ($edit[$name] == $value) {
+              $post[$name] = $edit[$name];
+              unset($edit[$name]);
+            }
+            break;
+          case 'checkbox':
+            // To prevent checkbox from being checked.pass in a FALSE,
+            // otherwise the checkbox will be set to its value regardless
+            // of $edit.
+            if ($edit[$name] === FALSE) {
+              unset($edit[$name]);
+              continue 2;
+            }
+            else {
+              unset($edit[$name]);
+              $post[$name] = $value;
+            }
+            break;
+          case 'select':
+            $new_value = $edit[$name];
+            $index = 0;
+            $key = preg_replace('/\[\]$/', '', $name);
+            $options = $this->getAllOptions($element);
+            foreach ($options as $option) {
+              if (is_array($new_value)) {
+                $option_value= (string)$option['value'];
+                if (in_array($option_value, $new_value)) {
+                  $post[$key . '[' . $index++ . ']'] = $option_value;
+                  $done = TRUE;
+                  unset($edit[$name]);
+                }
+              }
+              elseif ($new_value == $option['value']) {
+                $post[$name] = $new_value;
+                unset($edit[$name]);
+                $done = TRUE;
+              }
+            }
+            break;
+          case 'file':
+            $upload[$name] = $edit[$name];
+            unset($edit[$name]);
+            break;
+        }
+      }
+      if (!isset($post[$name]) && !$done) {
+        switch ($type) {
+          case 'textarea':
+            $post[$name] = (string)$element;
+            break;
+          case 'select':
+            $single = empty($element['multiple']);
+            $first = TRUE;
+            $index = 0;
+            $key = preg_replace('/\[\]$/', '', $name);
+            $options = $this->getAllOptions($element);
+            foreach ($options as $option) {
+              // For single select, we load the first option, if there is a
+              // selected option that will overwrite it later.
+              if ($option['selected'] || ($first && $single)) {
+                $first = FALSE;
+                if ($single) {
+                  $post[$name] = (string)$option['value'];
+                }
+                else {
+                  $post[$key . '[' . $index++ . ']'] = (string)$option['value'];
+                }
+              }
+            }
+            break;
+          case 'file':
+            break;
+          case 'submit':
+          case 'image':
+            if ($submit == $value) {
+              $post[$name] = $value;
+              $submit_matches = TRUE;
+            }
+            break;
+          case 'radio':
+          case 'checkbox':
+            if (!isset($element['checked'])) {
+              break;
+            }
+            // Deliberate no break.
+          default:
+            $post[$name] = $value;
+        }
+      }
+    }
+    return $submit_matches;
+  }
+
+  /**
+   * Get all option elements, including nested options, in a select.
+   *
+   * @param $element
+   *   The element for which to get the options.
+   * @return
+   *   Option elements in select.
+   */
+  public function getAllOptions(SimpleXMLElement $element) {
+    $options = array();
+    // Add all options items.
+    foreach ($element->option as $option) {
+      $options[] = $option;
+    }
+
+    // Search option group children.
+    if (isset($element->optgroup)) {
+      foreach ($element->optgroup as $group) {
+        $options = array_merge($options, $this->getAllOptions($group));
+      }
+    }
+    return $options;
+  }
+
+  /**
+   * Follows a link by name.
+   *
+   * Will click the first link found with this link text by default, or a
+   * later one if an index is given. Match is case insensitive with
+   * normalized space. The label is translated label. There is an assert
+   * for successful click.
+   *
+   * @param $label
+   *   Text between the anchor tags.
+   * @param $index
+   *   Link position counting from zero.
+   * @return
+   *   Page on success, or FALSE on failure.
+   */
+  public function clickLink($label, $index = 0) {
+    $url_before = $this->url;
+    $urls = $this->xpath('//a[text()="' . $label . '"]');
+
+    if (isset($urls[$index])) {
+      $url_target = $this->getAbsoluteUrl($urls[$index]['href']);
+    }
+
+    $this->debug(isset($urls[$index]), t('Clicked link "!label" (!url_target) from !url_before', array('!label' => $label, '!url_target' => $url_target, '!url_before' => $url_before)), t('Browser'));
+
+    if (isset($urls[$index])) {
+      return $this->get($url_target);
+    }
+    return FALSE;
+  }
+
+
+  /**
+   * Takes a path and returns an absolute path.
+   *
+   * @param $path
+   *   The path, can be a Drupal path or a site-relative path. It might have a
+   *   query, too. Can even be an absolute path which is just passed through.
+   * @return
+   *   An absolute path.
+   */
+  protected function getAbsoluteUrl($path) {
+    $options = array('absolute' => TRUE);
+    $parts = parse_url($path);
+    // This is more crude than the menu_is_external but enough here.
+    if (empty($parts['host'])) {
+      $path = $parts['path'];
+      $base_path = base_path();
+      $n = strlen($base_path);
+      if (substr($path, 0, $n) == $base_path) {
+        $path = substr($path, $n);
+      }
+      if (isset($parts['query'])) {
+        $options['query'] = $parts['query'];
+      }
+      $path = url($path, $options);
+    }
+    return $path;
+  }
+
+  /**
+   * Debug messages are sent to this function.
+   * This is used by SimpleTest to trigger assertions.
+   *
+   * @param $success
+   *   The success of the operation that the message is about.
+   * @param $message
+   *   A (translated) debug message.
+   */
+  function debug($success, $message) {}
+
+  /**
+   * Refresh the in-memory set of variables. Useful after a page request is made
+   * that changes a variable in a different thread.
+   */
+  protected function refreshVariables() {
+    global $conf;
+    cache_clear_all('variables', 'cache');
+    $conf = variable_init();
+  }
+
+  /**
+   * Peform an xpath search on the contents of the internal browser. The search
+   * is relative to the root element (HTML tag normally) of the page.
+   *
+   * @param $xpath
+   *   The xpath string to use in the search.
+   * @return
+   *   The return value of the xpath search. For details on the xpath string
+   *   format and return values see the SimpleXML documentation.
+   *   http://us.php.net/manual/function.simplexml-element-xpath.php
+   */
+  public function xpath($xpath) {
+    if ($this->parseHTMLcontent()) {
+      return $this->elements->xpath($xpath);
+    }
+    return FALSE;
+  }
+}
Index: modules/aggregator/aggregator.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/aggregator/aggregator.test,v
retrieving revision 1.16
diff -u -p -r1.16 aggregator.test
--- modules/aggregator/aggregator.test	25 Nov 2008 13:14:26 -0000	1.16
+++ modules/aggregator/aggregator.test	30 Nov 2008 16:22:03 -0000
@@ -17,7 +17,7 @@ class AggregatorTestCase extends DrupalW
    */
   function createFeed() {
     $edit = $this->getFeedEditArray();
-    $this->drupalPost('admin/content/aggregator/add/feed', $edit, t('Save'));
+    $this->browser->post('admin/content/aggregator/add/feed', $edit, t('Save'));
     $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title'])));
 
     $feed = db_query("SELECT *  FROM {aggregator_feed} WHERE title = :title AND url = :url", array(':title' => $edit['title'], ':url' => $edit['url']))->fetch();
@@ -31,7 +31,7 @@ class AggregatorTestCase extends DrupalW
    * @param object $feed Feed object representing the feed.
    */
   function deleteFeed($feed) {
-    $this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, array(), t('Delete'));
+    $this->browser->post('admin/content/aggregator/edit/feed/' . $feed->fid, array(), t('Delete'));
     $this->assertRaw(t('The feed %title has been deleted.', array('%title' => $feed->title)), t('Feed deleted successfully.'));
   }
 
@@ -58,7 +58,7 @@ class AggregatorTestCase extends DrupalW
    */
   function updateFeedItems(&$feed) {
     // First, let's ensure we can get to the rss xml.
-    $this->drupalGet('rss.xml');
+    $this->browser->get('rss.xml');
     $this->assertResponse(200, t('rss.xml is reachable.'));
 
     // Our tests are based off of rss.xml, so let's find out how many elements should be related.
@@ -67,7 +67,7 @@ class AggregatorTestCase extends DrupalW
     $feed_count = $feed_count > 10 ? 10 : $feed_count;
 
     // Refresh the feed (simulated link click).
-    $this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
+    $this->browser->get('admin/content/aggregator/update/' . $feed->fid);
 
     // Ensure we have the right number of items.
     $result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid));
@@ -86,7 +86,7 @@ class AggregatorTestCase extends DrupalW
    * @param object $feed Feed object representing the feed.
    */
   function removeFeedItems($feed) {
-    $this->drupalPost('admin/content/aggregator/remove/' . $feed->fid, array(), t('Remove items'));
+    $this->browser->post('admin/content/aggregator/remove/' . $feed->fid, array(), t('Remove items'));
     $this->assertRaw(t('The news items from %title have been removed.', array('%title' => $feed->title)), t('Feed items removed.'));
   }
 
@@ -241,11 +241,11 @@ class AddFeedTestCase extends Aggregator
     $feed = $this->createFeed();
 
     // Check feed data.
-    $this->assertEqual($this->getUrl(), url('admin/content/aggregator/add/feed', array('absolute' => TRUE)), t('Directed to correct url.'));
+    $this->assertEqual($this->browser->url, url('admin/content/aggregator/add/feed', array('absolute' => TRUE)), t('Directed to correct url.'));
     $this->assertTrue($this->uniqueFeed($feed->title, $feed->url), t('The feed is unique.'));
 
     // Check feed source.
-    $this->drupalGet('aggregator/sources/' . $feed->fid);
+    $this->browser->get('aggregator/sources/' . $feed->fid);
     $this->assertResponse(200, t('Feed source exists.'));
     $this->assertText($feed->title, t('Page title'));
 
@@ -277,15 +277,15 @@ class UpdateFeedTestCase extends Aggrega
       if (isset($feed->{$same_field})) {
         $edit[$same_field] = $feed->{$same_field};
       }
-      $this->drupalPost('admin/content/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
+      $this->browser->post('admin/content/aggregator/edit/feed/' . $feed->fid, $edit, t('Save'));
       $this->assertRaw(t('The feed %name has been updated.', array('%name' => $edit['title'])), t('The feed %name has been updated.', array('%name' => $edit['title'])));
 
       // Check feed data.
-      $this->assertEqual($this->getUrl(), url('admin/content/aggregator/', array('absolute' => TRUE)));
+      $this->assertEqual($this->browser->url, url('admin/content/aggregator/', array('absolute' => TRUE)));
       $this->assertTrue($this->uniqueFeed($edit['title'], $edit['url']), t('The feed is unique.'));
 
       // Check feed source.
-      $this->drupalGet('aggregator/sources/' . $feed->fid);
+      $this->browser->get('aggregator/sources/' . $feed->fid);
       $this->assertResponse(200, t('Feed source exists.'));
       $this->assertText($edit['title'], t('Page title'));
 
@@ -315,7 +315,7 @@ class RemoveFeedTestCase extends Aggrega
     $this->deleteFeed($feed);
 
     // Check feed source.
-    $this->drupalGet('aggregator/sources/' . $feed->fid);
+    $this->browser->get('aggregator/sources/' . $feed->fid);
     $this->assertResponse(404, t('Deleted feed source does not exists.'));
 
     // Check database for feed.
@@ -352,14 +352,14 @@ class UpdateFeedItemTestCase extends Agg
       'title' => "Feed without publish timestamp",
       'url' => file_create_url($this->getRSS091Sample()),
     );
-    $this->drupalGet($edit['url']);
+    $this->browser->get($edit['url']);
     $this->assertResponse(array(200), t('URL !url is accessible', array('!url' => $edit['url'])));
 
-    $this->drupalPost('admin/content/aggregator/add/feed', $edit, t('Save'));
+    $this->browser->post('admin/content/aggregator/add/feed', $edit, t('Save'));
     $this->assertRaw(t('The feed %name has been added.', array('%name' => $edit['title'])), t('The feed !name has been added.', array('!name' => $edit['title'])));
 
     $feed = db_query("SELECT * FROM {aggregator_feed} WHERE url = :url", array(':url' => $edit['url']))->fetchObject();
-    $this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
+    $this->browser->get('admin/content/aggregator/update/' . $feed->fid);
 
     $before = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid))->fetchField();
 
@@ -374,7 +374,7 @@ class UpdateFeedItemTestCase extends Agg
         'modified' => 0,
       ))
       ->execute();
-    $this->drupalGet('admin/content/aggregator/update/' . $feed->fid);
+    $this->browser->get('admin/content/aggregator/update/' . $feed->fid);
 
     $after = db_query('SELECT timestamp FROM {aggregator_item} WHERE fid = :fid', array(':fid' => $feed->fid))->fetchField();
 
@@ -426,7 +426,7 @@ class CategorizeFeedItemTestCase extends
   function testCategorizeFeedItem() {
     // Simulate form submission on "admin/content/aggregator/add/category".
     $edit = array('title' => $this->randomName(10, self::$prefix), 'description' => '');
-    $this->drupalPost('admin/content/aggregator/add/category', $edit, t('Save'));
+    $this->browser->post('admin/content/aggregator/add/category', $edit, t('Save'));
     $this->assertRaw(t('The category %title has been added.', array('%title' => $edit['title'])), t('The category %title has been added.', array('%title' => $edit['title'])));
 
     $category = db_query("SELECT * FROM {aggregator_category} WHERE title = :title", array(':title' => $edit['title']))->fetch();
@@ -485,7 +485,7 @@ class ImportOPMLTestCase extends Aggrega
       ))
       ->execute();
 
-    $this->drupalGet('admin/content/aggregator/add/opml');
+    $this->browser->get('admin/content/aggregator/add/opml');
     $this->assertText('A single OPML document may contain a collection of many feeds.', t('Looking for help text.'));
     $this->assertFieldByName('files[upload]', '', t('Looking for file upload field.'));
     $this->assertFieldByName('remote', '', t('Looking for remote URL field.'));
@@ -500,7 +500,7 @@ class ImportOPMLTestCase extends Aggrega
     $before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
 
     $form = array();
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertRaw(t('You must <em>either</em> upload a file or enter a URL.'), t('Error if no fields are filled.'));
 
     $path = $this->getEmptyOpml();
@@ -508,11 +508,11 @@ class ImportOPMLTestCase extends Aggrega
       'files[upload]' => $path,
       'remote' => file_create_url($path),
     );
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertRaw(t('You must <em>either</em> upload a file or enter a URL.'), t('Error if both fields are filled.'));
 
     $form = array('remote' => 'invalidUrl://empty');
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertText(t('This URL is not valid.'), t('Error if the URL is invalid.'));
 
     $after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
@@ -526,11 +526,11 @@ class ImportOPMLTestCase extends Aggrega
     $before = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
 
     $form['files[upload]'] = $this->getInvalidOpml();
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertText(t('No new feed has been added.'), t('Attempting to upload invalid XML.'));
 
     $form = array('remote' => file_create_url($this->getEmptyOpml()));
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertText(t('No new feed has been added.'), t('Attempting to load empty OPML from remote URL.'));
 
     $after = db_query('SELECT COUNT(*) FROM {aggregator_feed}')->fetchField();
@@ -557,7 +557,7 @@ class ImportOPMLTestCase extends Aggrega
       'refresh'       => '900',
       'category[1]'   => $category,
     );
-    $this->drupalPost('admin/content/aggregator/add/opml', $form, t('Import'));
+    $this->browser->post('admin/content/aggregator/add/opml', $form, t('Import'));
     $this->assertRaw(t('A feed with the URL %url already exists.', array('%url' => $feeds[0]['url'])), t('Verifying that a duplicate URL was identified'));
     $this->assertRaw(t('A feed named %title already exists.', array('%title' => $feeds[1]['title'])), t('Verifying that a duplicate title was identified'));
 
Index: modules/block/block.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/block/block.test,v
retrieving revision 1.6
diff -u -p -r1.6 block.test
--- modules/block/block.test	25 Nov 2008 13:14:26 -0000	1.6
+++ modules/block/block.test	30 Nov 2008 16:22:03 -0000
@@ -27,7 +27,7 @@ class BlockTestCase extends DrupalWebTes
     $box['info'] = $this->randomName(8);
     $box['title'] = $this->randomName(8);
     $box['body'] = $this->randomName(32);
-    $this->drupalPost('admin/build/block/add', $box, t('Save block'));
+    $this->browser->post('admin/build/block/add', $box, t('Save block'));
 
     // Confirm that the box has been created, and then query the created bid.
     $this->assertText(t('The block has been created.'), t('Box successfully created.'));
@@ -40,7 +40,7 @@ class BlockTestCase extends DrupalWebTes
     // TODO: Implement full region checking.
     $edit = array();
     $edit['block_' . $bid . '[region]'] = 'left';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
 
     // Confirm that the box was moved to the proper region.
     $this->assertText(t('The block settings have been updated.'), t('Box successfully moved to left region.'));
@@ -49,7 +49,7 @@ class BlockTestCase extends DrupalWebTes
     $this->assertText(t($box['title']), t('Box successfully being displayed on the page.'));
 
     // Delete the created box & verify that it's been deleted and no longer appearing on the page.
-    $this->drupalPost('admin/build/block/delete/' . $bid, array(), t('Delete'));
+    $this->browser->post('admin/build/block/delete/' . $bid, array(), t('Delete'));
     $this->assertRaw(t('The block %title has been removed.', array('%title' => $box['info'])), t('Box successfully deleted.'));
     $this->assertNoText(t($box['title']), t('Box no longer appears on page.'));
   }
@@ -64,13 +64,13 @@ class BlockTestCase extends DrupalWebTes
     $box['title'] = $this->randomName(8);
     $box['body'] = '<h1>Full HTML</h1>';
     $box['body_format'] = 2;
-    $this->drupalPost('admin/build/block/add', $box, t('Save block'));
+    $this->browser->post('admin/build/block/add', $box, t('Save block'));
 
     // Set the created box to a specific region.
     $bid = db_result(db_query("SELECT bid FROM {box} WHERE info = '%s'", array($box['info'])));
     $edit = array();
     $edit['block_' . $bid . '[region]'] = 'left';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
 
     // Confirm that the box is being displayed using configured input format.
     $this->assertRaw('<h1>Full HTML</h1>', t('Box successfully being displayed using Full HTML.'));
@@ -87,7 +87,7 @@ class BlockTestCase extends DrupalWebTes
     $block['title'] = $this->randomName(8);
 
     // Set block title to confirm that interface works and override any custom titles.
-    $this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block'));
+    $this->browser->post('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => $block['title']), t('Save block'));
     $this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
     $bid = db_result(db_query("SELECT bid FROM {block} WHERE module = '%s' AND delta = %d", array($block['module'], $block['delta'])));
 
@@ -97,7 +97,7 @@ class BlockTestCase extends DrupalWebTes
     // Set the created block to a specific region.
     $edit = array();
     $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = 'left';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
 
     // Confirm that the block was moved to the proper region.
     // TODO: Implement full region checking.
@@ -109,7 +109,7 @@ class BlockTestCase extends DrupalWebTes
     // Set the block to the disabled region.
     $edit = array();
     $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = '-1';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
 
     // Confirm that the block was moved to the proper region.
     $this->assertText(t('The block settings have been updated.'), t('Block successfully move to disabled region.'));
@@ -118,10 +118,10 @@ class BlockTestCase extends DrupalWebTes
     // For convenience of developers, put the navigation block back.
     $edit = array();
     $edit[$block['module'] . '_' . $block['delta'] . '[region]'] = 'left';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
     $this->assertText(t('The block settings have been updated.'), t('Block successfully move to disabled region.'));
 
-    $this->drupalPost('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => 'Navigation'), t('Save block'));
+    $this->browser->post('admin/build/block/configure/' . $block['module'] . '/' . $block['delta'], array('title' => 'Navigation'), t('Save block'));
     $this->assertText(t('The block configuration has been saved.'), t('Block title set.'));
   }
 
@@ -142,8 +142,8 @@ class NonDefaultBlockAdmin extends Drupa
   function testNnonDefaultBlockAdmin() {
     $admin_user = $this->drupalCreateUser(array('administer blocks', 'administer site configuration'));
     $this->drupalLogin($admin_user);
-    $this->drupalPost('admin/build/themes', array('status[bluemarine]' => 1), t('Save configuration'));
-    $this->drupalGet('admin/build/block/list/bluemarine');
+    $this->browser->post('admin/build/themes', array('status[bluemarine]' => 1), t('Save configuration'));
+    $this->browser->get('admin/build/block/list/bluemarine');
     $this->assertRaw('bluemarine/style.css', t('Bluemarine CSS found'));
   }
 }
Index: modules/blog/blog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/blog/blog.test,v
retrieving revision 1.5
diff -u -p -r1.5 blog.test
--- modules/blog/blog.test	25 Nov 2008 13:14:26 -0000	1.5
+++ modules/blog/blog.test	30 Nov 2008 16:22:03 -0000
@@ -34,7 +34,7 @@ class BlogTestCase extends DrupalWebTest
     // Enable the recent blog block.
     $edit = array();
     $edit['blog_recent[region]'] = 'right';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
     $this->assertResponse(200);
 
     // Do basic tests for each user.
@@ -92,7 +92,7 @@ class BlogTestCase extends DrupalWebTest
     $response2 = ($admin) ? 200 : 403;
 
     // View blog help node.
-    $this->drupalGet('admin/help/blog');
+    $this->browser->get('admin/help/blog');
     $this->assertResponse($response2);
     if ($response2 == 200) {
       $this->assertTitle(t('Blog | Drupal'), t('Blog help node was displayed'));
@@ -101,18 +101,18 @@ class BlogTestCase extends DrupalWebTest
     }
 
     // Verify the blog block was displayed.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertResponse(200);
     $this->assertText(t('Recent blog posts'), t('Blog block was displayed'));
 
     // View blog node.
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertResponse(200);
     $this->assertTitle($node->title. ' | Drupal', t('Blog node was displayed'));
     $this->assertText(t('Home ' . $crumb . ' Blogs ' . $crumb . ' @name' . $quote . 's blog', array('@name' => $node_user->name)), t('Breadcrumbs were displayed'));
 
     // View blog edit node.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->browser->get('node/' . $node->nid . '/edit');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertTitle($node->title. ' | Drupal', t('Blog edit node was displayed'));
@@ -124,11 +124,11 @@ class BlogTestCase extends DrupalWebTest
       $edit = array();
       $edit['title'] = 'node/' . $node->nid;
       $edit['body'] = $this->randomName(256);
-      $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+      $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
       $this->assertRaw(t('Blog entry %title has been updated.', array('%title' => $edit['title'])), t('Blog node was edited'));
 
       // Delete blog node.
-      $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
+      $this->browser->post('node/' . $node->nid . '/delete', array(), t('Delete'));
       $this->assertResponse($response);
       $this->assertRaw(t('Blog entry %title has been deleted.', array('%title' => $edit['title'])), t('Blog node was deleted'));
     }
@@ -144,31 +144,31 @@ class BlogTestCase extends DrupalWebTest
     $crumb = '›';
 
     // Confirm blog entries link exists on the user page.
-    $this->drupalGet('user/' . $user->uid);
+    $this->browser->get('user/' . $user->uid);
     $this->assertResponse(200);
     $this->assertText(t('View recent blog entries'), t('View recent blog entries link was displayed'));
 
     // Confirm the recent blog entries link goes to the user's blog page.
-    $this->clickLink('View recent blog entries');
+    $this->browser->clickLink('View recent blog entries');
     $this->assertTitle(t("@name's blog | Drupal", array('@name' => $user->name)), t('View recent blog entries link target was correct'));
 
     // Confirm a blog page was displayed.
-    $this->drupalGet('blog');
+    $this->browser->get('blog');
     $this->assertResponse(200);
     $this->assertTitle('Blogs | Drupal', t('Blog page was displayed'));
     $this->assertText(t('Home'), t('Breadcrumbs were displayed'));
 
     // Confirm a blog page was displayed per user.
-    $this->drupalGet('blog/' . $user->uid);
+    $this->browser->get('blog/' . $user->uid);
     $this->assertTitle(t("@name's blog | Drupal", array('@name' => $user->name)), t('User blog node was displayed'));
     $this->assertText(t('Home ' . $crumb . ' Blogs'), t('Breadcrumbs were displayed'));
 
     // Confirm a blog feed was displayed.
-    $this->drupalGet('blog/feed');
+    $this->browser->get('blog/feed');
     $this->assertTitle(t('Drupal blogs'), t('Blog feed was displayed'));
 
     // Confirm a blog feed was displayed per user.
-    $this->drupalGet('blog/' . $user->uid . '/feed');
+    $this->browser->get('blog/' . $user->uid . '/feed');
     $this->assertTitle(t("@name's blog", array('@name' => $user->name)), t('User blog feed was displayed'));
   }
 }
Index: modules/blogapi/blogapi.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/blogapi/blogapi.test,v
retrieving revision 1.7
diff -u -p -r1.7 blogapi.test
--- modules/blogapi/blogapi.test	25 Nov 2008 13:14:26 -0000	1.7
+++ modules/blogapi/blogapi.test	30 Nov 2008 16:22:03 -0000
@@ -79,8 +79,8 @@ class BlogAPITestCase extends DrupalWebT
     $url = (array_key_exists('url', $result) ? $result['url'] : '');
 
     // Check uploaded file.
-    $this->drupalGet($url);
-    $this->assertEqual($this->drupalGetContent(), $file_contents, t('Uploaded contents verified.'));
+    $this->browser->get($url);
+    $this->assertEqual($this->browser->content, $file_contents, t('Uploaded contents verified.'));
 
     // Set post categories.
     $categories = array(array('categoryId' => $term));
@@ -112,7 +112,7 @@ class BlogAPITestCase extends DrupalWebT
     $edit = array();
     $edit['name'] = $vocab;
     $edit['nodes[blog]'] = TRUE;
-    $this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/add', $edit, t('Save'));
     $this->assertRaw(t('Created new vocabulary %vocab.', array('%vocab' => $edit['name'])), t('Taxonomy vocabulary added.'));
 
     $vocab_arr = taxonomy_get_vocabularies();
@@ -141,7 +141,7 @@ class BlogAPITestCase extends DrupalWebT
   function addTerm($vid, $term) {
     $edit = array();
     $edit['name'] = $term;
-    $this->drupalPost('admin/content/taxonomy/' . $vid . '/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/' . $vid . '/add', $edit, t('Save'));
     $this->assertRaw(t('Created new term %term.', array('%term' => $edit['name'])), t('Taxonomy term added.'));
 
     $tree = taxonomy_get_tree($vid);
Index: modules/book/book.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/book/book.test,v
retrieving revision 1.4
diff -u -p -r1.4 book.test
--- modules/book/book.test	25 Nov 2008 13:14:26 -0000	1.4
+++ modules/book/book.test	30 Nov 2008 16:22:03 -0000
@@ -75,7 +75,7 @@ class BookTestCase extends DrupalWebTest
    */
   function checkBookNode($node, $nodes, $previous = false, $up = false, $next = false) {
     static $number = 0;
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
 
     // Check outline structure.
     if ($nodes !== NULL) {
@@ -99,7 +99,7 @@ class BookTestCase extends DrupalWebTest
     }
 
     // Check printer friendly version.
-    $this->drupalGet('book/export/html/' . $node->nid);
+    $this->browser->get('book/export/html/' . $node->nid);
     $this->assertText($node->title, t('Printer friendly title found.'));
     $node->body = str_replace('<!--break-->', '', $node->body);
     $this->assertRaw(check_markup($node->body, $node->format), t('Printer friendly body found.'));
@@ -136,13 +136,13 @@ class BookTestCase extends DrupalWebTest
     $edit['book[bid]'] = $book_nid;
 
     if ($parent !== NULL) {
-      $this->drupalPost('node/add/book', $edit, t('Change book (update list of parents)'));
+      $this->browser->post('node/add/book', $edit, t('Change book (update list of parents)'));
 
       $edit['book[plid]'] = $parent;
-      $this->drupalPost(NULL, $edit, t('Save'));
+      $this->browser->post(NULL, $edit, t('Save'));
     }
     else {
-      $this->drupalPost('node/add/book', $edit, t('Save'));
+      $this->browser->post('node/add/book', $edit, t('Save'));
     }
 
     // Check to make sure the book node was created.
Index: modules/comment/comment.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/comment/comment.test,v
retrieving revision 1.20
diff -u -p -r1.20 comment.test
--- modules/comment/comment.test	28 Nov 2008 09:34:42 -0000	1.20
+++ modules/comment/comment.test	30 Nov 2008 16:22:03 -0000
@@ -36,17 +36,17 @@ class CommentHelperCase extends DrupalWe
     }
 
     if ($node !== NULL) {
-      $this->drupalGet('comment/reply/' . $node->nid);
+      $this->browser->get('comment/reply/' . $node->nid);
     }
 
     if ($preview) {
       $this->assertNoFieldByName('op', t('Save'), t('Save button not found.')); // Preview required so no save button should be found.
-      $this->drupalPost(NULL, $edit, t('Preview'));
+      $this->browser->post(NULL, $edit, t('Preview'));
     }
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $match = array();
     // Get comment ID
-    preg_match('/#comment-([^"]+)/', $this->getURL(), $match);
+    preg_match('/#comment-([^"]+)/', $this->browser->url, $match);
 
     // Get comment.
     if ($contact !== TRUE) { // If true then attempting to find error message.
@@ -76,7 +76,7 @@ class CommentHelperCase extends DrupalWe
       $regex .= $comment->comment . '(.*?)'; // Match comment.
       $regex .= '<\/div>/s'; // Dot matches newlines and ensure that match doesn't bleed outside comment div.
 
-      return (boolean)preg_match($regex, $this->drupalGetContent());
+      return (boolean)preg_match($regex, $this->browser->content);
     }
     else {
       return FALSE;
@@ -90,7 +90,7 @@ class CommentHelperCase extends DrupalWe
    *   Comment to delete.
    */
   function deleteComment($comment) {
-    $this->drupalPost('comment/delete/' . $comment->id, array(), t('Delete'));
+    $this->browser->post('comment/delete/' . $comment->id, array(), t('Delete'));
     $this->assertText(t('The comment and all its replies have been deleted.'), t('Comment deleted.'));
   }
 
@@ -172,7 +172,7 @@ class CommentHelperCase extends DrupalWe
     $edit['1[access comments]'] = $enabled;
     $edit['1[post comments]'] = $enabled;
     $edit['1[post comments without approval]'] = $without_approval;
-    $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
+    $this->browser->post('admin/user/permissions', $edit, t('Save permissions'));
     $this->assertText(t('The changes have been saved.'), t('Anonymous user comments ' . ($enabled ? 'enabled' : 'disabled') . '.'));
   }
 
@@ -182,7 +182,7 @@ class CommentHelperCase extends DrupalWe
    * @return boolean Contact info is available.
    */
   function commentContactInfoAvailable() {
-    return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->drupalGetContent());
+    return preg_match('/(input).*?(name="name").*?(input).*?(name="mail").*?(input).*?(name="homepage")/s', $this->browser->content);
   }
 
   /**
@@ -199,10 +199,10 @@ class CommentHelperCase extends DrupalWe
     $edit = array();
     $edit['operation'] = $operation;
     $edit['comments[' . $comment->id . ']'] = TRUE;
-    $this->drupalPost('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
+    $this->browser->post('admin/content/comment' . ($approval ? '/approval' : ''), $edit, t('Update'));
 
     if ($operation == 'delete') {
-      $this->drupalPost(NULL, array(), t('Delete comments'));
+      $this->browser->post(NULL, array(), t('Delete comments'));
       $this->assertText(t('The comments have been deleted.'), t('Operation "' . $operation . '" was performed on comment.'));
     }
     else {
@@ -219,8 +219,8 @@ class CommentHelperCase extends DrupalWe
    *   Comment id.
    */
   function getUnapprovedComment($subject) {
-    $this->drupalGet('admin/content/comment/approval');
-    preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->drupalGetContent(), $match);
+    $this->browser->get('admin/content/comment/approval');
+    preg_match('/href="(.*?)#comment-([^"]+)"(.*?)>(' . $subject . ')/', $this->browser->content, $match);
 
     return $match[2];
   }
@@ -247,7 +247,7 @@ class CommentInterfaceTest extends Comme
 
     // Post comment without subject.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertNoFieldByName('subject', '', t('Subject field not found.'));
 
     // Set comments to have subject and preview to required.
@@ -266,12 +266,12 @@ class CommentInterfaceTest extends Comme
     $this->assertTrue($this->commentExists($comment), t('Comment found.'));
 
     // Check comment display.
-    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id);
+    $this->browser->get('node/' . $this->node->nid . '/' . $comment->id);
     $this->assertText($subject_text, t('Individual comment subject found.'));
     $this->assertText($comment_text, t('Individual comment body found.'));
 
     // Reply to comment.
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $this->browser->get('comment/reply/' . $this->node->nid . '/' . $comment->id);
     $this->assertText($subject_text, t('Individual comment-reply subject found.'));
     $this->assertText($comment_text, t('Individual comment-reply body found.'));
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
@@ -281,7 +281,7 @@ class CommentInterfaceTest extends Comme
     $this->assertEqual(rtrim($comment_loaded->thread,'/').'.00/', $reply_loaded->thread, t('Thread of reply grows correctly.'));
 
     // Second reply to comment
-    $this->drupalGet('comment/reply/' . $this->node->nid . '/' . $comment->id);
+    $this->browser->get('comment/reply/' . $this->node->nid . '/' . $comment->id);
     $this->assertText($subject_text, t('Individual comment-reply subject found.'));
     $this->assertText($comment_text, t('Individual comment-reply body found.'));
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
@@ -290,41 +290,41 @@ class CommentInterfaceTest extends Comme
     $this->assertEqual(rtrim($comment_loaded->thread,'/').'.01/', $reply_loaded->thread, t('Thread of second reply grows correctly.'));
 
     // Edit reply.
-    $this->drupalGet('comment/edit/' . $reply->id);
+    $this->browser->get('comment/edit/' . $reply->id);
     $reply = $this->postComment(NULL, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($reply, TRUE), t('Modified reply found.'));
 
     // Correct link count
-    $this->drupalGet('node');
+    $this->browser->get('node');
     $this->assertRaw('3 comments', t('Link to the 3 comments exist.'));
 
     // Pager
     $this->setCommentsPerPage(2);
     $comment_new_page = $this->postComment($this->node, $this->randomName(), $this->randomName());
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->browser->get('node/' . $this->node->nid);
     $this->assertTrue($this->commentExists($comment) && $this->commentExists($comment_new_page), t('Page one exists. %s'));
-    $this->drupalGet('node/' . $this->node->nid, array('query' => 'page=1'));
+    $this->browser->get('node/' . $this->node->nid, array('query' => 'page=1'));
     $this->assertTrue($this->commentExists($reply, TRUE), t('Page two exists. %s'));
     $this->setCommentsPerPage(50);
 
     // Attempt to post to node with comments disabled.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_DISABLED));
     $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertText('This discussion is closed', t('Posting to node with comments disabled'));
     $this->assertNoField('edit-comment', t('Comment body field found.'));
 
     // Attempt to post to node with read-only comments.
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_READ_ONLY));
     $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertText('This discussion is closed', t('Posting to node with comments read-only'));
     $this->assertNoField('edit-comment', t('Comment body field found.'));
 
     // Attempt to post to node with comments enabled (check field names etc).
     $this->node = $this->drupalCreateNode(array('type' => 'article', 'promote' => 1, 'comment' => COMMENT_NODE_READ_WRITE));
     $this->assertTrue($this->node, t('Article node created.'));
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertNoText('This discussion is closed', t('Posting to node with comments enabled'));
     $this->assertField('edit-comment', t('Comment body field found.'));
 
@@ -334,7 +334,7 @@ class CommentInterfaceTest extends Comme
     $this->deleteComment($comment);
     $this->deleteComment($comment_new_page);
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->browser->get('node/' . $this->node->nid);
     $this->assertFalse($this->commentExists($comment), t('Comment not found.'));
     $this->assertFalse($this->commentExists($reply, TRUE), t('Reply not found.'));
   }
@@ -360,7 +360,7 @@ class CommentNodePage extends CommentHel
 
     // Submit comment through node form.
     $this->drupalLogin($this->web_user);
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->browser->get('node/' . $this->node->nid);
     $form_comment = $this->postComment(NULL, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($form_comment), t('Form comment found.'));
 
@@ -400,13 +400,13 @@ class CommentAnonymous extends CommentHe
     $this->setCommentAnonymous('1');
 
     // Attempt to edit anonymous comment.
-    $this->drupalGet('comment/edit/' . $anonymous_comment1->id);
+    $this->browser->get('comment/edit/' . $anonymous_comment1->id);
     $edited_comment = $this->postComment(NULL, $this->randomName(), $this->randomName());
     $this->assertTrue($this->commentExists($edited_comment, FALSE), t('Modified reply found.'));
     $this->drupalLogout();
 
     // Post anonymous comment with contact info (optional).
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertTrue($this->commentContactInfoAvailable(), t('Contact information available.'));
 
     $anonymous_comment2 = $this->postComment($this->node, $this->randomName(), $this->randomName());
@@ -418,7 +418,7 @@ class CommentAnonymous extends CommentHe
     $this->drupalLogout();
 
     // Try to post comment with contact info (required).
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertTrue($this->commentContactInfoAvailable(), t('Contact information available.'));
 
     $anonymous_comment3 = $this->postComment($this->node, $this->randomName(), $this->randomName(), TRUE, TRUE);
@@ -433,19 +433,19 @@ class CommentAnonymous extends CommentHe
     $this->drupalLogin($this->admin_user);
     $this->performCommentOperation($anonymous_comment3, 'unpublish');
 
-    $this->drupalGet('admin/content/comment/approval');
+    $this->browser->get('admin/content/comment/approval');
     $this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was unpublished.'));
 
     // Publish comment.
     $this->performCommentOperation($anonymous_comment3, 'publish', TRUE);
 
-    $this->drupalGet('admin/content/comment');
+    $this->browser->get('admin/content/comment');
     $this->assertRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was published.'));
 
     // Delete comment.
     $this->performCommentOperation($anonymous_comment3, 'delete');
 
-    $this->drupalGet('admin/content/comment');
+    $this->browser->get('admin/content/comment');
     $this->assertNoRaw('comments[' . $anonymous_comment3->id . ']', t('Comment was deleted.'));
 
     // Reset.
@@ -456,12 +456,12 @@ class CommentAnonymous extends CommentHe
     // NOTE: if authenticated user has permission to post comments, then a
     // "Login or register to post comments" type link may be shown.
     $this->drupalLogout();
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->browser->get('node/' . $this->node->nid);
     $this->assertNoRaw('<div id="comments">', t('Comments were not displayed.'));
     $this->assertNoLink('Add new comment', t('Link to add comment was found.'));
 
     // Attempt to view node-comment form while disallowed.
-    $this->drupalGet('comment/reply/' . $this->node->nid);
+    $this->browser->get('comment/reply/' . $this->node->nid);
     $this->assertText('You are not authorized to view comments', t('Error attempting to post comment.'));
     $this->assertNoFieldByName('subject', '', t('Subject field not found.'));
     $this->assertNoFieldByName('comment', '', t('Comment field not found.'));
@@ -507,7 +507,7 @@ class CommentApprovalTest extends Commen
     $this->performCommentOperation($anonymous_comment4, 'publish', TRUE);
     $this->drupalLogout();
 
-    $this->drupalGet('node/' . $this->node->nid);
+    $this->browser->get('node/' . $this->node->nid);
     $this->assertTrue($this->commentExists($anonymous_comment4), t('Anonymous comment visible.'));
   }
 
@@ -538,11 +538,11 @@ class CommentApprovalTest extends Commen
 
     // Approve comment.
     $this->drupalLogin($this->admin_user);
-    $this->drupalGet('node/'. $this->node->nid);
-    $this->clickLink(t('approve'));
+    $this->browser->get('node/'. $this->node->nid);
+    $this->browser->clickLink(t('approve'));
     $this->drupalLogout();
 
-    $this->drupalGet('node/'. $this->node->nid);
+    $this->browser->get('node/'. $this->node->nid);
     $this->assertTrue($this->commentExists($anonymous_comment4), t('Anonymous comment visible.'));
   }
 }
Index: modules/contact/contact.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/contact/contact.test,v
retrieving revision 1.13
diff -u -p -r1.13 contact.test
--- modules/contact/contact.test	25 Nov 2008 13:14:26 -0000	1.13
+++ modules/contact/contact.test	30 Nov 2008 16:22:03 -0000
@@ -31,7 +31,7 @@ class ContactSitewideTestCase extends Dr
     $edit['contact_form_information'] = $contact_form_information;
     $edit['contact_hourly_threshold'] = 3;
     $edit['contact_default_status'] = TRUE;
-    $this->drupalPost('admin/build/contact/settings', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/contact/settings', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Setting successfully saved.'));
 
     // Delete old categories to ensure that new categories are used.
@@ -40,7 +40,7 @@ class ContactSitewideTestCase extends Dr
     // Ensure that the contact form won't be shown without categories.
     $this->setPermission('anonymous user', array('access site-wide contact form' => TRUE));
     $this->drupalLogout();
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertText(t('The contact form has not been configured.'), t('Contact form will not work without categories configured.'));
     $this->drupalLogin($admin_user);
 
@@ -75,7 +75,7 @@ class ContactSitewideTestCase extends Dr
     // Ensure that the contact form is shown without a category selection input.
     $this->setPermission('anonymous user', array('access site-wide contact form' => TRUE));
     $this->drupalLogout();
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertText($contact_form_information, t('Contact form is shown when there is one category.'));
     $this->assertNoText(t('Category'), t('When there is only one category, the category selection element is hidden.'));
     $this->drupalLogin($admin_user);
@@ -94,7 +94,7 @@ class ContactSitewideTestCase extends Dr
     $this->setPermission('anonymous user', array('access site-wide contact form' => FALSE));
     $this->drupalLogout();
 
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertResponse(403, t('Access denied to anonymous user without permission.'));
 
     // Give anonymous user permission and see that page is viewable.
@@ -102,7 +102,7 @@ class ContactSitewideTestCase extends Dr
     $this->setPermission('anonymous user', array('access site-wide contact form' => TRUE));
     $this->drupalLogout();
 
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertResponse(200, t('Access granted to anonymous user with permission.'));
 
     // Check that "Additional information" is displayed on the page.
@@ -126,7 +126,7 @@ class ContactSitewideTestCase extends Dr
 
     // Test contact form with no default category selected.
     db_query('UPDATE {contact} SET selected = 0');
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertRaw(t('- Please choose -'), t('Without selected categories the visitor is asked to chose a category.'));
 
     // Submit contact form with invalid category id (cid 0).
@@ -139,7 +139,7 @@ class ContactSitewideTestCase extends Dr
       $this->assertText(t('Your message has been sent.'), t('Message sent.'));
     }
     // Submit contact form one over limit.
-    $this->drupalGet('contact');
+    $this->browser->get('contact');
     $this->assertRaw(t('You cannot send more than %number messages per hour. Please try again later.', array('%number' => $edit['contact_hourly_threshold'])), t('Message threshold reached.'));
 
     // Delete created categories.
@@ -161,7 +161,7 @@ class ContactSitewideTestCase extends Dr
     $edit['recipients'] = $recipients;
     $edit['reply'] = $reply;
     $edit['selected'] = ($selected ? '1' : '0');
-    $this->drupalPost('admin/build/contact/add', $edit, t('Save'));
+    $this->browser->post('admin/build/contact/add', $edit, t('Save'));
   }
 
   /**
@@ -179,7 +179,7 @@ class ContactSitewideTestCase extends Dr
     $edit['recipients'] = $recipients;
     $edit['reply'] = $reply;
     $edit['selected'] = ($selected ? '1' : '0');
-    $this->drupalPost('admin/build/contact/edit/' . $category_id, $edit, t('Save'));
+    $this->browser->post('admin/build/contact/edit/' . $category_id, $edit, t('Save'));
     return($category_id);
   }
 
@@ -199,7 +199,7 @@ class ContactSitewideTestCase extends Dr
     $edit['subject'] = $subject;
     $edit['cid'] = $cid;
     $edit['message'] = $message;
-    $this->drupalPost('contact', $edit, t('Send e-mail'));
+    $this->browser->post('contact', $edit, t('Send e-mail'));
   }
 
   /**
@@ -209,7 +209,7 @@ class ContactSitewideTestCase extends Dr
     $categories = $this->getCategories();
     foreach ($categories as $category) {
       $category_name = db_result(db_query('SELECT category FROM {contact} WHERE cid = %d', array($category)));
-      $this->drupalPost('admin/build/contact/delete/' . $category, array(), t('Delete'));
+      $this->browser->post('admin/build/contact/delete/' . $category, array(), t('Delete'));
       $this->assertRaw(t('Category %category has been deleted.', array('%category' => $category_name)), t('Category deleted sucessfully.'));
     }
   }
@@ -247,7 +247,7 @@ class ContactSitewideTestCase extends Dr
       $edit[$rid . '[' . $name . ']'] = $value;
     }
 
-    $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
+    $this->browser->post('admin/user/permissions', $edit, t('Save permissions'));
     $this->assertText(t('The changes have been saved.'), t(' [permission] Saved changes.'));
   }
 }
@@ -280,7 +280,7 @@ class ContactPersonalTestCase extends Dr
     $edit = array();
     $edit['contact_default_status'] = TRUE;
     $edit['contact_hourly_threshold'] = $flood_control;
-    $this->drupalPost('admin/build/contact/settings', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/contact/settings', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Setting successfully saved.'));
 
     // Reload variables.
@@ -292,13 +292,13 @@ class ContactPersonalTestCase extends Dr
 
     $this->drupalLogin($web_user1);
 
-    $this->drupalGet('user/' . $web_user2->uid . '/contact');
+    $this->browser->get('user/' . $web_user2->uid . '/contact');
     $this->assertResponse(200, t('Access to personal contact form granted.'));
 
     $edit = array();
     $edit['subject'] = $this->randomName(16);
     $edit['message'] = $this->randomName(64);
-    $this->drupalPost(NULL, $edit, t('Send e-mail'));
+    $this->browser->post(NULL, $edit, t('Send e-mail'));
     $this->assertText(t('The message has been sent.'), t('Message sent.'));
 
     // Clear flood table in preparation for flood test and allow other checks to complete.
@@ -306,13 +306,13 @@ class ContactPersonalTestCase extends Dr
 
     // Submit contact form with correct values and check flood interval.
     for ($i = 0; $i < $flood_control; $i++) {
-      $this->drupalGet('user/' . $web_user2->uid . '/contact');
-      $this->drupalPost(NULL, $edit, t('Send e-mail'));
+      $this->browser->get('user/' . $web_user2->uid . '/contact');
+      $this->browser->post(NULL, $edit, t('Send e-mail'));
       $this->assertText(t('The message has been sent.'), t('Message sent.'));
     }
 
     // Submit contact form one over limit.
-    $this->drupalGet('user/' . $web_user2->uid . '/contact');
+    $this->browser->get('user/' . $web_user2->uid . '/contact');
     $this->assertRaw(t('You cannot send more than %number messages per hour. Please try again later.', array('%number' => $flood_control)), t('Message threshold reached.'));
 
     $this->drupalLogout();
@@ -322,7 +322,7 @@ class ContactPersonalTestCase extends Dr
     // Disable the personal contact form.
     $edit = array();
     $edit['contact_default_status'] = FALSE;
-    $this->drupalPost('admin/build/contact/settings', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/contact/settings', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Setting successfully saved.'));
 
     // Reload variables.
@@ -334,7 +334,7 @@ class ContactPersonalTestCase extends Dr
 
     $this->drupalLogin($web_user3);
 
-    $this->drupalGet('user/' . $web_user4->uid . '/contact');
+    $this->browser->get('user/' . $web_user4->uid . '/contact');
     $this->assertResponse(403, t('Access to personal contact form denied.'));
   }
 }
Index: modules/dblog/dblog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/dblog/dblog.test,v
retrieving revision 1.10
diff -u -p -r1.10 dblog.test
--- modules/dblog/dblog.test	25 Nov 2008 13:14:27 -0000	1.10
+++ modules/dblog/dblog.test	30 Nov 2008 16:22:03 -0000
@@ -50,7 +50,7 @@ class DBLogTestCase extends DrupalWebTes
     // Change the dblog row limit.
     $edit = array();
     $edit['dblog_row_limit'] = $row_limit;
-    $this->drupalPost('admin/settings/logging/dblog', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/logging/dblog', $edit, t('Save configuration'));
     $this->assertResponse(200);
 
     // Check row limit variable.
@@ -74,7 +74,7 @@ class DBLogTestCase extends DrupalWebTes
     $this->assertTrue($count > $row_limit, t('Dblog row count of @count exceeds row limit of @limit', array('@count' => $count, '@limit' => $row_limit)));
 
     // Run cron job.
-    $this->drupalGet('admin/reports/status/run-cron');
+    $this->browser->get('admin/reports/status/run-cron');
     $this->assertResponse(200);
     $this->assertText(t('Cron ran successfully'), t('Cron ran successfully'));
     // Verify dblog row count equals row limit plus one because cron adds a record after it runs.
@@ -119,35 +119,35 @@ class DBLogTestCase extends DrupalWebTes
     $quote = '&#039;';
 
     // View dblog help node.
-    $this->drupalGet('admin/help/dblog');
+    $this->browser->get('admin/help/dblog');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Database logging'), t('DBLog help was displayed'));
     }
 
     // View dblog report node.
-    $this->drupalGet('admin/reports/dblog');
+    $this->browser->get('admin/reports/dblog');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Recent log entries'), t('DBLog report was displayed'));
     }
 
     // View dblog page-not-found report node.
-    $this->drupalGet('admin/reports/page-not-found');
+    $this->browser->get('admin/reports/page-not-found');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Top ' . $quote . 'page not found' . $quote . ' errors'), t('DBLog page-not-found report was displayed'));
     }
 
     // View dblog access-denied report node.
-    $this->drupalGet('admin/reports/access-denied');
+    $this->browser->get('admin/reports/access-denied');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Top ' . $quote . 'access denied' . $quote . ' errors'), t('DBLog access-denied report was displayed'));
     }
 
     // View dblog event node.
-    $this->drupalGet('admin/reports/event/1');
+    $this->browser->get('admin/reports/event/1');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Details'), t('DBLog event node was displayed'));
@@ -185,7 +185,7 @@ class DBLogTestCase extends DrupalWebTes
     $edit['pass[pass1]'] = $pass;
     $edit['pass[pass2]'] = $pass;
     $edit['status'] = 1;
-    $this->drupalPost('admin/user/user/create', $edit, t('Create new account'));
+    $this->browser->post('admin/user/user/create', $edit, t('Create new account'));
     $this->assertResponse(200);
     // Retrieve user object.
     $user = user_load(array('name' => $name)); //, 'pass' => $pass, 'status' => 1));
@@ -228,7 +228,7 @@ class DBLogTestCase extends DrupalWebTes
     // Login the admin user.
     $this->drupalLogin($this->big_user);
     // View the dblog report.
-    $this->drupalGet('admin/reports/dblog');
+    $this->browser->get('admin/reports/dblog');
     $this->assertResponse(200);
 
     // Verify events were recorded.
@@ -259,29 +259,29 @@ class DBLogTestCase extends DrupalWebTes
     // Create node using form to generate add content event (which is not triggered by drupalCreateNode).
     $edit = $this->getContent($type);
     $title = $edit['title'];
-    $this->drupalPost('node/add/' . $type, $edit, t('Save'));
+    $this->browser->post('node/add/' . $type, $edit, t('Save'));
     $this->assertResponse(200);
     // Retrieve node object.
     $node = node_load(array('title' => $title));
     $this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title)));
     // Edit node.
     $edit = $this->getContentUpdate($type);
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
     $this->assertResponse(200);
     // Delete node.
-    $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
+    $this->browser->post('node/' . $node->nid . '/delete', array(), t('Delete'));
     $this->assertResponse(200);
     // View node (to generate page not found event).
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertResponse(404);
     // View the dblog report (to generate access denied event).
-    $this->drupalGet('admin/reports/dblog');
+    $this->browser->get('admin/reports/dblog');
     $this->assertResponse(403);
 
     // Login the admin user.
     $this->drupalLogin($this->big_user);
     // View the dblog report.
-    $this->drupalGet('admin/reports/dblog');
+    $this->browser->get('admin/reports/dblog');
     $this->assertResponse(200);
 
     // Verify events were recorded.
@@ -293,13 +293,13 @@ class DBLogTestCase extends DrupalWebTes
     $this->assertRaw(t('@type: deleted %title', array('@type' => $type, '%title' => $title)), t('DBLog event was recorded: [content deleted]'));
 
     // View dblog access-denied report node.
-    $this->drupalGet('admin/reports/access-denied');
+    $this->browser->get('admin/reports/access-denied');
     $this->assertResponse(200);
     // Access denied.
     $this->assertText(t('admin/reports/dblog'), t('DBLog event was recorded: [access denied]'));
 
     // View dblog page-not-found report node.
-    $this->drupalGet('admin/reports/page-not-found');
+    $this->browser->get('admin/reports/page-not-found');
     $this->assertResponse(200);
     // Page not found.
     $this->assertText(t('node/@nid', array('@nid' => $node->nid)), t('DBLog event was recorded: [page not found]'));
Index: modules/filter/filter.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/filter/filter.test,v
retrieving revision 1.9
diff -u -p -r1.9 filter.test
--- modules/filter/filter.test	25 Nov 2008 13:14:27 -0000	1.9
+++ modules/filter/filter.test	30 Nov 2008 16:22:03 -0000
@@ -28,7 +28,7 @@ class FilterAdminTestCase extends Drupal
     // Change default filter.
     $edit = array();
     $edit['default'] = $full;
-    $this->drupalPost('admin/settings/filters', $edit, t('Save changes'));
+    $this->browser->post('admin/settings/filters', $edit, t('Save changes'));
     $this->assertText(t('Default format updated.'), t('Default filter updated successfully.'));
 
     $this->assertNoRaw('admin/settings/filters/delete/' . $full, t('Delete link not found.'));
@@ -36,7 +36,7 @@ class FilterAdminTestCase extends Drupal
     // Add an additional tag.
     $edit = array();
     $edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>' . ' <quote>'; // Adding <quote> tag.
-    $this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Allowed HTML tag added.'));
 
     $this->assertRaw(htmlentities($edit['allowed_html_1']), t('Tag displayed.'));
@@ -48,7 +48,7 @@ class FilterAdminTestCase extends Drupal
     $edit = array();
     $edit['weights[filter/' . $second_filter . ']'] = 1;
     $edit['weights[filter/' . $first_filter . ']'] = 2;
-    $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
     $this->assertText(t('The filter ordering has been saved.'), t('Order saved successfully.'));
 
     $result = db_query('SELECT * FROM {filters} WHERE format = %d ORDER BY weight ASC', $filtered);
@@ -66,7 +66,7 @@ class FilterAdminTestCase extends Drupal
     $edit['roles[2]'] = TRUE;
     $edit['filters[filter/' . $second_filter . ']'] = TRUE;
     $edit['filters[filter/' . $first_filter . ']'] = TRUE;
-    $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/add', $edit, t('Save configuration'));
     $this->assertRaw(t('Added input format %format.', array('%format' => $edit['name'])), t('New filter created.'));
 
     $format = $this->getFilter($edit['name']);
@@ -78,14 +78,14 @@ class FilterAdminTestCase extends Drupal
       $this->assertFieldByName('filters[filter/' . $first_filter . ']', '', t('Url filter found.'));
 
       // Delete new filter.
-      $this->drupalPost('admin/settings/filters/delete/' . $format->format, array(), t('Delete'));
+      $this->browser->post('admin/settings/filters/delete/' . $format->format, array(), t('Delete'));
       $this->assertRaw(t('Deleted input format %format.', array('%format' => $edit['name'])), t('Format successfully deleted.'));
     }
 
     // Change default filter back.
     $edit = array();
     $edit['default'] = $filtered;
-    $this->drupalPost('admin/settings/filters', $edit, t('Save changes'));
+    $this->browser->post('admin/settings/filters', $edit, t('Save changes'));
     $this->assertText(t('Default format updated.'), t('Default filter updated successfully.'));
 
     $this->assertNoRaw('admin/settings/filters/delete/' . $filtered, t('Delete link not found.'));
@@ -93,14 +93,14 @@ class FilterAdminTestCase extends Drupal
     // Allow authenticated users on full HTML.
     $edit = array();
     $edit['roles[2]'] = TRUE;
-    $this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $full, $edit, t('Save configuration'));
     $this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully updated.'));
 
     // Switch user.
     $this->drupalLogout();
     $this->drupalLogin($web_user);
 
-    $this->drupalGet('node/add/page');
+    $this->browser->get('node/add/page');
     $this->assertFieldByName('body_format', $full, t('Full HTML filter accessible.'));
 
     // Use filtered HTML and see if it removes tags that arn't allowed.
@@ -111,13 +111,13 @@ class FilterAdminTestCase extends Drupal
     $edit['title'] = $this->randomName();
     $edit['body'] = $body . '<random>' . $extra_text . '</random>';
     $edit['body_format'] = $filtered;
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been created.', array('%title' => $edit['title'])), t('Filtered node created.'));
 
     $node = node_load(array('title' => $edit['title']));
     $this->assertTrue($node, t('Node found in database.'));
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertText($body . $extra_text, t('Filter removed invalid tag.'));
 
     // Switch user.
@@ -128,20 +128,20 @@ class FilterAdminTestCase extends Drupal
     // Allowed tags.
     $edit = array();
     $edit['allowed_html_1'] = '<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>';
-    $this->drupalPost('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $filtered . '/configure', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Changes reverted.'));
 
     // Full HTML.
     $edit = array();
     $edit['roles[2]'] = FALSE;
-    $this->drupalPost('admin/settings/filters/' . $full, $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $full, $edit, t('Save configuration'));
     $this->assertText(t('The input format settings have been updated.'), t('Full HTML format successfully reverted.'));
 
     // Filter order.
     $edit = array();
     $edit['weights[filter/' . $second_filter . ']'] = 2;
     $edit['weights[filter/' . $first_filter . ']'] = 1;
-    $this->drupalPost('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/' . $filtered . '/order', $edit, t('Save configuration'));
     $this->assertText(t('The filter ordering has been saved.'), t('Order successfully reverted.'));
   }
 
@@ -216,14 +216,14 @@ class FilterTestCase extends DrupalWebTe
       'roles[2]' => TRUE,
       'filters[filter/' . $filter . ']' => TRUE,
     );
-    $this->drupalPost('admin/settings/filters/add', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/filters/add', $edit, t('Save configuration'));
     return db_fetch_object(db_query("SELECT * FROM {filter_formats} WHERE name = '%s'", $edit['name']));
   }
 
   function deleteFormat($format) {
     if ($format !== NULL) {
       // Delete new filter.
-      $this->drupalPost('admin/settings/filters/delete/' . $format->format, array(), t('Delete'));
+      $this->browser->post('admin/settings/filters/delete/' . $format->format, array(), t('Delete'));
     }
   }
 }
Index: modules/forum/forum.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/forum/forum.test,v
retrieving revision 1.7
diff -u -p -r1.7 forum.test
--- modules/forum/forum.test	25 Nov 2008 13:14:27 -0000	1.7
+++ modules/forum/forum.test	30 Nov 2008 16:22:03 -0000
@@ -77,14 +77,14 @@ class ForumTestCase extends DrupalWebTes
     // Enable the active forum block.
     $edit = array();
     $edit['forum_active[region]'] = 'right';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
     $this->assertResponse(200);
     $this->assertText(t('The block settings have been updated.'), t('[Active forum topics] Forum block was enabled'));
 
     // Enable the new forum block.
     $edit = array();
     $edit['forum_new[region]'] = 'right';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
     $this->assertResponse(200);
     $this->assertText(t('The block settings have been updated.'), t('[New forum topics] Forum block was enabled'));
 
@@ -94,7 +94,7 @@ class ForumTestCase extends DrupalWebTes
     // Add forum to navigation menu.
     $edit = array();
     $edit['mlid:' . $mlid . '[hidden]'] = TRUE;
-    $this->drupalPost('admin/build/menu-customize/navigation', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/menu-customize/navigation', $edit, t('Save configuration'));
     $this->assertResponse(200);
 
     // Edit forum taxonomy.
@@ -128,7 +128,7 @@ class ForumTestCase extends DrupalWebTes
     );
 
     // Edit the vocabulary.
-    $this->drupalPost('admin/content/taxonomy/' . $vid, $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/' . $vid, $edit, t('Save'));
     $this->assertResponse(200);
     $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $title)), t('Vocabulary was edited'));
 
@@ -165,7 +165,7 @@ class ForumTestCase extends DrupalWebTes
     );
 
     // Create forum.
-    $this->drupalPost('admin/build/forum/add/' . $type, $edit, t('Save'));
+    $this->browser->post('admin/build/forum/add/' . $type, $edit, t('Save'));
     $this->assertResponse(200);
     $type = ($type == 'container') ? 'forum container' : 'forum';
     $this->assertRaw(t('Created new @type %term.', array('%term' => $name, '@type' => t($type))), t(ucfirst($type) . ' was created'));
@@ -223,8 +223,8 @@ class ForumTestCase extends DrupalWebTes
     // Instead, the post variables seem to pick up the first non-blank value in the select list.
 
     // Create forum topic.
-//    $this->drupalPost('node/add/forum/' . $forum['tid'], $edit, t('Save'));
-    $this->drupalPost('node/add/forum/', $edit, t('Save'));
+//    $this->browser->post('node/add/forum/' . $forum['tid'], $edit, t('Save'));
+    $this->browser->post('node/add/forum/', $edit, t('Save'));
     $type = t('Forum topic');
     if ($container) {
       $this->assertNoRaw(t('@type %title has been created.', array('@type' => $type, '%title' => $title)), t('Forum topic was not created'));
@@ -241,7 +241,7 @@ class ForumTestCase extends DrupalWebTes
     $this->assertTrue($node != null, t('Node @title was loaded', array('@title' => $title)));
 
     // View forum topic.
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertRaw($title, t('Subject was found'));
     $this->assertRaw($body, t('Body was found'));
 
@@ -263,7 +263,7 @@ class ForumTestCase extends DrupalWebTes
     $response2 = ($admin) ? 200 : 403;
 
     // View forum help node.
-    $this->drupalGet('admin/help/forum');
+    $this->browser->get('admin/help/forum');
     $this->assertResponse($response2);
     if ($response2 == 200) {
       $this->assertTitle(t('Forum | Drupal'), t('Forum help node was displayed'));
@@ -272,7 +272,7 @@ class ForumTestCase extends DrupalWebTes
     }
 
     // Verify the forum blocks were displayed.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertResponse(200);
     // This block never seems to display?
 //    $this->assertText(t('Active forum topics'), t('[Active forum topics] Forum block was displayed'));
@@ -286,13 +286,13 @@ class ForumTestCase extends DrupalWebTes
     $this->verifyForumView($this->root_forum);
 
     // View forum node.
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertResponse(200);
     $this->assertTitle($node->title . ' | Drupal', t('Forum node was displayed'));
     $this->assertText(t('Home ' . $crumb . ' Forums ' . $crumb . ' @container ' . $crumb . ' @forum', array('@container' => $this->container['name'], '@forum' => $this->forum['name'])), t('Breadcrumbs were displayed'));
 
     // View forum edit node.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->browser->get('node/' . $node->nid . '/edit');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertTitle($node->title . ' | Drupal', t('Forum edit node was displayed'));
@@ -306,7 +306,7 @@ class ForumTestCase extends DrupalWebTes
       $edit['body'] = $this->randomName(256);
       $edit['taxonomy[1]'] = $this->root_forum['tid']; // Assumes the topic is initially associated with $forum.
       $edit['shadow'] = TRUE;
-      $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+      $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
       $this->assertRaw(t('Forum topic %title has been updated.', array('%title' => $edit['title'])), t('Forum node was edited'));
 
       // Verify topic was moved to a different forum.
@@ -314,7 +314,7 @@ class ForumTestCase extends DrupalWebTes
       $this->assertTrue($forum_tid == $this->root_forum['tid'], 'The forum topic is linked to a different forum');
 
       // Delete forum node.
-      $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
+      $this->browser->post('node/' . $node->nid . '/delete', array(), t('Delete'));
       $this->assertResponse($response);
       $this->assertRaw(t('Forum topic %title has been deleted.', array('%title' => $edit['title'])), t('Forum node was deleted'));
     }
@@ -329,7 +329,7 @@ class ForumTestCase extends DrupalWebTes
     $crumb = '›';
 
     // View forum page.
-    $this->drupalGet('forum/' . $forum['tid']);
+    $this->browser->get('forum/' . $forum['tid']);
     $this->assertResponse(200);
     $this->assertTitle($forum['name'] . ' | Drupal', t('Forum node was displayed'));
     if (isset($parent)) {
@@ -363,9 +363,9 @@ class ForumTestCase extends DrupalWebTes
 
     for ($i = 0; $i < 2; $i++) {
       foreach ($nids as $nid) {
-        $this->drupalGet('node/' . $nid);
-        $this->drupalGet('node/' . $nid);
-        $this->drupalGet('node/' . $nid);
+        $this->browser->get('node/' . $nid);
+        $this->browser->get('node/' . $nid);
+        $this->browser->get('node/' . $nid);
       }
     }
   }
Index: modules/help/help.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/help/help.test,v
retrieving revision 1.3
diff -u -p -r1.3 help.test
--- modules/help/help.test	25 Nov 2008 13:14:27 -0000	1.3
+++ modules/help/help.test	30 Nov 2008 16:22:03 -0000
@@ -52,7 +52,7 @@ class HelpTestCase extends DrupalWebTest
 
     foreach ($this->modules as $module => $name) {
       // View module help node.
-      $this->drupalGet('admin/help/' . $module);
+      $this->browser->get('admin/help/' . $module);
       $this->assertResponse($response);
       if ($response == 200) {
         // NOTE: The asserts fail on blog and poll because the get returns the 'admin/help' node instead of the indicated node???
Index: modules/locale/locale.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/locale/locale.test,v
retrieving revision 1.11
diff -u -p -r1.11 locale.test
--- modules/locale/locale.test	29 Nov 2008 09:33:51 -0000	1.11
+++ modules/locale/locale.test	30 Nov 2008 16:22:03 -0000
@@ -37,14 +37,14 @@ class LocaleTestCase extends DrupalWebTe
 
     // Add language.
     $this->drupalLogin($admin_user);
-    $edit = array (
+    $edit = array(
       'langcode' => $langcode,
       'name' => $name,
       'native' => $native,
       'prefix' => $prefix,
       'direction' => '0',
     );
-    $this->drupalPost('admin/settings/language/add', $edit, t('Add custom language'));
+    $this->browser->post('admin/settings/language/add', $edit, t('Add custom language'));
     // Add string.
     t($name, array(), $langcode);
     // Reset locale cache.
@@ -65,7 +65,7 @@ class LocaleTestCase extends DrupalWebTe
       'translation' => 'all',
       'group' => 'all',
     );
-    $this->drupalPost('admin/build/translate/search', $search, t('Search'));
+    $this->browser->post('admin/build/translate/search', $search, t('Search'));
     // assertText seems to remove the input field where $name always could be
     // found, so this is not a false assert. See how assertNoText succeeds
     // later.
@@ -73,7 +73,7 @@ class LocaleTestCase extends DrupalWebTe
     $this->assertRaw($language_indicator, 'Name is untranslated');
     // It's presumed that this is the only result. Given the random name, it's
     // reasonable.
-    $this->clickLink(t('edit'));
+    $this->browser->clickLink(t('edit'));
     // We save the lid from the path.
     $lid = preg_replace('/\D/', '', substr($this->getUrl(), strlen($base_url)));
     // No t() here, it's surely not translated yet.
@@ -81,10 +81,10 @@ class LocaleTestCase extends DrupalWebTe
     $edit = array (
       "translations[$langcode]" => $translation,
     );
-    $this->drupalPost(NULL, $edit, t('Save translations'));
+    $this->browser->post(NULL, $edit, t('Save translations'));
     $this->assertText(t('The string has been saved.'), 'The string has been saved.');
     $this->assertTrue($name != $translation && t($name, array(), $langcode) == $translation, 't() works');
-    $this->drupalPost('admin/build/translate/search', $search, t('Search'));
+    $this->browser->post('admin/build/translate/search', $search, t('Search'));
     // The indicator should not be here.
     $this->assertNoRaw($language_indicator, 'String is translated');
     $this->drupalLogout();
@@ -93,7 +93,7 @@ class LocaleTestCase extends DrupalWebTe
     $this->drupalLogin($admin_user);
     $path = 'admin/settings/language/delete/' . $langcode;
     // This a confirm form, we do not need any fields changed.
-    $this->drupalPost($path, array(), t('Delete'));
+    $this->browser->post($path, array(), t('Delete'));
     // We need raw here because %locale will add HTML.
     $this->assertRaw(t('The language %locale has been removed.', array('%locale' => $name)), 'The test language has been removed.');
     // Reload to remove $name.
@@ -105,9 +105,9 @@ class LocaleTestCase extends DrupalWebTe
 
     // Delete the name string.
     $this->drupalLogin($translate_user);
-    $this->drupalPost('admin/build/translate/delete/' . $lid, array(), t('Delete'));
+    $this->browser->post('admin/build/translate/delete/' . $lid, array(), t('Delete'));
     $this->assertText(t('The string has been removed.'), 'The string has been removed message.');
-    $this->drupalPost('admin/build/translate/search', $search, t('Search'));
+    $this->browser->post('admin/build/translate/search', $search, t('Search'));
     $this->assertNoText($name, 'Search now can not find the name');
   }
 }
@@ -143,7 +143,7 @@ class LocaleImportFunctionalTest extends
     // Try importing a .po file.
     $name = tempnam(file_directory_temp(), "po_");
     file_put_contents($name, $this->getPoFile());
-    $this->drupalPost('admin/build/translate/import', array(
+    $this->browser->post('admin/build/translate/import', array(
       'langcode' => 'fr',
       'files[file]' => $name,
     ), t('Import'));
Index: modules/menu/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/menu/menu.test,v
retrieving revision 1.5
diff -u -p -r1.5 menu.test
--- modules/menu/menu.test	29 Nov 2008 09:33:51 -0000	1.5
+++ modules/menu/menu.test	30 Nov 2008 16:22:03 -0000
@@ -89,7 +89,7 @@ class MenuTestCase extends DrupalWebTest
    */
   function addCustomMenu() {
     // Add custom menu.
-    $this->drupalGet('admin/build/menu/add');
+    $this->browser->get('admin/build/menu/add');
     $menu_name = substr(md5($this->randomName(16)), 0, 20);
     $title = $this->randomName(16);
     $edit = array (
@@ -97,18 +97,18 @@ class MenuTestCase extends DrupalWebTest
       'description' => '',
       'title' =>  $title,
     );
-    $this->drupalPost('admin/build/menu/add', $edit, t('Save'));
+    $this->browser->post('admin/build/menu/add', $edit, t('Save'));
     // Unlike most other modules, there is no confirmation message displayed.
 //    $this->assertText(t('The menu settings have been updated.'), t('Menu link was added'));
 
-    $this->drupalGet('admin/build/menu');
+    $this->browser->get('admin/build/menu');
     $this->assertText($title, 'Menu created');
 
     // Enable the custom menu block.
     $menu_name = 'menu-' . $menu_name; // Drupal prepends the name with 'menu-'.
     $edit = array();
     $edit['menu_' . $menu_name . '[region]'] = 'left';
-    $this->drupalPost('admin/build/block', $edit, t('Save blocks'));
+    $this->browser->post('admin/build/block', $edit, t('Save blocks'));
     $this->assertResponse(200);
     $this->assertText(t('The block settings have been updated.'), t('Custom menu block was enabled'));
 
@@ -125,7 +125,7 @@ class MenuTestCase extends DrupalWebTest
     $title = $this->menu['title'];
 
     // Delete custom menu.
-    $this->drupalPost("admin/build/menu-customize/$menu_name/delete", array(), t('Delete'));
+    $this->browser->post("admin/build/menu-customize/$menu_name/delete", array(), t('Delete'));
     $this->assertResponse(200);
     $this->assertRaw(t('The custom menu %title has been deleted.', array('%title' => $title)), t('Custom menu was deleted'));
     $this->assertFalse(menu_load($menu_name), 'Custom menu was deleted');
@@ -171,7 +171,7 @@ class MenuTestCase extends DrupalWebTest
    */
   function addMenuItem($plid = 0, $link = '<front>', $menu_name = 'navigation') {
     // View add menu item page.
-    $this->drupalGet("admin/build/menu-customize/$menu_name/add");
+    $this->browser->get("admin/build/menu-customize/$menu_name/add");
     $this->assertResponse(200);
 
     $title = '!link_' . $this->randomName(16);
@@ -186,7 +186,7 @@ class MenuTestCase extends DrupalWebTest
     );
 
     // Add menu item.
-    $this->drupalPost("admin/build/menu-customize/$menu_name/add", $edit, t('Save'));
+    $this->browser->post("admin/build/menu-customize/$menu_name/add", $edit, t('Save'));
     $this->assertResponse(200);
     // Unlike most other modules, there is no confirmation message displayed.
 //    $this->assertText(t('The menu item %title has been added.', array('%title' => $title)), t('Menu item was added'));
@@ -223,7 +223,7 @@ class MenuTestCase extends DrupalWebTest
         'menu[link_path]' => $link_path,
         'menu[link_title]' => 'title',
       );
-      $this->drupalPost("admin/build/menu-customize/$menu_name/add", $edit, t('Save'));
+      $this->browser->post("admin/build/menu-customize/$menu_name/add", $edit, t('Save'));
       $this->assertRaw(t("The path '@path' is either invalid or you do not have access to it.", array('@path' => $link_path)), 'Menu item was not created');
     }
   }
@@ -238,7 +238,7 @@ class MenuTestCase extends DrupalWebTest
    */
   function verifyMenuItem($item, $item_node, $parent = NULL, $parent_node = NULL) {
     // View home page.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertResponse(200);
 
     // Verify parent menu item.
@@ -248,7 +248,7 @@ class MenuTestCase extends DrupalWebTest
       $this->assertText($title, 'Parent menu item was displayed');
 
       // Verify menu item link.
-      $this->clickLink($title);
+      $this->browser->clickLink($title);
       $title = $parent_node->title;
       $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Parent menu item link target was correct'));
     }
@@ -258,7 +258,7 @@ class MenuTestCase extends DrupalWebTest
     $this->assertText($title, 'Menu item was displayed');
 
     // Verify menu item link.
-    $this->clickLink($title);
+    $this->browser->clickLink($title);
     $title = $item_node->title;
     $this->assertTitle(t("@title | Drupal", array('@title' => $title)), t('Menu item link target was correct'));
   }
@@ -277,13 +277,13 @@ class MenuTestCase extends DrupalWebTest
     // Edit menu item.
     $edit = array();
     $edit['menu[link_title]'] = $title;
-    $this->drupalPost("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
+    $this->browser->post("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
     $this->assertResponse(200);
     // Unlike most other modules, there is no confirmation message displayed.
 //    $this->assertRaw(t('The menu item %title has been updated.', array('%title' => $title)), t('Menu item was edited'));
 
     // Verify menu item.
-    $this->drupalGet('admin/build/menu-customize/' . $item['menu_name']);
+    $this->browser->get('admin/build/menu-customize/' . $item['menu_name']);
     $this->assertText($title, 'Menu item was edited');
   }
 
@@ -298,16 +298,16 @@ class MenuTestCase extends DrupalWebTest
     $title = $item['link_title'];
 
     // Reset menu item.
-    $this->drupalPost("admin/build/menu/item/$mlid/reset", array(), t('Reset'));
+    $this->browser->post("admin/build/menu/item/$mlid/reset", array(), t('Reset'));
     $this->assertResponse(200);
     $this->assertRaw(t('The menu item was reset to its default settings.'), t('Menu item was reset'));
 
     // Verify menu item.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertNoText($title, 'Menu item was reset');
 
     // Verify menu item.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertText($old_title, 'Menu item was reset');
   }
 
@@ -321,12 +321,12 @@ class MenuTestCase extends DrupalWebTest
     $title = $item['link_title'];
 
     // Delete menu item.
-    $this->drupalPost("admin/build/menu/item/$mlid/delete", array(), t('Confirm'));
+    $this->browser->post("admin/build/menu/item/$mlid/delete", array(), t('Confirm'));
     $this->assertResponse(200);
     $this->assertRaw(t('The menu item %title has been deleted.', array('%title' => $title)), t('Menu item was deleted'));
 
     // Verify deletion.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertNoText($title, 'Menu item was deleted');
   }
 
@@ -342,22 +342,22 @@ class MenuTestCase extends DrupalWebTest
     // Edit menu item.
     $edit = array();
     $edit['menu[enabled]'] = FALSE;
-    $this->drupalPost("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
+    $this->browser->post("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
     $this->assertResponse(200);
     // Unlike most other modules, there is no confirmation message displayed.
 //    $this->assertRaw(t('The menu item %title has been updated.', array('%title' => $title)), t('Menu item was edited'));
 
     // Verify menu item.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertNoText($title, 'Menu item was not displayed');
 
     // Edit menu item.
     $edit['menu[enabled]'] = TRUE;
-    $this->drupalPost("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
+    $this->browser->post("admin/build/menu/item/$mlid/edit", $edit, t('Save'));
     $this->assertResponse(200);
 
     // Verify menu item.
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertText($title, 'Menu item was displayed');
   }
 
@@ -383,21 +383,21 @@ class MenuTestCase extends DrupalWebTest
    */
   private function verifyAccess($response = 200) {
     // View menu help node.
-    $this->drupalGet('admin/help/menu');
+    $this->browser->get('admin/help/menu');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Menu'), t('Menu help was displayed'));
     }
 
     // View menu build overview node.
-    $this->drupalGet('admin/build/menu');
+    $this->browser->get('admin/build/menu');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Menus'), t('Menu build overview node was displayed'));
     }
 
     // View navigation menu customization node.
-    $this->drupalGet('admin/build/menu-customize/navigation');
+    $this->browser->get('admin/build/menu-customize/navigation');
         $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Navigation'), t('Navigation menu node was displayed'));
@@ -405,21 +405,21 @@ class MenuTestCase extends DrupalWebTest
 
     // View menu edit node.
     $item = $this->getStandardMenuItem();
-    $this->drupalGet('admin/build/menu/item/' . $item['mlid'] . '/edit');
+    $this->browser->get('admin/build/menu/item/' . $item['mlid'] . '/edit');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Edit menu item'), t('Menu edit node was displayed'));
     }
 
     // View menu settings node.
-    $this->drupalGet('admin/build/menu/settings');
+    $this->browser->get('admin/build/menu/settings');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Menus'), t('Menu settings node was displayed'));
     }
 
     // View add menu node.
-    $this->drupalGet('admin/build/menu/add');
+    $this->browser->get('admin/build/menu/add');
     $this->assertResponse($response);
     if ($response == 200) {
       $this->assertText(t('Menus'), t('Add menu node was displayed'));
Index: modules/node/node.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/node/node.test,v
retrieving revision 1.8
diff -u -p -r1.8 node.test
--- modules/node/node.test	25 Nov 2008 13:14:27 -0000	1.8
+++ modules/node/node.test	30 Nov 2008 16:22:03 -0000
@@ -60,17 +60,17 @@ class NodeRevisionsTestCase extends Drup
     $node = $nodes[3];
 
     // Confirm the correct revision text appears on "view revisions" page.
-    $this->drupalGet("node/$node->nid/revisions/$node->vid/view");
+    $this->browser->get("node/$node->nid/revisions/$node->vid/view");
     $this->assertText($node->body, t('Correct text displays for version.'));
 
     // Confirm the correct log message appears on "revisions overview" page.
-    $this->drupalGet("node/$node->nid/revisions");
+    $this->browser->get("node/$node->nid/revisions");
     foreach ($logs as $log) {
       $this->assertText($log, t('Log message found.'));
     }
 
     // Confirm that revisions revert properly.
-    $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert'));
+    $this->browser->post("node/$node->nid/revisions/{$nodes[1]->vid}/revert", array(), t('Revert'));
     $this->assertRaw(t('@type %title has been reverted back to the revision from %revision-date.',
                         array('@type' => 'Page', '%title' => $nodes[1]->title,
                               '%revision-date' => format_date($nodes[1]->revision_timestamp))), t('Revision reverted.'));
@@ -78,7 +78,7 @@ class NodeRevisionsTestCase extends Drup
     $this->assertTrue(($nodes[1]->body == $reverted_node->body), t('Node reverted correctly.'));
 
     // Confirm revisions delete properly.
-    $this->drupalPost("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete'));
+    $this->browser->post("node/$node->nid/revisions/{$nodes[1]->vid}/delete", array(), t('Delete'));
     $this->assertRaw(t('Revision from %revision-date of @type %title has been deleted.',
                         array('%revision-date' => format_date($nodes[1]->revision_timestamp),
                               '@type' => 'Page', '%title' => $nodes[1]->title)), t('Revision deleted.'));
@@ -255,16 +255,16 @@ class PageEditTestCase extends DrupalWeb
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body'] = $this->randomName(16);
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
 
     // Check that the node exists in the database.
     $node = node_load(array('title' => $edit['title']));
     $this->assertTrue($node, t('Node found in database.'));
 
     // Check that "edit" link points to correct page.
-    $this->clickLink(t('Edit'));
+    $this->browser->clickLink(t('Edit'));
     $edit_url = url("node/$node->nid/edit", array('absolute' => true));
-    $actual_url = $this->getURL();
+    $actual_url = $this->browser->url;
     $this->assertEqual($edit_url, $actual_url, t('On edit page.'));
 
     // Check that the title and body fields are displayed with the correct values.
@@ -277,7 +277,7 @@ class PageEditTestCase extends DrupalWeb
     $edit['title'] = $this->randomName(8);
     $edit['body'] = $this->randomName(16);
     // Stay on the current page, without reloading.
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
 
     // Check that the title and body fields are displayed with the updated values.
     $this->assertText($edit['title'], t('Title displayed.'));
@@ -309,7 +309,7 @@ class PagePreviewTestCase extends Drupal
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body'] = $this->randomName(16);
-    $this->drupalPost('node/add/page', $edit, t('Preview'));
+    $this->browser->post('node/add/page', $edit, t('Preview'));
 
     // Check that the preview is displaying the title and body.
     $this->assertTitle(t('Preview'), t('Page title is preview.'));
@@ -346,7 +346,7 @@ class PageCreationTestCase extends Drupa
     $edit = array();
     $edit['title'] = $this->randomName(8);
     $edit['body'] = $this->randomName(16);
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
 
     // Check that the page has been created.
     $this->assertRaw(t('!post %title has been created.', array('!post' => 'Page', '%title' => $edit['title'])), t('Page created.'));
@@ -375,7 +375,7 @@ class PageViewTestCase extends DrupalWeb
     $this->assertTrue(node_load($node->nid), t('Node created.'));
 
     // Try to edit with anonymous user.
-    $html = $this->drupalGet("node/$node->nid/edit");
+    $html = $this->browser->get("node/$node->nid/edit");
     $this->assertResponse(403);
 
     // Create a user without permission to edit node.
@@ -383,7 +383,7 @@ class PageViewTestCase extends DrupalWeb
     $this->drupalLogin($web_user);
 
     // Attempt to access edit page.
-    $this->drupalGet("node/$node->nid/edit");
+    $this->browser->get("node/$node->nid/edit");
     $this->assertResponse(403);
 
     // Create user with permission to edit node.
@@ -391,7 +391,7 @@ class PageViewTestCase extends DrupalWeb
     $this->drupalLogin($web_user);
 
     // Attempt to access edit page.
-    $this->drupalGet("node/$node->nid/edit");
+    $this->browser->get("node/$node->nid/edit");
     $this->assertResponse(200);
   }
 }
@@ -415,15 +415,15 @@ class NodeTitleXSSTestCase extends Drupa
     $edit = array(
       'title' => $xss . $this->randomName(),
     );
-    $this->drupalPost('node/add/page', $edit, t('Preview'));
+    $this->browser->post('node/add/page', $edit, t('Preview'));
     $this->assertNoRaw($xss, t('Harmful tags are escaped when previewing a node.'));
 
     $node = $this->drupalCreateNode($edit);
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertNoRaw($xss, t('Harmful tags are escaped when viewing a node.'));
 
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->browser->get('node/' . $node->nid . '/edit');
     $this->assertNoRaw($xss, t('Harmful tags are escaped when editing a node.'));
   }
 }
Index: modules/path/path.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/path/path.test,v
retrieving revision 1.4
diff -u -p -r1.4 path.test
--- modules/path/path.test	13 Oct 2008 20:57:19 -0000	1.4
+++ modules/path/path.test	30 Nov 2008 16:22:03 -0000
@@ -31,10 +31,10 @@ class PathTestCase extends DrupalWebTest
     $edit = array();
     $edit['src'] = 'node/' . $node1->nid;
     $edit['dst'] = $this->randomName(8);
-    $this->drupalPost('admin/build/path/add', $edit, t('Create new alias'));
+    $this->browser->post('admin/build/path/add', $edit, t('Create new alias'));
 
     // Confirm that the alias works.
-    $this->drupalGet($edit['dst']);
+    $this->browser->get($edit['dst']);
     $this->assertText($node1->title, 'Alias works.');
 
     // Change alias.
@@ -42,14 +42,14 @@ class PathTestCase extends DrupalWebTest
 
     $previous = $edit['dst'];
     $edit['dst'] = $this->randomName(8);
-    $this->drupalPost('admin/build/path/edit/' . $pid, $edit, t('Update alias'));
+    $this->browser->post('admin/build/path/edit/' . $pid, $edit, t('Update alias'));
 
     // Confirm that the alias works.
-    $this->drupalGet($edit['dst']);
+    $this->browser->get($edit['dst']);
     $this->assertText($node1->title, 'Changed alias works.');
 
     // Confirm that previous alias no longer works.
-    $this->drupalGet($previous);
+    $this->browser->get($previous);
     $this->assertNoText($node1->title, 'Previous alias no longer works.');
     $this->assertResponse(404);
 
@@ -59,16 +59,16 @@ class PathTestCase extends DrupalWebTest
     // Set alias to second test node.
     $edit['src'] = 'node/' . $node2->nid;
     // leave $edit['dst'] the same
-    $this->drupalPost('admin/build/path/add', $edit, t('Create new alias'));
+    $this->browser->post('admin/build/path/add', $edit, t('Create new alias'));
 
     // Confirm no duplicate was created.
     $this->assertRaw(t('The alias %alias is already in use in this language.', array('%alias' => $edit['dst'])), 'Attempt to move alias was rejected.');
 
     // Delete alias.
-    $this->drupalPost('admin/build/path/delete/' . $pid, array(), t('Confirm'));
+    $this->browser->post('admin/build/path/delete/' . $pid, array(), t('Confirm'));
 
     // Confirm that the alias no longer works.
-    $this->drupalGet($edit['dst']);
+    $this->browser->get($edit['dst']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
   }
 
@@ -82,23 +82,23 @@ class PathTestCase extends DrupalWebTest
     // Create alias.
     $edit = array();
     $edit['path'] = $this->randomName(8);
-    $this->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node1->nid . '/edit', $edit, t('Save'));
 
     // Confirm that the alias works.
-    $this->drupalGet($edit['path']);
+    $this->browser->get($edit['path']);
     $this->assertText($node1->title, 'Alias works.');
 
     // Change alias.
     $previous = $edit['path'];
     $edit['path'] = $this->randomName(8);
-    $this->drupalPost('node/' . $node1->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node1->nid . '/edit', $edit, t('Save'));
 
     // Confirm that the alias works.
-    $this->drupalGet($edit['path']);
+    $this->browser->get($edit['path']);
     $this->assertText($node1->title, 'Changed alias works.');
 
     // Make sure that previous alias no longer works.
-    $this->drupalGet($previous);
+    $this->browser->get($previous);
     $this->assertNoText($node1->title, 'Previous alias no longer works.');
     $this->assertResponse(404);
 
@@ -107,16 +107,16 @@ class PathTestCase extends DrupalWebTest
 
     // Set alias to second test node.
     // Leave $edit['path'] the same.
-    $this->drupalPost('node/' . $node2->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node2->nid . '/edit', $edit, t('Save'));
 
     // Confirm that the alias didn't make a duplicate.
     $this->assertText(t('The path is already in use.'), 'Attempt to moved alias was rejected.');
 
     // Delete alias.
-    $this->drupalPost('node/' . $node1->nid . '/edit', array('path' => ''), t('Save'));
+    $this->browser->post('node/' . $node1->nid . '/edit', array('path' => ''), t('Save'));
 
     // Confirm that the alias no longer works.
-    $this->drupalGet($edit['path']);
+    $this->browser->get($edit['path']);
     $this->assertNoText($node1->title, 'Alias was successfully deleted.');
   }
 
@@ -128,7 +128,7 @@ class PathTestCase extends DrupalWebTest
     $edit = array();
     $edit['title'] = '!SimpleTest test node! ' . $this->randomName(10);
     $edit['body'] = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32);
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
 
     // Check to make sure the node was created.
     $node = node_load(array('title' => $edit['title']));
@@ -162,7 +162,7 @@ class PathLanguageTestCase extends Drupa
     $edit = array();
     $edit['langcode'] = 'fr';
 
-    $this->drupalPost('admin/settings/language/add', $edit, t('Add language'));
+    $this->browser->post('admin/settings/language/add', $edit, t('Add language'));
 
     // Set language negotiation to "Path prefix with fallback".
     variable_set('language_negotiation', LANGUAGE_NEGOTIATION_PATH);
@@ -185,24 +185,24 @@ class PathLanguageTestCase extends Drupa
     $edit['language'] = 'en';
     $edit['path'] = $this->randomName();
 
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
 
     // Check to make sure the node was created.
     $english_node = node_load(array('title' => $edit['title']));
     $this->assertTrue(($english_node), 'Node found in database.');
 
     // Confirm that the alias works.
-    $this->drupalGet($edit['path']);
+    $this->browser->get($edit['path']);
     $this->assertText($english_node->title, 'Alias works.');
 
     // Translate the node into French.
-    $this->drupalGet('node/' . $english_node->nid . '/translate');
-    $this->clickLink(t('add translation'));
+    $this->browser->get('node/' . $english_node->nid . '/translate');
+    $this->browser->clickLink(t('add translation'));
     $edit = array();
     $edit['title'] = $this->randomName();
     $edit['body'] = $this->randomName();
     $edit['path'] = $this->randomName();
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
 
     // Clear the path lookup cache.
     drupal_lookup_path('wipe');
@@ -213,7 +213,7 @@ class PathLanguageTestCase extends Drupa
     $this->assertTrue(($french_node), 'Node found in database.');
 
     // Confirm that the alias works.
-    $this->drupalGet('fr/' . $edit['path']);
+    $this->browser->get('fr/' . $edit['path']);
     $this->assertText($french_node->title, 'Alias for French translation works.');
 
     // Confirm that the alias is returned by url().
Index: modules/php/php.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/php/php.test,v
retrieving revision 1.6
diff -u -p -r1.6 php.test
--- modules/php/php.test	25 Nov 2008 13:14:28 -0000	1.6
+++ modules/php/php.test	30 Nov 2008 16:22:03 -0000
@@ -13,7 +13,7 @@ class PHPTestCase extends DrupalWebTestC
     $this->drupalLogin($admin_user);
 
     // Confirm that the PHP filter is #3.
-    $this->drupalGet('admin/settings/filters/3');
+    $this->browser->get('admin/settings/filters/3');
     $this->assertText('PHP code', t('On PHP code filter page.'));
   }
 
@@ -27,7 +27,7 @@ class PHPTestCase extends DrupalWebTestC
     $node = $this->drupalCreateNode(array('uid' => $user->uid));
     $edit = array();
     $edit['body'] = '<?php print "SimpleTest PHP was executed!"; ?>';
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), t('PHP code inserted into node.'));
     return $node;
   }
@@ -52,7 +52,7 @@ class PHPFilterTestCase extends PHPTestC
     // Setup PHP filter.
     $edit = array();
     $edit['roles[2]'] = TRUE; // Set authenticated users to have permission to use filter.
-    $this->drupalPost(NULL, $edit, 'Save configuration');
+    $this->browser->post(NULL, $edit, 'Save configuration');
     $this->assertText(t('The input format settings have been updated.'), t('PHP format available to authenticated users.'));
 
     // Create node with PHP filter enabled.
@@ -67,7 +67,7 @@ class PHPFilterTestCase extends PHPTestC
     // Change filter to PHP filter and see that PHP code is evaluated.
     $edit = array();
     $edit['body_format'] = 3;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), t('PHP code filter turned on.'));
 
     // Make sure that the PHP code shows up as text.
@@ -102,7 +102,7 @@ class PHPAccessTestCase extends PHPTestC
     $this->assertText('print', t('PHP code is displayed.'));
 
     // Make sure that user doesn't have access to filter.
-    $this->drupalGet('node/' . $node->nid . '/edit');
+    $this->browser->get('node/' . $node->nid . '/edit');
     $this->assertNoFieldByName('body_format', '3', t('Format not available.'));
   }
 }
\ No newline at end of file
Index: modules/poll/poll.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/poll/poll.test,v
retrieving revision 1.11
diff -u -p -r1.11 poll.test
--- modules/poll/poll.test	29 Nov 2008 09:33:51 -0000	1.11
+++ modules/poll/poll.test	30 Nov 2008 16:22:03 -0000
@@ -18,7 +18,7 @@ class PollTestCase extends DrupalWebTest
     $this->drupalLogin($web_user);
 
     // Get the form first to initialize the state of the internal browser
-    $this->drupalGet('node/add/poll');
+    $this->browser->get('node/add/poll');
 
     // Prepare a form with two choices
     list($edit, $index) = $this->_pollGenerateEdit($title, $choices);
@@ -26,20 +26,20 @@ class PollTestCase extends DrupalWebTest
     if (count($choices) > 2) {
       // Re-submit the form while the choices are all in
       while($index < count($choices)) {
-        $this->drupalPost(NULL, $edit, t('More choices'));
+        $this->browser->post(NULL, $edit, t('More choices'));
         list($edit, $index) = $this->_pollGenerateEdit($title, $choices, $index);
       }
     }
 
     if ($test_preview) {
-      $this->drupalPost(NULL, $edit, t('Preview'));
+      $this->browser->post(NULL, $edit, t('Preview'));
       foreach($choices as $k => $choice_text) {
         $this->assertRaw($choice_text, t('Choice @choice found was in preview.', array('@choice' => $k)));
       }
       list($edit, $index) = $this->_pollGenerateEdit($title, $choices, $index);
     }
 
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $node = node_load(array('title' => $title));
     $this->assertRaw(t('@type %title has been created.', array('@type' => node_get_types('name', 'poll'), '%title' => $title)), 'Poll has been created.');
     $this->assertTrue($node->nid, t('Poll has been found in the database'));
@@ -115,10 +115,10 @@ class PollVoteTestCase extends PollTestC
     $edit = array (
       'choice' => '1',
     );
-    $this->drupalPost('node/'. $poll_nid, $edit, t('Vote'));
+    $this->browser->post('node/'. $poll_nid, $edit, t('Vote'));
     $this->assertText('Your vote was recorded.', 'Your vote was recorded.');
 
-    $this->drupalGet("node/$poll_nid/votes");
+    $this->browser->get("node/$poll_nid/votes");
     $this->assertText(t('This table lists all the recorded votes for this poll. If anonymous users are allowed to vote, they will be identified by the IP address of the computer they used when they voted.'), 'Vote table text.');
     $this->assertText($choices[0], 'Vote recorded');
   }
Index: modules/profile/profile.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/profile/profile.test,v
retrieving revision 1.8
diff -u -p -r1.8 profile.test
--- modules/profile/profile.test	25 Nov 2008 13:14:28 -0000	1.8
+++ modules/profile/profile.test	30 Nov 2008 16:22:03 -0000
@@ -36,12 +36,12 @@ class ProfileTestCase extends DrupalWebT
     $edit['category'] = $category;
     $edit['explanation'] = $this->randomName(50);
 
-    $this->drupalPost('admin/user/profile/add/' . $type, $edit, t('Save field'));
+    $this->browser->post('admin/user/profile/add/' . $type, $edit, t('Save field'));
     $fid = db_result(db_query("SELECT fid FROM {profile_fields} WHERE title = '%s'", $title));
     $this->assertTrue($fid, t('New Profile field has been entered in the database'));
 
     // Check that the new field is appearing on the user edit form.
-    $this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category);
+    $this->browser->get('user/' . $this->admin_user->uid . '/edit/' . $category);
 
     // Checking field.
     if ($type == 'date') {
@@ -86,10 +86,10 @@ class ProfileTestCase extends DrupalWebT
     $edit = array(
       $field['form_name'] => $value,
     );
-    $this->drupalPost('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
+    $this->browser->post('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
 
     // Check profile page.
-    $content = $this->drupalGet('user/' . $this->normal_user->uid);
+    $content = $this->browser->get('user/' . $this->normal_user->uid);
     $this->assertText($field['title'], t('Found profile field with title %title', array('%title' => $field['title'])));
 
     if ($field['type'] != 'checkbox') {
@@ -107,8 +107,8 @@ class ProfileTestCase extends DrupalWebT
    *   The field to be deleted.
    */
   function deleteProfileField($field) {
-    $this->drupalPost('admin/user/profile/delete/' . $field['fid'], array(), t('Delete'));
-    $this->drupalGet('admin/user/profile');
+    $this->browser->post('admin/user/profile/delete/' . $field['fid'], array(), t('Delete'));
+    $this->browser->get('admin/user/profile');
     $this->assertNoText($field['title'], t('Checking deleted field %title', array('%title' => $field['title'])));
   }
 }
@@ -195,10 +195,10 @@ class ProfileTestDate extends ProfileTes
       $field['form_name'] . '[year]' => 1983,
     );
 
-    $this->drupalPost('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
+    $this->browser->post('user/' . $this->normal_user->uid . '/edit/' . $field['category'], $edit, t('Save'));
 
     // Check profile page.
-    $this->drupalGet('user/' . $this->normal_user->uid);
+    $this->browser->get('user/' . $this->normal_user->uid);
     $this->assertText($field['title'], t('Found profile field with title %title', array('%title' => $field['title'])));
 
     $this->assertText('01/09/1983', t('Found date profile field.'));
@@ -225,10 +225,10 @@ class ProfileTestWeights extends Profile
     $this->setProfileField($field1, $this->randomName(4, 'first_'));
     $this->setProfileField($field2, $this->randomName(4, 'second_'));
 
-    $profile_edit = $this->drupalGet('user/' . $this->normal_user->uid . '/edit/' . $category);
+    $profile_edit = $this->browser->get('user/' . $this->normal_user->uid . '/edit/' . $category);
     $this->assertTrue(strpos($profile_edit, $field1['title']) > strpos($profile_edit, $field2['title']), t('Profile field weights are respected on the user edit form.'));
 
-    $profile_page = $this->drupalGet('user/' . $this->normal_user->uid);
+    $profile_page = $this->browser->get('user/' . $this->normal_user->uid);
     $this->assertTrue(strpos($profile_page, $field1['title']) > strpos($profile_page, $field2['title']), t('Profile field weights are respected on the user profile page.'));
   }
 }
@@ -264,14 +264,14 @@ class ProfileTestAutocomplete extends Pr
     $field_html = '<input type="text" maxlength="255" name="' . $field['form_name'] . '" id="'. form_clean_id('edit-' . $field['form_name']) . '" size="60" value="' . $field['value'] . '" class="form-text form-autocomplete required" />';
 
     // Check that autocompletion html is found on the user's profile edit page.
-    $this->drupalGet('user/' . $this->admin_user->uid . '/edit/' . $category);
+    $this->browser->get('user/' . $this->admin_user->uid . '/edit/' . $category);
     $this->assertRaw($autocomplete_html, t('Autocomplete found.'));
     $this->assertRaw('misc/autocomplete.js', t('Autocomplete JavaScript found.'));
     $this->assertRaw('class="form-text form-autocomplete"', t('Autocomplete form element class found.'));
 
     // Check the autocompletion path using the first letter of our user's profile
     // field value to make sure access is allowed and a valid result if found.
-    $this->drupalGet('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
+    $this->browser->get('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
     $this->assertResponse(200, t('Autocomplete path allowed to user with permission.'));
     $this->assertRaw($field['value'], t('Autocomplete value found.'));
 
@@ -280,11 +280,11 @@ class ProfileTestAutocomplete extends Pr
     $this->drupalLogin($this->normal_user);
 
     // Check that autocompletion html is not found on the user's profile edit page.
-    $this->drupalGet('user/' . $this->normal_user->uid . '/edit/' . $category);
+    $this->browser->get('user/' . $this->normal_user->uid . '/edit/' . $category);
     $this->assertNoRaw($autocomplete_html, t('Autocomplete not found.'));
 
     // User should be denied access to the profile autocomplete path.
-    $this->drupalGet('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
+    $this->browser->get('profile/autocomplete/' . $field['fid'] . '/' . $field['value'][0]);
     $this->assertResponse(403, t('Autocomplete path denied to user without permission.'));
   }
 }
Index: modules/search/search.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/search/search.test,v
retrieving revision 1.11
diff -u -p -r1.11 search.test
--- modules/search/search.test	25 Nov 2008 13:14:28 -0000	1.11
+++ modules/search/search.test	30 Nov 2008 16:22:03 -0000
@@ -178,12 +178,12 @@ class SearchBikeShed extends DrupalWebTe
 
   function testFailedSearch() {
     $this->drupalLogin($this->searching_user);
-    $this->drupalGet('search/node');
+    $this->browser->get('search/node');
     $this->assertText(t('Enter your keywords'));
 
     $edit = array();
     $edit['keys'] = 'bike shed ' . $this->randomName();
-    $this->drupalPost('search/node', $edit, t('Search'));
+    $this->browser->post('search/node', $edit, t('Search'));
     $this->assertText(t('Consider loosening your query with OR. bike OR shed will often show more results than bike shed.'), t('Help text is displayed when search returns no results.'));
   }
 }
@@ -230,23 +230,23 @@ class SearchAdvancedSearchForm extends D
     $this->assertNotEqual($dummy_title, $this->node->title, t("Dummy title doens't equal node title"));
 
     // Search for the dummy title with a GET query.
-    $this->drupalGet('search/node/' . drupal_urlencode($dummy_title));
+    $this->browser->get('search/node/' . drupal_urlencode($dummy_title));
     $this->assertNoText($this->node->title, t('Page node is not found with dummy title.'));
 
     // Search for the title of the node with a GET query.
-    $this->drupalGet('search/node/' . drupal_urlencode($this->node->title));
+    $this->browser->get('search/node/' . drupal_urlencode($this->node->title));
     $this->assertText($this->node->title, t('Page node is found with GET query.'));
 
     // Search for the title of the node with a POST query.
     $edit = array('or' => $this->node->title);
-    $this->drupalPost('search/node', $edit, t('Advanced search'));
+    $this->browser->post('search/node', $edit, t('Advanced search'));
     $this->assertText($this->node->title, t('Page node is found with POST query.'));
 
     // Advanced search type option.
-    $this->drupalPost('search/node', array_merge($edit, array('type[page]' => 'page')), t('Advanced search'));
+    $this->browser->post('search/node', array_merge($edit, array('type[page]' => 'page')), t('Advanced search'));
     $this->assertText($this->node->title, t('Page node is found with POST query and type:page.'));
 
-    $this->drupalPost('search/node', array_merge($edit, array('type[article]' => 'article')), t('Advanced search'));
+    $this->browser->post('search/node', array_merge($edit, array('type[article]' => 'article')), t('Advanced search'));
     $this->assertText('bike shed', t('Article node is not found with POST query and type:article.'));
   }
 }
@@ -305,16 +305,16 @@ class SearchRankingTestCase extends Drup
 
     // Add a comment to one of the nodes.
     $edit = array('subject' => 'my comment title', 'comment' => 'some random comment');
-    $this->drupalGet('comment/reply/' . $nodes['comments'][1]->nid);
-    $this->drupalPost(NULL, $edit, t('Preview'));
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->get('comment/reply/' . $nodes['comments'][1]->nid);
+    $this->browser->post(NULL, $edit, t('Preview'));
+    $this->browser->post(NULL, $edit, t('Save'));
 
     // Enable counting of statistics.
     variable_set('statistics_count_content_views', 1);
 
     // Then View one of the nodes a bunch of times.
     for ($i = 0; $i < 5; $i ++) {
-      $this->drupalGet('node/' . $nodes['views'][1]->nid);
+      $this->browser->get('node/' . $nodes['views'][1]->nid);
     }
 
     // Test each of the possible rankings.
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.64
diff -u -p -r1.64 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	30 Nov 2008 07:04:45 -0000	1.64
+++ modules/simpletest/drupal_web_test_case.php	30 Nov 2008 16:22:03 -0000
@@ -21,34 +21,6 @@ class DrupalWebTestCase {
   protected $url;
 
   /**
-   * The handle of the current cURL connection.
-   *
-   * @var resource
-   */
-  protected $curlHandle;
-
-  /**
-   * The content of the page currently loaded in the internal browser.
-   *
-   * @var string
-   */
-  protected $content;
-
-  /**
-   * The content of the page currently loaded in the internal browser (plain text version).
-   *
-   * @var string
-   */
-  protected $plainTextContent;
-
-  /**
-   * The parsed version of the page.
-   *
-   * @var SimpleXMLElement
-   */
-  protected $elements = NULL;
-
-  /**
    * Whether a user is logged in the internal browser.
    *
    * @var bool
@@ -56,21 +28,6 @@ class DrupalWebTestCase {
   protected $isLoggedIn = FALSE;
 
   /**
-   * The current cookie file used by cURL.
-   *
-   * We do not reuse the cookies in further runs, so we do not need a file
-   * but we still need cookie handling, so we set the jar to NULL.
-   */
-  protected $cookieFile = NULL;
-
-  /**
-   * Additional cURL options.
-   *
-   * DrupalWebTestCase itself never sets this but always obeys what is set.
-   */
-  protected $additionalCurlOptions = array();
-
-  /**
    * The original database prefix, before it was changed for testing purposes.
    *
    * @var string
@@ -85,6 +42,13 @@ class DrupalWebTestCase {
   protected $originalFileDirectory = NULL;
 
   /**
+   * The content of the page currently loaded in the internal browser (plain text version).
+   *
+   * @var string
+   */
+  protected $plainTextContent;
+
+  /**
    * Current results of this test case.
    *
    * @var Array
@@ -182,7 +146,9 @@ class DrupalWebTestCase {
     // We skip calls that occured in one of the methods of DrupalWebTestCase
     // or in an assertion function.
     while (($caller = $backtrace[1]) &&
-          ((isset($caller['class']) && $caller['class'] == 'DrupalWebTestCase') ||
+          ((isset($caller['class']) && ($caller['class'] == 'DrupalWebTestCase' ||
+                                        $caller['class'] == 'SimpleTestBrowser') ||
+                                        $caller['class'] == 'DrupalBrowser') ||
             substr($caller['function'], 0, 6) == 'assert')) {
       // We remove that call.
       array_shift($backtrace);
@@ -203,7 +169,7 @@ class DrupalWebTestCase {
    * @return
    *   TRUE if the assertion succeeded, FALSE otherwise.
    */
-  protected function assertTrue($value, $message = '', $group = 'Other') {
+  public function assertTrue($value, $message = '', $group = 'Other') {
     return $this->assert((bool) $value, $message ? $message : t('Value is TRUE'), $group);
   }
 
@@ -729,7 +695,7 @@ class DrupalWebTestCase {
       'name' => $user->name,
       'pass' => $user->pass_raw
     );
-    $this->drupalPost('user', $edit, t('Log in'));
+    $this->browser->post('user', $edit, t('Log in'));
 
     $pass = $this->assertText($user->name, t('Found name: %name', array('%name' => $user->name)), t('User login'));
     $pass = $pass && $this->assertNoText(t('The username %name has been blocked.', array('%name' => $user->name)), t('No blocked message at login page'), t('User login'));
@@ -745,10 +711,10 @@ class DrupalWebTestCase {
    */
   protected function drupalLogout() {
     // Make a request to the logout page.
-    $this->drupalGet('user/logout');
+    $this->browser->get('user/logout');
 
     // Load the user page, the idea being if you were properly logged out you should be seeing a login screen.
-    $this->drupalGet('user');
+    $this->browser->get('user');
     $pass = $this->assertField('name', t('Username field found.'), t('Logout'));
     $pass = $pass && $this->assertField('pass', t('Password field found.'), t('Logout'));
 
@@ -827,7 +793,7 @@ class DrupalWebTestCase {
    * Refresh the in-memory set of variables. Useful after a page request is made
    * that changes a variable in a different thread.
    *
-   * In other words calling a settings page with $this->drupalPost() with a changed
+   * In other words calling a settings page with $this->browser->post() with a changed
    * value would update a variable to reflect that change, but in the thread that
    * made the call (thread running the test) the changed variable would not be
    * picked up.
@@ -874,444 +840,8 @@ class DrupalWebTestCase {
       $this->refreshVariables();
 
       // Close the CURL handler.
-      $this->curlClose();
-    }
-  }
-
-  /**
-   * Initializes the cURL connection.
-   *
-   * This function will add authentication headers as specified in the
-   * simpletest_httpauth_username and simpletest_httpauth_pass variables. Also,
-   * see the description of $curl_options among the properties.
-   */
-  protected function curlInitialize() {
-    global $base_url, $db_prefix;
-    if (!isset($this->curlHandle)) {
-      $this->curlHandle = curl_init();
-      $curl_options = $this->additionalCurlOptions + array(
-        CURLOPT_COOKIEJAR => $this->cookieFile,
-        CURLOPT_URL => $base_url,
-        CURLOPT_FOLLOWLOCATION => TRUE,
-        CURLOPT_RETURNTRANSFER => TRUE,
-        CURLOPT_SSL_VERIFYPEER => FALSE,  // Required to make the tests run on https://
-        CURLOPT_SSL_VERIFYHOST => FALSE,  // Required to make the tests run on https://
-        CURLOPT_HEADERFUNCTION => array(&$this, 'curlHeaderCallback'),
-      );
-      if (preg_match('/simpletest\d+/', $db_prefix, $matches)) {
-        $curl_options[CURLOPT_USERAGENT] = $matches[0];
-      }
-      if (!isset($curl_options[CURLOPT_USERPWD]) && ($auth = variable_get('simpletest_httpauth_username', ''))) {
-        if ($pass = variable_get('simpletest_httpauth_pass', '')) {
-          $auth .= ':' . $pass;
-        }
-        $curl_options[CURLOPT_USERPWD] = $auth;
-      }
-      curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
-    }
-  }
-
-  /**
-   * Performs a cURL exec with the specified options after calling curlConnect().
-   *
-   * @param $curl_options
-   *   Custom cURL options.
-   * @return
-   *   Content returned from the exec.
-   */
-  protected function curlExec($curl_options) {
-    $this->curlInitialize();
-    $url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
-    curl_setopt_array($this->curlHandle, $this->additionalCurlOptions + $curl_options);
-    $this->drupalSetContent(curl_exec($this->curlHandle), curl_getinfo($this->curlHandle, CURLINFO_EFFECTIVE_URL));
-    $this->assertTrue($this->content !== FALSE, t('!method to !url, response is !length bytes.', array('!method' => !empty($curl_options[CURLOPT_NOBODY]) ? 'HEAD' : (empty($curl_options[CURLOPT_POSTFIELDS]) ? 'GET' : 'POST'), '!url' => $url, '!length' => strlen($this->content))), t('Browser'));
-    return $this->drupalGetContent();
-  }
-
-  /**
-   * Reads headers and registers errors received from the tested site.
-   *
-   * @see _drupal_log_error().
-   *
-   * @param $curlHandler
-   *   The cURL handler.
-   * @param $header
-   *   An header.
-   */
-  protected function curlHeaderCallback($curlHandler, $header) {
-    // Errors are being sent via X-Drupal-Assertion-* headers,
-    // generated by _drupal_log_error() in the exact form required
-    // by DrupalWebTestCase::error().
-    if (preg_match('/^X-Drupal-Assertion-[0-9]+: (.*)$/', $header, $matches)) {
-      // Call DrupalWebTestCase::error() with the parameters from the header.
-      call_user_func_array(array(&$this, 'error'), unserialize(urldecode($matches[1])));
-    }
-    // This is required by cURL.
-    return strlen($header);
-  }
-
-  /**
-   * Close the cURL handler and unset the handler.
-   */
-  protected function curlClose() {
-    if (isset($this->curlHandle)) {
-      curl_close($this->curlHandle);
-      unset($this->curlHandle);
-    }
-  }
-
-  /**
-   * Parse content returned from curlExec using DOM and SimpleXML.
-   *
-   * @return
-   *   A SimpleXMLElement or FALSE on failure.
-   */
-  protected function parse() {
-    if (!$this->elements) {
-      // DOM can load HTML soup. But, HTML soup can throw warnings, supress
-      // them.
-      @$htmlDom = DOMDocument::loadHTML($this->content);
-      if ($htmlDom) {
-        $this->pass(t('Valid HTML found on "@path"', array('@path' => $this->getUrl())), t('Browser'));
-        // It's much easier to work with simplexml than DOM, luckily enough
-        // we can just simply import our DOM tree.
-        $this->elements = simplexml_import_dom($htmlDom);
-      }
-    }
-    if (!$this->elements) {
-      $this->fail(t('Parsed page successfully.'), t('Browser'));
-    }
-
-    return $this->elements;
-  }
-
-  /**
-   * Retrieves a Drupal path or an absolute path.
-   *
-   * @param $path
-   *   Drupal path or URL to load into internal browser
-   * @param $options
-   *   Options to be forwarded to url().
-   * @return
-   *   The retrieved HTML string, also available as $this->drupalGetContent()
-   */
-  protected function drupalGet($path, $options = array()) {
-    $options['absolute'] = TRUE;
-
-    // We re-using a CURL connection here.  If that connection still has certain
-    // options set, it might change the GET into a POST.  Make sure we clear out
-    // previous options.
-    $out = $this->curlExec(array(CURLOPT_HTTPGET => TRUE, CURLOPT_URL => url($path, $options), CURLOPT_HEADER => FALSE, CURLOPT_NOBODY => FALSE));
-    $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
-
-    // Replace original page output with new output from redirected page(s).
-    if (($new = $this->checkForMetaRefresh())) {
-      $out = $new;
-    }
-    return $out;
-  }
-
-  /**
-   * Execute a POST request on a Drupal page.
-   * It will be done as usual POST request with SimpleBrowser.
-   *
-   * @param $path
-   *   Location of the post form. Either a Drupal path or an absolute path or
-   *   NULL to post to the current page. For multi-stage forms you can set the
-   *   path to NULL and have it post to the last received page. Example:
-   *
-   *   // First step in form.
-   *   $edit = array(...);
-   *   $this->drupalPost('some_url', $edit, t('Save'));
-   *
-   *   // Second step in form.
-   *   $edit = array(...);
-   *   $this->drupalPost(NULL, $edit, t('Save'));
-   * @param  $edit
-   *   Field data in an assocative array. Changes the current input fields
-   *   (where possible) to the values indicated. A checkbox can be set to
-   *   TRUE to be checked and FALSE to be unchecked. Note that when a form
-   *   contains file upload fields, other fields cannot start with the '@'
-   *   character.
-   *
-   *   Multiple select fields can be set using name[] and setting each of the
-   *   possible values. Example:
-   *   $edit = array();
-   *   $edit['name[]'] = array('value1', 'value2');
-   * @param $submit
-   *   Value of the submit button.
-   * @param $options
-   *   Options to be forwarded to url().
-   */
-  protected function drupalPost($path, $edit, $submit, $options = array()) {
-    $submit_matches = FALSE;
-    if (isset($path)) {
-      $html = $this->drupalGet($path, $options);
-    }
-    if ($this->parse()) {
-      $edit_save = $edit;
-      // Let's iterate over all the forms.
-      $forms = $this->xpath('//form');
-      foreach ($forms as $form) {
-        // We try to set the fields of this form as specified in $edit.
-        $edit = $edit_save;
-        $post = array();
-        $upload = array();
-        $submit_matches = $this->handleForm($post, $edit, $upload, $submit, $form);
-        $action = isset($form['action']) ? $this->getAbsoluteUrl($form['action']) : $this->getUrl();
-
-        // We post only if we managed to handle every field in edit and the
-        // submit button matches.
-        if (!$edit && $submit_matches) {
-          if ($upload) {
-            // TODO: cURL handles file uploads for us, but the implementation
-            // is broken. This is a less than elegant workaround. Alternatives
-            // are being explored at #253506.
-            foreach ($upload as $key => $file) {
-              $file = realpath($file);
-              if ($file && is_file($file)) {
-                $post[$key] = '@' . $file;
-              }
-            }
-          }
-          else {
-            foreach ($post as $key => $value) {
-              // Encode according to application/x-www-form-urlencoded
-              // Both names and values needs to be urlencoded, according to
-              // http://www.w3.org/TR/html4/interact/forms.html#h-17.13.4.1
-              $post[$key] = urlencode($key) . '=' . urlencode($value);
-            }
-            $post = implode('&', $post);
-          }
-          $out = $this->curlExec(array(CURLOPT_URL => $action, CURLOPT_POST => TRUE, CURLOPT_POSTFIELDS => $post, CURLOPT_HEADER => FALSE));
-          // Ensure that any changes to variables in the other thread are picked up.
-          $this->refreshVariables();
-
-          // Replace original page output with new output from redirected page(s).
-          if (($new = $this->checkForMetaRefresh())) {
-            $out = $new;
-          }
-          return $out;
-        }
-      }
-      // We have not found a form which contained all fields of $edit.
-      foreach ($edit as $name => $value) {
-        $this->fail(t('Failed to set field @name to @value', array('@name' => $name, '@value' => $value)));
-      }
-      $this->assertTrue($submit_matches, t('Found the @submit button', array('@submit' => $submit)));
-      $this->fail(t('Found the requested form fields at @path', array('@path' => $path)));
-    }
-  }
-
-  /**
-   * Check for meta refresh tag and if found call drupalGet() recursively. This
-   * function looks for the http-equiv attribute to be set to "Refresh"
-   * and is case-sensitive.
-   *
-   * @return
-   *   Either the new page content or FALSE.
-   */
-  protected function checkForMetaRefresh() {
-    if ($this->drupalGetContent() != '' && $this->parse()) {
-      $refresh = $this->xpath('//meta[@http-equiv="Refresh"]');
-      if (!empty($refresh)) {
-        // Parse the content attribute of the meta tag for the format:
-        // "[delay]: URL=[page_to_redirect_to]".
-        if (preg_match('/\d+;\s*URL=(?P<url>.*)/i', $refresh[0]['content'], $match)) {
-          return $this->drupalGet($this->getAbsoluteUrl(decode_entities($match['url'])));
-        }
-      }
+      $this->browser->curlClose();
     }
-    return FALSE;
-  }
-
-  /**
-   * Retrieves only the headers for a Drupal path or an absolute path.
-   *
-   * @param $path
-   *   Drupal path or URL to load into internal browser
-   * @param $options
-   *   Options to be forwarded to url().
-   * @return
-   *   The retrieved headers, also available as $this->drupalGetContent()
-   */
-  protected function drupalHead($path, Array $options = array()) {
-    $options['absolute'] = TRUE;
-    $out = $this->curlExec(array(CURLOPT_HEADER => TRUE, CURLOPT_NOBODY => TRUE, CURLOPT_URL => url($path, $options)));
-    $this->refreshVariables(); // Ensure that any changes to variables in the other thread are picked up.
-    return $out;
-  }
-
-  /**
-   * Handle form input related to drupalPost(). Ensure that the specified fields
-   * exist and attempt to create POST data in the correct manner for the particular
-   * field type.
-   *
-   * @param $post
-   *   Reference to array of post values.
-   * @param $edit
-   *   Reference to array of edit values to be checked against the form.
-   * @param $submit
-   *   Form submit button value.
-   * @param $form
-   *   Array of form elements.
-   * @return
-   *   Submit value matches a valid submit input in the form.
-   */
-  protected function handleForm(&$post, &$edit, &$upload, $submit, $form) {
-    // Retrieve the form elements.
-    $elements = $form->xpath('.//input|.//textarea|.//select');
-    $submit_matches = FALSE;
-    foreach ($elements as $element) {
-      // SimpleXML objects need string casting all the time.
-      $name = (string) $element['name'];
-      // This can either be the type of <input> or the name of the tag itself
-      // for <select> or <textarea>.
-      $type = isset($element['type']) ? (string)$element['type'] : $element->getName();
-      $value = isset($element['value']) ? (string)$element['value'] : '';
-      $done = FALSE;
-      if (isset($edit[$name])) {
-        switch ($type) {
-          case 'text':
-          case 'textarea':
-          case 'password':
-            $post[$name] = $edit[$name];
-            unset($edit[$name]);
-            break;
-          case 'radio':
-            if ($edit[$name] == $value) {
-              $post[$name] = $edit[$name];
-              unset($edit[$name]);
-            }
-            break;
-          case 'checkbox':
-            // To prevent checkbox from being checked.pass in a FALSE,
-            // otherwise the checkbox will be set to its value regardless
-            // of $edit.
-            if ($edit[$name] === FALSE) {
-              unset($edit[$name]);
-              continue 2;
-            }
-            else {
-              unset($edit[$name]);
-              $post[$name] = $value;
-            }
-            break;
-          case 'select':
-            $new_value = $edit[$name];
-            $index = 0;
-            $key = preg_replace('/\[\]$/', '', $name);
-            $options = $this->getAllOptions($element);
-            foreach ($options as $option) {
-              if (is_array($new_value)) {
-                $option_value= (string)$option['value'];
-                if (in_array($option_value, $new_value)) {
-                  $post[$key . '[' . $index++ . ']'] = $option_value;
-                  $done = TRUE;
-                  unset($edit[$name]);
-                }
-              }
-              elseif ($new_value == $option['value']) {
-                $post[$name] = $new_value;
-                unset($edit[$name]);
-                $done = TRUE;
-              }
-            }
-            break;
-          case 'file':
-            $upload[$name] = $edit[$name];
-            unset($edit[$name]);
-            break;
-        }
-      }
-      if (!isset($post[$name]) && !$done) {
-        switch ($type) {
-          case 'textarea':
-            $post[$name] = (string)$element;
-            break;
-          case 'select':
-            $single = empty($element['multiple']);
-            $first = TRUE;
-            $index = 0;
-            $key = preg_replace('/\[\]$/', '', $name);
-            $options = $this->getAllOptions($element);
-            foreach ($options as $option) {
-              // For single select, we load the first option, if there is a
-              // selected option that will overwrite it later.
-              if ($option['selected'] || ($first && $single)) {
-                $first = FALSE;
-                if ($single) {
-                  $post[$name] = (string)$option['value'];
-                }
-                else {
-                  $post[$key . '[' . $index++ . ']'] = (string)$option['value'];
-                }
-              }
-            }
-            break;
-          case 'file':
-            break;
-          case 'submit':
-          case 'image':
-            if ($submit == $value) {
-              $post[$name] = $value;
-              $submit_matches = TRUE;
-            }
-            break;
-          case 'radio':
-          case 'checkbox':
-            if (!isset($element['checked'])) {
-              break;
-            }
-            // Deliberate no break.
-          default:
-            $post[$name] = $value;
-        }
-      }
-    }
-    return $submit_matches;
-  }
-
-  /**
-   * Peform an xpath search on the contents of the internal browser. The search
-   * is relative to the root element (HTML tag normally) of the page.
-   *
-   * @param $xpath
-   *   The xpath string to use in the search.
-   * @return
-   *   The return value of the xpath search. For details on the xpath string
-   *   format and return values see the SimpleXML documentation.
-   *   http://us.php.net/manual/function.simplexml-element-xpath.php
-   */
-  protected function xpath($xpath) {
-    if ($this->parse()) {
-      return $this->elements->xpath($xpath);
-    }
-    return FALSE;
-  }
-
-  /**
-   * Get all option elements, including nested options, in a select.
-   *
-   * @param $element
-   *   The element for which to get the options.
-   * @return
-   *   Option elements in select.
-   */
-  protected function getAllOptions(SimpleXMLElement $element) {
-    $options = array();
-    // Add all options items.
-    foreach ($element->option as $option) {
-      $options[] = $option;
-    }
-
-    // Search option group children.
-    if (isset($element->optgroup)) {
-      foreach ($element->optgroup as $group) {
-        $options = array_merge($options, $this->getAllOptions($group));
-      }
-    }
-    return $options;
   }
 
   /**
@@ -1328,7 +858,7 @@ class DrupalWebTestCase {
    *   The group this message belongs to, defaults to 'Other'.
    */
   protected function assertLink($label, $index = 0, $message = '', $group = 'Other') {
-    $links = $this->xpath('//a[text()="' . $label . '"]');
+    $links = $this->browser->xpath('//a[text()="' . $label . '"]');
     $message = ($message ?  $message : t('Link with label "!label" found.', array('!label' => $label)));
     $this->assert(isset($links[$index]), $message, $group);
   }
@@ -1346,104 +876,12 @@ class DrupalWebTestCase {
    *   The group this message belongs to, defaults to 'Other'.
    */
   protected function assertNoLink($label, $message = '', $group = 'Other') {
-    $links = $this->xpath('//a[text()="' . $label . '"]');
+    $links = $this->browser->xpath('//a[text()="' . $label . '"]');
     $message = ($message ?  $message : t('Link with label "!label" not found.', array('!label' => $label)));
     $this->assert(empty($links), $message, $group);
   }
 
   /**
-   * Follows a link by name.
-   *
-   * Will click the first link found with this link text by default, or a
-   * later one if an index is given. Match is case insensitive with
-   * normalized space. The label is translated label. There is an assert
-   * for successful click.
-   *
-   * @param $label
-   *   Text between the anchor tags.
-   * @param $index
-   *   Link position counting from zero.
-   * @return
-   *   Page on success, or FALSE on failure.
-   */
-  protected function clickLink($label, $index = 0) {
-    $url_before = $this->getUrl();
-    $urls = $this->xpath('//a[text()="' . $label . '"]');
-
-    if (isset($urls[$index])) {
-      $url_target = $this->getAbsoluteUrl($urls[$index]['href']);
-    }
-
-    $this->assertTrue(isset($urls[$index]), t('Clicked link "!label" (!url_target) from !url_before', array('!label' => $label, '!url_target' => $url_target, '!url_before' => $url_before)), t('Browser'));
-
-    if (isset($urls[$index])) {
-      return $this->drupalGet($url_target);
-    }
-    return FALSE;
-  }
-
-  /**
-   * Takes a path and returns an absolute path.
-   *
-   * @param $path
-   *   The path, can be a Drupal path or a site-relative path. It might have a
-   *   query, too. Can even be an absolute path which is just passed through.
-   * @return
-   *   An absolute path.
-   */
-  protected function getAbsoluteUrl($path) {
-    $options = array('absolute' => TRUE);
-    $parts = parse_url($path);
-    // This is more crude than the menu_is_external but enough here.
-    if (empty($parts['host'])) {
-      $path = $parts['path'];
-      $base_path = base_path();
-      $n = strlen($base_path);
-      if (substr($path, 0, $n) == $base_path) {
-        $path = substr($path, $n);
-      }
-      if (isset($parts['query'])) {
-        $options['query'] = $parts['query'];
-      }
-      $path = url($path, $options);
-    }
-    return $path;
-  }
-
-  /**
-   * Get the current url from the cURL handler.
-   *
-   * @return
-   *   The current url.
-   */
-  protected function getUrl() {
-    return $this->url;
-  }
-
-  /**
-   * Gets the current raw HTML of requested page.
-   */
-  protected function drupalGetContent() {
-    return $this->content;
-  }
-
-  /**
-   * Sets the raw HTML content. This can be useful when a page has been fetched
-   * outside of the internal browser and assertions need to be made on the
-   * returned page.
-   *
-   * A good example would be when testing drupal_http_request(). After fetching
-   * the page the content can be set and page elements can be checked to ensure
-   * that the function worked properly.
-   */
-  protected function drupalSetContent($content, $url = 'internal:') {
-    $this->content = $content;
-    $this->url = $url;
-    $this->plainTextContent = FALSE;
-    $this->elements = FALSE;
-  }
-
-  /**
    * Pass if the raw text IS found on the loaded page, fail otherwise. Raw text
    * refers to the raw HTML that the page generated.
    *
@@ -1457,7 +895,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertRaw($raw, $message = '%s found', $group = 'Other') {
-    return $this->assert(strpos($this->content, $raw) !== FALSE, $message, $group);
+    return $this->assert(strpos($this->browser->content, $raw) !== FALSE, $message, $group);
   }
 
   /**
@@ -1474,7 +912,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertNoRaw($raw, $message = '%s found', $group = 'Other') {
-    return $this->assert(strpos($this->content, $raw) === FALSE, $message, $group);
+    return $this->assert(strpos($this->browser->content, $raw) === FALSE, $message, $group);
   }
 
   /**
@@ -1530,9 +968,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertTextHelper($text, $message, $group, $not_exists) {
-    if ($this->plainTextContent === FALSE) {
-      $this->plainTextContent = filter_xss($this->content, array());
-    }
+    $this->plainTextContent = filter_xss($this->browser->content, array());
     if (!$message) {
       $message = '"' . $text . '"' . ($not_exists ? ' not found' : ' found');
     }
@@ -1552,7 +988,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertPattern($pattern, $message = 'Pattern %s found', $group = 'Other') {
-    return $this->assert((bool) preg_match($pattern, $this->drupalGetContent()), $message, $group);
+    return $this->assert((bool) preg_match($pattern, $this->browser->content), $message, $group);
   }
 
   /**
@@ -1568,7 +1004,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertNoPattern($pattern, $message = 'Pattern %s not found', $group = 'Other') {
-    return $this->assert(!preg_match($pattern, $this->drupalGetContent()), $message, $group);
+    return $this->assert(!preg_match($pattern, $this->browser->content), $message, $group);
   }
 
   /**
@@ -1584,7 +1020,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertTitle($title, $message, $group = 'Other') {
-    return $this->assert($this->xpath('//title[text()="' . $title . '"]') !== FALSE, $message, $group);
+    return $this->assert($this->browser->xpath('//title[text()="' . $title . '"]') !== FALSE, $message, $group);
   }
 
   /**
@@ -1602,7 +1038,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertFieldByXPath($xpath, $value, $message, $group = 'Other') {
-    $fields = $this->xpath($xpath);
+    $fields = $this->browser->xpath($xpath);
 
     // If value specified then check array for match.
     $found = TRUE;
@@ -1621,7 +1057,7 @@ class DrupalWebTestCase {
             }
             else {
               // No item selected so use first item.
-              $items = $this->getAllOptions($field);
+              $items = $this->browser->getAllOptions($field);
               if (!empty($items) && $items[0]['value'] == $value) {
                 $found = TRUE;
               }
@@ -1674,7 +1110,7 @@ class DrupalWebTestCase {
    *   TRUE on pass, FALSE on fail.
    */
   protected function assertNoFieldByXPath($xpath, $value, $message, $group = 'Other') {
-    $fields = $this->xpath($xpath);
+    $fields = $this->browser->xpath($xpath);
 
     // If value specified then check array for match.
     $found = TRUE;
@@ -1821,8 +1257,29 @@ class DrupalWebTestCase {
    *   Assertion result.
    */
   protected function assertResponse($code, $message = '') {
-    $curl_code = curl_getinfo($this->curlHandle, CURLINFO_HTTP_CODE);
+    $curl_code = curl_getinfo($this->browser->curlHandle, CURLINFO_HTTP_CODE);
     $match = is_array($code) ? in_array($curl_code, $code) : $curl_code == $code;
     return $this->assertTrue($match, $message ? $message : t('HTTP response expected !code, actual !curl_code', array('!code' => $code, '!curl_code' => $curl_code)), t('Browser'));
   }
 }
+
+class SimpleTestBrowser extends DrupalBrowser {
+  /**
+   * The test that contains this browser.
+   */
+  protected $test;
+
+  /**
+   * Fire an assertion.
+   */
+  function debug($status, $message) {
+    $this->test->assertTrue($status, $message, 'Browser');
+  }
+
+  /**
+   * Set the test.
+   */
+  function __construct($test) {
+    $this->test = $test;
+  }
+}
Index: modules/simpletest/simpletest.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/simpletest.test,v
retrieving revision 1.11
diff -u -p -r1.11 simpletest.test
--- modules/simpletest/simpletest.test	26 Nov 2008 13:48:49 -0000	1.11
+++ modules/simpletest/simpletest.test	30 Nov 2008 16:22:03 -0000
@@ -43,13 +43,13 @@ class SimpleTestTestCase extends DrupalW
   function testInternalBrowser() {
     global $conf;
     if (!$this->inCURL()) {
-      $this->drupalGet('node');
+      $this->browser->get('node');
       $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.'));
       // Make sure that we are locked out of the installer when prefixing
       // using the user-agent header. This is an important security check.
       global $base_url;
 
-      $this->drupalGet($base_url . '/install.php', array('external' => TRUE));
+      $this->browser->get($base_url . '/install.php', array('external' => TRUE));
       $this->assertResponse(403, 'Cannot access install.php with a "simpletest" user-agent header.');
     }
   }
@@ -73,11 +73,11 @@ class SimpleTestTestCase extends DrupalW
       // Run twice so test_ids can be accumulated.
       for ($i = 0; $i < 2; $i++) {
         // Run this test from web interface.
-        $this->drupalGet('admin/build/testing');
+        $this->browser->get('admin/build/testing');
 
         $edit = array();
         $edit['SimpleTestTestCase'] = TRUE;
-        $this->drupalPost(NULL, $edit, t('Run tests'));
+        $this->browser->post(NULL, $edit, t('Run tests'));
 
         // Parse results and confirm that they are correct.
         $this->getTestResults();
@@ -187,7 +187,7 @@ class SimpleTestTestCase extends DrupalW
   function getTestResults() {
     $results = array();
 
-    if ($this->parse()) {
+    if ($this->browser->parseHTMLcontent()) {
       if ($fieldset = $this->getResultFieldSet()) {
         // Code assumes this is the only test in group.
         $results['summary'] = $this->asText($fieldset->div);
@@ -217,7 +217,7 @@ class SimpleTestTestCase extends DrupalW
    * @return fieldset containing the results for group this test is in.
    */
   function getResultFieldSet() {
-    $fieldsets = $this->xpath('//fieldset');
+    $fieldsets = $this->browser->xpath('//fieldset');
     $info = $this->getInfo();
     foreach ($fieldsets as $fieldset) {
       if ($fieldset->legend == $info['group']) {
Index: modules/simpletest/tests/actions.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/actions.test,v
retrieving revision 1.2
diff -u -p -r1.2 actions.test
--- modules/simpletest/tests/actions.test	25 Nov 2008 13:14:28 -0000	1.2
+++ modules/simpletest/tests/actions.test	30 Nov 2008 16:22:03 -0000
@@ -22,26 +22,26 @@ class ActionsConfigurationTestCase exten
     // Make a POST request to admin/settings/actions/manage.
     $edit = array();
     $edit['action'] = md5('system_goto_action');
-    $this->drupalPost('admin/settings/actions/manage', $edit, t('Create'));
+    $this->browser->post('admin/settings/actions/manage', $edit, t('Create'));
 
     // Make a POST request to the individual action configuration page.
     $edit = array();
     $action_description = $this->randomName();
     $edit['actions_description'] = $action_description;
     $edit['url'] = 'admin';
-    $this->drupalPost('admin/settings/actions/configure/' . md5('system_goto_action'), $edit, t('Save'));
+    $this->browser->post('admin/settings/actions/configure/' . md5('system_goto_action'), $edit, t('Save'));
 
     // Make sure that the new complex action was saved properly.
     $this->assertText(t('The action has been successfully saved.'), t("Make sure we get a confirmation that we've successfully saved the complex action."));
     $this->assertText($action_description, t("Make sure the action description appears on the configuration page after we've saved the complex action."));
 
     // Make another POST request to the action edit page.
-    $this->clickLink(t('configure'));
+    $this->browser->clickLink(t('configure'));
     $edit = array();
     $new_action_description = $this->randomName();
     $edit['actions_description'] = $new_action_description;
     $edit['url'] = 'admin';
-    $this->drupalPost('admin/settings/actions/configure/1', $edit, t('Save'));
+    $this->browser->post('admin/settings/actions/configure/1', $edit, t('Save'));
 
     // Make sure that the action updated properly.
     $this->assertText(t('The action has been successfully saved.'), t("Make sure we get a confirmation that we've successfully updated the complex action."));
@@ -49,13 +49,13 @@ class ActionsConfigurationTestCase exten
     $this->assertText($new_action_description, t("Make sure the action description appears on the configuration page after we've updated the complex action."));
 
     // Make sure that deletions work properly.
-    $this->clickLink(t('delete'));
+    $this->browser->clickLink(t('delete'));
     $edit = array();
-    $this->drupalPost('admin/settings/actions/delete/1', $edit, t('Delete'));
+    $this->browser->post('admin/settings/actions/delete/1', $edit, t('Delete'));
 
     // Make sure that the action was actually deleted.
     $this->assertRaw(t('Action %action was deleted', array('%action' => $new_action_description)), t('Make sure that we get a delete confirmation message.'));
-    $this->drupalGet('admin/settings/actions/manage');
+    $this->browser->get('admin/settings/actions/manage');
     $this->assertNoText($new_action_description, t("Make sure the action description does not appear on the overview page after we've deleted the action."));
     $exists = db_result(db_query("SELECT aid FROM {actions} WHERE callback = 'drupal_goto_action'"));
     $this->assertFalse($exists, t('Make sure the action is gone from the database after being deleted.'));
Index: modules/simpletest/tests/bootstrap.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/bootstrap.test,v
retrieving revision 1.7
diff -u -p -r1.7 bootstrap.test
--- modules/simpletest/tests/bootstrap.test	23 Nov 2008 18:12:08 -0000	1.7
+++ modules/simpletest/tests/bootstrap.test	30 Nov 2008 16:22:03 -0000
@@ -101,9 +101,9 @@ class BootstrapPageCacheTestCase extends
     global $base_url;
     variable_set('cache', 1);
     // Fill the cache.
-    $this->drupalGet($base_url);
+    $this->browser->get($base_url);
 
-    $this->drupalHead($base_url);
+    $this->browser->head($base_url);
     $this->assertText('ETag: ', t('Verify presence of ETag header indicating that page caching is enabled.'));
   }
 
@@ -133,7 +133,7 @@ class BootstrapVariableTestCase extends 
     $this->assertIdentical($variable, variable_get('simpletest_bootstrap_variable_test', NULL), t('Setting and retrieving values'));
 
     // Make sure the variable persists across multiple requests.
-    $this->drupalGet('system-test/variable-get');
+    $this->browser->get('system-test/variable-get');
     $this->assertText($variable, t('Variable persists across multiple requests'));
 
     // Deleting variables.
@@ -168,14 +168,14 @@ class HookBootExitTestCase extends Drupa
   function testHookBootExit() {
     // Test with cache disabled. Boot and exit should always fire.
     variable_set('cache', CACHE_DISABLED);
-    $this->drupalGet('');
+    $this->browser->get('');
     $calls = 1;
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_boot'")->fetchField(), $calls, t('hook_boot called with disabled cache.'));
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_exit'")->fetchField(), $calls, t('hook_exit called with disabled cache.'));
 
     // Test with normal cache. Boot and exit should be called.
     variable_set('cache', CACHE_NORMAL);
-    $this->drupalGet('');
+    $this->browser->get('');
     $calls++;
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_boot'")->fetchField(), $calls, t('hook_boot called with normal cache.'));
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_exit'")->fetchField(), $calls, t('hook_exit called with normal cache.'));
@@ -184,14 +184,14 @@ class HookBootExitTestCase extends Drupa
     // page is cached.
     variable_set('cache', CACHE_AGGRESSIVE);
     $this->assertTrue(cache_get(url('', array('absolute' => TRUE)), 'cache_page'), t('Page has been cached.'));
-    $this->drupalGet('');
+    $this->browser->get('');
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_boot'")->fetchField(), $calls, t('hook_boot not called with agressive cache and a cached page.'));
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_exit'")->fetchField(), $calls, t('hook_exit not called with agressive cache and a cached page.'));
 
     // Test with aggressive cache and page cache cleared. Boot and exit should
     // be called.
     $this->assertTrue(db_delete('cache_page')->execute(), t('Page cache cleared.'));
-    $this->drupalGet('');
+    $this->browser->get('');
     $calls++;
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_boot'")->fetchField(), $calls, t('hook_boot called with agressive cache and no cached page.'));
     $this->assertEqual(db_query("SELECT COUNT(*) FROM {watchdog} WHERE type = 'system_test' AND message = 'hook_exit'")->fetchField(), $calls, t('hook_exit called with agressive cache and no cached page.'));
Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.17
diff -u -p -r1.17 common.test
--- modules/simpletest/tests/common.test	26 Nov 2008 13:48:49 -0000	1.17
+++ modules/simpletest/tests/common.test	30 Nov 2008 16:22:03 -0000
@@ -226,7 +226,7 @@ class DrupalHTTPRequestTestCase extends 
     // Fetch page.
     $result = drupal_http_request(url('node', array('absolute' => TRUE)));
     $this->assertEqual($result->code, 200, t('Fetched page successfully.'));
-    $this->drupalSetContent($result->data);
+    $this->browser->content = $result->data;
     $this->assertTitle(variable_get('site_name', 'Drupal'), t('Site title matches.'));
   }
 
@@ -238,7 +238,7 @@ class DrupalHTTPRequestTestCase extends 
     $auth = str_replace('http://', 'http://' . $username . ':' . $password .'@', $url);
     $result = drupal_http_request($auth);
 
-    $this->drupalSetContent($result->data);
+    $this->browser->content = $result->data;
     $this->assertRaw($username, t('$_SERVER["PHP_AUTH_USER"] is passed correctly.'));
     $this->assertRaw($password, t('$_SERVER["PHP_AUTH_PW"] is passed correctly.'));
   }
@@ -275,7 +275,7 @@ class DrupalHTTPRequestTestCase extends 
   function testDrupalGetDestination() {
     $query = $this->randomName(10);
     $url = url('system-test/destination', array('absolute' => TRUE, 'query' => $query));
-    $this->drupalGet($url);
+    $this->browser->get($url);
     $this->assertText($query, t('The query passed to the page is correctly represented by drupal_get_detination().'));
   }
 }
@@ -492,7 +492,7 @@ class DrupalErrorHandlerUnitTest extends
    * Test the error handler.
    */
   function testErrorHandler() {
-    $this->drupalGet('system-test/generate-warnings');
+    $this->browser->get('system-test/generate-warnings');
 
     $this->assertErrorMessage('Notice', 'system_test.module', 'system_test_generate_warnings() ', 'Undefined variable');
     $this->assertErrorMessage('Warning', 'system_test.module', 'system_test_generate_warnings() ', 'Division by zero');
@@ -503,10 +503,10 @@ class DrupalErrorHandlerUnitTest extends
    * Test the exception handler.
    */
   function testExceptionHandler() {
-    $this->drupalGet('system-test/trigger-exception');
+    $this->browser->get('system-test/trigger-exception');
     $this->assertErrorMessage('Exception', 'system_test.module', 'system_test_trigger_exception()', 'Drupal is awesome');
 
-    $this->drupalGet('system-test/trigger-pdo-exception');
+    $this->browser->get('system-test/trigger-pdo-exception');
     // We only check for SQLSTATE because the exact error reported varies from database to database.
     $this->assertErrorMessage('PDOException', 'system_test.module', 'system_test_trigger_pdo_exception()', 'SQLSTATE');
   }
Index: modules/simpletest/tests/database_test.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/database_test.test,v
retrieving revision 1.23
diff -u -p -r1.23 database_test.test
--- modules/simpletest/tests/database_test.test	26 Nov 2008 13:48:49 -0000	1.23
+++ modules/simpletest/tests/database_test.test	30 Nov 2008 16:22:04 -0000
@@ -2025,8 +2025,8 @@ class DatabaseTemporaryQueryTestCase ext
    * Confirm that temporary tables work and are limited to one request.
    */
   function testTemporaryQuery() {
-    $this->drupalGet('database_test_db_query_temporary');
-    $this->assertEqual(db_query('SELECT COUNT(*) FROM {system}')->fetchField(), $this->drupalGetContent(), t('The temporary table exists and contains the correct amount of rows.'));
+    $this->browser->get('database_test_db_query_temporary');
+    $this->assertEqual(db_query('SELECT COUNT(*) FROM {system}')->fetchField(), $this->browser->content, t('The temporary table exists and contains the correct amount of rows.'));
     $this->assertFalse(db_table_exists('temporary'), t('The temporary table is, indeed, temporary.'));
   }
 }
Index: modules/simpletest/tests/file.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/file.test,v
retrieving revision 1.14
diff -u -p -r1.14 file.test
--- modules/simpletest/tests/file.test	27 Nov 2008 08:41:45 -0000	1.14
+++ modules/simpletest/tests/file.test	30 Nov 2008 16:22:04 -0000
@@ -345,7 +345,7 @@ class FileSaveUploadTest extends FileHoo
     $image = current($this->drupalGetTestFiles('image'));
     $this->assertTrue(is_file($image->filename), t("The file we're going to upload exists."));
     $edit = array('files[file_test_upload]' => realpath($image->filename));
-    $this->drupalPost('file-test/upload', $edit, t('Submit'));
+    $this->browser->post('file-test/upload', $edit, t('Submit'));
     $this->assertResponse(200, t('Received a 200 response for posted test file.'));
 
     // We can't easily check that the hooks were called but since
Index: modules/simpletest/tests/menu.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/menu.test,v
retrieving revision 1.3
diff -u -p -r1.3 menu.test
--- modules/simpletest/tests/menu.test	20 Nov 2008 07:18:59 -0000	1.3
+++ modules/simpletest/tests/menu.test	30 Nov 2008 16:22:04 -0000
@@ -32,7 +32,7 @@ class MenuIncTestCase extends DrupalWebT
     $this->assertEqual($name, 'original', t('Menu name is "original".'));
 
     // Force a menu rebuild by going to the modules page.
-    $this->drupalGet('admin/build/modules', array('query' => array("hook_menu_name" => 'changed')));
+    $this->browser->get('admin/build/modules', array('query' => array("hook_menu_name" => 'changed')));
 
     $sql = "SELECT menu_name FROM {menu_links} WHERE router_path = 'menu_name_test'";
     $name = db_result(db_query($sql));
@@ -71,7 +71,7 @@ class MenuRebuildTestCase extends Drupal
     // to rebuild the menu item. Now 'admin' should exist.
     variable_set('menu_rebuild_needed', TRUE);
     // menu_execute_active_handler() should trigger the rebuild.
-    $this->drupalGet('<front>');
+    $this->browser->get('<front>');
     $admin_exists = db_result(db_query("SELECT path from {menu_router} WHERE path = 'admin'"));
     $this->assertEqual($admin_exists, 'admin', t("The menu has been rebuilt, the path 'admin' now exists again."));
   }
Index: modules/simpletest/tests/session.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/session.test,v
retrieving revision 1.7
diff -u -p -r1.7 session.test
--- modules/simpletest/tests/session.test	26 Nov 2008 13:48:49 -0000	1.7
+++ modules/simpletest/tests/session.test	30 Nov 2008 16:22:04 -0000
@@ -7,7 +7,7 @@
  */
 
 class SessionTestCase extends DrupalWebTestCase {
-  protected $saved_cookie;
+  public $saved_cookie;
 
   function getInfo() {
     return array(
@@ -19,18 +19,7 @@ class SessionTestCase extends DrupalWebT
 
   function setUp() {
     parent::setUp('session_test');
-  }
-
-  /**
-   * Implementation of curlHeaderCallback().
-   */
-  protected function curlHeaderCallback($ch, $header) {
-    // Look for a Set-Cookie header.
-    if (preg_match('/^Set-Cookie.+$/i', $header, $matches)) {
-      $this->saved_cookie = $header;
-    }
-
-    return parent::curlHeaderCallback($ch, $header);
+    $this->browser = new SessionTestBrowser($this);
   }
 
   /**
@@ -55,9 +44,9 @@ class SessionTestCase extends DrupalWebT
     // in hook_user_login().
     user_save($user, array('name' => 'session_test_user'));
     $user->name = 'session_test_user';
-    $this->drupalGet('session-test/id');
+    $this->browser->get('session-test/id');
     $matches = array();
-    preg_match('/\s*session_id:(.*)\n/', $this->drupalGetContent(), $matches);
+    preg_match('/\s*session_id:(.*)\n/', $this->browser->content, $matches);
     $this->assertTrue(!empty($matches[1]) , t('Found session ID before logging in.'));
     $original_session = $matches[1];
     // We cannot use $this->drupalLogin($user); because we exit in
@@ -66,14 +55,14 @@ class SessionTestCase extends DrupalWebT
       'name' => $user->name,
       'pass' => $user->pass_raw
     );
-    $this->drupalPost('user', $edit, t('Log in'));
-    $this->drupalGet('node');
+    $this->browser->post('user', $edit, t('Log in'));
+    $this->browser->get('node');
     $pass = $this->assertText($user->name, t('Found name: %name', array('%name' => $user->name)), t('User login'));
     $this->_logged_in = $pass;
 
-    $this->drupalGet('session-test/id');
+    $this->browser->get('session-test/id');
     $matches = array();
-    preg_match('/\s*session_id:(.*)\n/', $this->drupalGetContent(), $matches);
+    preg_match('/\s*session_id:(.*)\n/', $this->browser->content, $matches);
     $this->assertTrue(!empty($matches[1]) , t('Found session ID after logging in.'));
     $this->assertTrue($matches[1] != $original_session, t('Session ID changed after login.'));
   }
@@ -91,17 +80,17 @@ class SessionTestCase extends DrupalWebT
     $this->session_count_authenticated = $this->session_count++;
 
     $value_1 = $this->randomName();
-    $this->drupalGet('session-test/set/' . $value_1);
+    $this->browser->get('session-test/set/' . $value_1);
     $this->assertText($value_1, t('The session value was stored.'), t('Session'));
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     $this->assertText($value_1, t('Session correctly returned the stored data for an authenticated user.'), t('Session'));
 
     // Attempt to write over val_1. If drupal_save_session(FALSE) is working.
     // properly, val_1 will still be set.
     $value_2 = $this->randomName();
-    $this->drupalGet('session-test/no-set/' . $value_2);
+    $this->browser->get('session-test/no-set/' . $value_2);
     $this->assertText($value_2, t('The session value was correctly passed to session-test/no-set.'), t('Session'));
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     $this->assertText($value_1, t('Session data is not saved for drupal_save_session(FALSE).'), t('Session'));
 
     // Switch browser cookie to anonymous user, then back to user 1.
@@ -112,28 +101,28 @@ class SessionTestCase extends DrupalWebT
     // Logout the user and make sure the stored value no longer persists.
     $this->drupalLogout();
     $this->sessionReset();
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     // Session count should go up since we're accessing anonymously now.
     $this->session_count_anonymous = $this->session_count++;
     $this->assertNoText($value_1, t("After logout, previous user's session data is not available."), t('Session'));
 
     $value_3 = $this->randomName();
-    $this->drupalGet('session-test/set/' . $value_3);
+    $this->browser->get('session-test/set/' . $value_3);
     $this->assertText($value_3, t('Session data stored for anonymous user.'), t('Session'));
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     $this->assertText($value_3, t('Session correctly returned the stored data for an anonymous user.'), t('Session'));
 
     $value_4 = $this->randomName();
-    $this->drupalGet('session-test/no-set/' . $value_4);
+    $this->browser->get('session-test/no-set/' . $value_4);
     $this->assertText($value_4, t('The session value was correctly passed to session-test/no-set.'), t('Session'));
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     $this->assertText($value_3, t('Session data is not saved for drupal_save_session(FALSE).'), t('Session'));
 
     // Logout and get first user back in. Sessions shouldn't persist through
     // logout, so the data won't be on the page.
     $this->drupalLogin($user);
     $this->sessionReset($user->uid);
-    $this->drupalGet('session-test/get');
+    $this->browser->get('session-test/get');
     $this->assertNoText($value_1, t('Session has persisted for an authenticated user after logging out and then back in.'), t('Session'));
 
     // Logout and create another user.
@@ -166,13 +155,27 @@ class SessionTestCase extends DrupalWebT
    */
   function sessionReset($uid = 0) {
     // Close the internal browser.
-    $this->curlClose();
+    $this->browser->curlClose();
 
     // Change cookie file for user.
-    $this->cookieFile = file_directory_temp() . '/cookie.' . $uid . '.txt';
-    $this->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->cookieFile;
-    $this->additionalCurlOptions[CURLOPT_COOKIESESSION] = TRUE;
-    $this->drupalGet('session-test/get');
+    $this->browser->cookieFile = file_directory_temp() . '/cookie.' . $uid . '.txt';
+    $this->browser->additionalCurlOptions[CURLOPT_COOKIEFILE] = $this->browser->cookieFile;
+    $this->browser->additionalCurlOptions[CURLOPT_COOKIESESSION] = TRUE;
+    $this->browser->get('session-test/get');
     $this->assertResponse(200, t('Session test module is correctly enabled.'), t('Session'));
   }
 }
+
+class SessionTestBrowser extends SimpleTestBrowser {
+  /**
+   * Implementation of curlHeaderCallback().
+   */
+  protected function curlHeaderCallback($ch, $header) {
+    // Look for a Set-Cookie header.
+    if (preg_match('/^Set-Cookie.+$/i', $header, $matches)) {
+      $this->test->saved_cookie = $header;
+    }
+
+    return parent::curlHeaderCallback($ch, $header);
+  }
+}
Index: modules/simpletest/tests/taxonomy_test.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/taxonomy_test.test,v
retrieving revision 1.3
diff -u -p -r1.3 taxonomy_test.test
--- modules/simpletest/tests/taxonomy_test.test	25 Nov 2008 13:14:28 -0000	1.3
+++ modules/simpletest/tests/taxonomy_test.test	30 Nov 2008 16:22:04 -0000
@@ -24,14 +24,14 @@ class TaxonomyHooksTestCase extends Drup
     $edit = array(
       'name' => $this->randomName(),
     );
-    $this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/add', $edit, t('Save'));
 
     // Create a term with one antonym.
     $edit = array(
       'name' => $this->randomName(),
       'antonyms' => 'Long',
     );
-    $this->drupalPost('admin/content/taxonomy/1/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/1/add', $edit, t('Save'));
     $terms = taxonomy_get_term_by_name($edit['name']);
     $term = taxonomy_term_load($terms[0]->tid);
     $this->assertEqual($term->antonyms[0], $edit['antonyms'], t('Antonyms were loaded into the term object'));
@@ -41,7 +41,7 @@ class TaxonomyHooksTestCase extends Drup
       'name' => $this->randomName(),
       'antonyms' => 'Short',
     );
-    $this->drupalPost('taxonomy/term/' . $term->tid . '/edit', $edit, t('Save'));
+    $this->browser->post('taxonomy/term/' . $term->tid . '/edit', $edit, t('Save'));
     $term = taxonomy_term_load($term->tid, TRUE);
     $this->assertTrue(in_array($edit['antonyms'], $term->antonyms), t('Antonym was successfully edited'));
 
Index: modules/statistics/statistics.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/statistics/statistics.test,v
retrieving revision 1.5
diff -u -p -r1.5 statistics.test
--- modules/statistics/statistics.test	25 Nov 2008 13:14:28 -0000	1.5
+++ modules/statistics/statistics.test	30 Nov 2008 16:22:04 -0000
@@ -33,29 +33,29 @@ class StatisticsBlockVisitorsTestCase ex
     // Verify the IP address from accesslog appears on the top visitors page
     // and that a 'block IP adddress' link is displayed.
     $this->drupalLogin($this->blocking_user);
-    $this->drupalGet('admin/reports/visitors');
+    $this->browser->get('admin/reports/visitors');
     $this->assertText($test_ip_address, t('IP address found.'));
     $this->assertText(t('block IP address'), t('Block IP link displayed'));
 
     // Block the IP address.
-    $this->clickLink('block IP address');
+    $this->browser->clickLink('block IP address');
     $this->assertText(t('IP address blocking'), t('IP blocking page displayed.'));
     $edit = array();
     $edit['ip'] = $test_ip_address;
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $ip = db_result(db_query("SELECT iid from {blocked_ips} WHERE ip = '%s'", $edit['ip']));
     $this->assertNotNull($ip, t('IP address found in database'));
     $this->assertRaw(t('The IP address %ip has been blocked.', array('%ip' => $edit['ip'])), t('IP address was blocked.'));
 
     // Verify that the block/unblock link on the top visitors page has been altered.
-    $this->drupalGet('admin/reports/visitors');
+    $this->browser->get('admin/reports/visitors');
     $this->assertText(t('unblock IP address'), t('Unblock IP address link displayed'));
 
     // Unblock the IP address.
-    $this->clickLink('unblock IP address');
+    $this->browser->clickLink('unblock IP address');
     $this->assertRaw(t('Are you sure you want to delete %ip?', array('%ip' => $test_ip_address)), t('IP address deletion confirmation found.'));
     $edit = array();
-    $this->drupalPost('admin/settings/ip-blocking/delete/1', NULL, t('Delete'));
+    $this->browser->post('admin/settings/ip-blocking/delete/1', NULL, t('Delete'));
     $this->assertRaw(t('The IP address %ip was deleted.', array('%ip' => $test_ip_address)), t('IP address deleted.'));
   }
 }
Index: modules/syslog/syslog.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/syslog/syslog.test,v
retrieving revision 1.5
diff -u -p -r1.5 syslog.test
--- modules/syslog/syslog.test	25 Nov 2008 13:14:28 -0000	1.5
+++ modules/syslog/syslog.test	30 Nov 2008 16:22:04 -0000
@@ -29,12 +29,12 @@ class SyslogTestCase extends DrupalWebTe
     else {
       $edit['syslog_facility'] = LOG_USER;
     }
-    $this->drupalPost('admin/settings/logging/syslog', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/logging/syslog', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'));
 
-    $this->drupalGet('admin/settings/logging/syslog');
-    if ($this->parse()) {
-      $field = $this->xpath('//option[@value="' . $edit['syslog_facility'] . '"]'); // Should be one field.
+    $this->browser->get('admin/settings/logging/syslog');
+    if ($this->browser->parseHTMLcontent()) {
+      $field = $this->browser->xpath('//option[@value="' . $edit['syslog_facility'] . '"]'); // Should be one field.
       $this->assertTrue($field[0]['selected'] == 'selected', t('Facility value saved.'));
     }
   }
Index: modules/system/system.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.test,v
retrieving revision 1.27
diff -u -p -r1.27 system.test
--- modules/system/system.test	26 Nov 2008 18:56:16 -0000	1.27
+++ modules/system/system.test	30 Nov 2008 16:22:04 -0000
@@ -38,7 +38,7 @@ class EnableDisableCoreTestCase extends 
     // Install (and enable) aggregator module.
     $edit = array();
     $edit['modules[Core][aggregator][enable]'] = 'aggregator';
-    $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
 
     // Check that hook_modules_installed and hook_modules_enabled hooks were invoked and check tables.
@@ -50,7 +50,7 @@ class EnableDisableCoreTestCase extends 
     // Disable aggregator, check tables, uninstall aggregator, check tables.
     $edit = array();
     $edit['modules[Core][aggregator][enable]'] = FALSE;
-    $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/modules', $edit, t('Save configuration'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
 
     // Check that hook_modules_disabled hook was invoked and check tables.
@@ -61,9 +61,9 @@ class EnableDisableCoreTestCase extends 
     // Uninstall the module.
     $edit = array();
     $edit['uninstall[aggregator]'] = 'aggregator';
-    $this->drupalPost('admin/build/modules/uninstall', $edit, t('Uninstall'));
+    $this->browser->post('admin/build/modules/uninstall', $edit, t('Uninstall'));
 
-    $this->drupalPost(NULL, NULL, t('Uninstall'));
+    $this->browser->post(NULL, NULL, t('Uninstall'));
     $this->assertText(t('The selected modules have been uninstalled.'), t('Modules status has been updated.'));
 
     // Check that hook_modules_uninstalled hook was invoked and check tables.
@@ -79,7 +79,7 @@ class EnableDisableCoreTestCase extends 
     // Attempt to enable content translation without locale enabled.
     $edit = array();
     $edit['modules[Core][translation][enable]'] = 'translation';
-    $this->drupalPost('admin/build/modules', $edit, t('Save configuration'));
+    $this->browser->post('admin/build/modules', $edit, t('Save configuration'));
     $this->assertText(t('Some required modules must be enabled'), t('Dependecy required.'));
 
     $this->assertModules(array('translation', 'locale'), FALSE);
@@ -88,7 +88,7 @@ class EnableDisableCoreTestCase extends 
     $this->assertTableCount('languages', FALSE);
     $this->assertTableCount('locale', FALSE);
 
-    $this->drupalPost(NULL, NULL, t('Continue'));
+    $this->browser->post(NULL, NULL, t('Continue'));
     $this->assertText(t('The configuration options have been saved.'), t('Modules status has been updated.'));
 
     $this->assertModules(array('translation', 'locale'), TRUE);
@@ -103,7 +103,7 @@ class EnableDisableCoreTestCase extends 
    */
   function testDisableRequired() {
     $required_modules = drupal_required_modules();
-    $this->drupalGet('admin/build/modules');
+    $this->browser->get('admin/build/modules');
     foreach($required_modules as $module) {
       // Check to make sure the checkbox for required module is not found.
       $this->assertNoFieldByName('modules[Core][' . $module . '][enable]');
@@ -175,12 +175,12 @@ class IPAddressBlockingTestCase extends 
    * Test a variety of user input to confirm correct validation and saving of data.
    */
   function testIPAddressValidation() {
-    $this->drupalGet('admin/settings/ip-blocking');
+    $this->browser->get('admin/settings/ip-blocking');
 
     // Block a valid IP address.
     $edit = array();
     $edit['ip'] = '192.168.1.1';
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $ip = db_result(db_query("SELECT iid from {blocked_ips} WHERE ip = '%s'", $edit['ip']));
     $this->assertNotNull($ip, t('IP address found in database'));
     $this->assertRaw(t('The IP address %ip has been blocked.', array('%ip' => $edit['ip'])), t('IP address was blocked.'));
@@ -188,32 +188,32 @@ class IPAddressBlockingTestCase extends 
     // Try to block an IP address that's already blocked.
     $edit = array();
     $edit['ip'] = '192.168.1.1';
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $this->assertText(t('This IP address is already blocked.'));
 
     // Try to block a reserved IP address.
     $edit = array();
     $edit['ip'] = '255.255.255.255';
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $this->assertText(t('Please enter a valid IP address.'));
 
     // Try to block a reserved IP address.
     $edit = array();
     $edit['ip'] = 'test.example.com';
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $this->assertText(t('Please enter a valid IP address.'));
 
     // Submit an empty form.
     $edit = array();
     $edit['ip'] = '';
-    $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+    $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
     $this->assertText(t('Please enter a valid IP address.'));
 
     // Submit your own IP address. This fails, although it works when testing manually.
      // TODO: on some systems this test fails due to a bug or inconsistency in cURL.
      // $edit = array();
      // $edit['ip'] = ip_address();
-     // $this->drupalPost('admin/settings/ip-blocking', $edit, t('Save'));
+     // $this->browser->post('admin/settings/ip-blocking', $edit, t('Save'));
      // $this->assertText(t('You may not block your own IP address.'));
   }
 }
@@ -236,17 +236,17 @@ class CronRunTestCase extends DrupalWebT
   function testCronRun() {
     global $base_url;
     // Run cron anonymously without any cron key.
-    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE));
+    $this->browser->get($base_url . '/cron.php', array('external' => TRUE));
     $this->assertResponse(403);
 
     // Run cron anonymously with a random cron key.
     $key = $this->randomName(16);
-    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
+    $this->browser->get($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
     $this->assertResponse(403);
 
     // Run cron anonymously with the valid cron key.
     $key = variable_get('cron_key', 'drupal');
-    $this->drupalGet($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
+    $this->browser->get($base_url . '/cron.php', array('external' => TRUE, 'query' => 'cron_key=' . $key));
     $this->assertResponse(200);
 
     // Execute cron directly.
@@ -273,10 +273,10 @@ class AdminOverviewTestCase extends Drup
     $admin_user1 = $this->drupalCreateUser(array('access administration pages'));
     $this->drupalLogin($admin_user1);
 
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->checkOverview();
 
-    $this->drupalGet('admin/by-module');
+    $this->browser->get('admin/by-module');
     $this->checkOverview();
 
     // Comments on permissions follow the format: [task], [module] that the permission relates to.
@@ -290,10 +290,10 @@ class AdminOverviewTestCase extends Drup
     $admin_user2 = $this->drupalCreateUser($permissions);
     $this->drupalLogin($admin_user2);
 
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->checkOverview(array(t('Content management'), t('User management'), t('Reports'), t('Site building'), t('Site configuration')));
 
-    $this->drupalGet('admin/by-module');
+    $this->browser->get('admin/by-module');
     $this->checkOverview(array(t('Comment'), t('Block'), t('Filter'), t('User'), t('Database logging')));
   }
 
@@ -303,10 +303,10 @@ class AdminOverviewTestCase extends Drup
    * @param array $panels List of panels to be found.
    */
   function checkOverview(array $panels = array()) {
-    if ($this->parse()) {
+    if ($this->browser->parseHTMLcontent()) {
       $found = 0;
       $extra = 0;
-      $divs = $this->xpath("//div[@class='admin-panel']");
+      $divs = $this->browser->xpath("//div[@class='admin-panel']");
       foreach ($divs as $panel) {
         if (in_array(trim($panel->h3), $panels)) {
           $found++;
@@ -339,7 +339,7 @@ class AdminMetaTagTestCase extends Drupa
   public function testMetaTag() {
     list($version,) = explode('.', VERSION);
     $string = '<meta name="Generator" content="Drupal ' . $version. ' (http://drupal.org)" />';
-    $this->drupalGet('node');
+    $this->browser->get('node');
     $this->assertRaw($string, t('Fingerprinting meta tag generated correctly.'), t('System'));
   }
 }
@@ -373,7 +373,7 @@ class AccessDeniedTestCase extends Drupa
   }
 
   function testAccessDenied() {
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->assertText(t('Access denied'), t('Found the default 403 page'));
 
     $edit = array(
@@ -383,26 +383,26 @@ class AccessDeniedTestCase extends Drupa
     $node = $this->drupalCreateNode($edit);
 
     // Use a custom 403 page.
-    $this->drupalPost('admin/settings/error-reporting', array('site_403' => 'node/' . $node->nid), t('Save configuration'));
+    $this->browser->post('admin/settings/error-reporting', array('site_403' => 'node/' . $node->nid), t('Save configuration'));
 
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->assertText($node->title, t('Found the custom 403 page'));
 
     // Logout and check that the user login block is shown on custom 403 pages.
     $this->drupalLogout();
 
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->assertText($node->title, t('Found the custom 403 page'));
     $this->assertText(t('User login'), t('Blocks are shown on the custom 403 page'));
 
     // Log back in and remove the custom 403 page.
     $this->drupalLogin($this->admin_user);
-    $this->drupalPost('admin/settings/error-reporting', array(), t('Reset to defaults'));
+    $this->browser->post('admin/settings/error-reporting', array(), t('Reset to defaults'));
 
     // Logout and check that the user login block is shown on default 403 pages.
     $this->drupalLogout();
 
-    $this->drupalGet('admin');
+    $this->browser->get('admin');
     $this->assertText(t('Access denied'), t('Found the default 403 page'));
     $this->assertText(t('User login'), t('Blocks are shown on the default 403 page'));
   }
@@ -434,7 +434,7 @@ class PageNotFoundTestCase extends Drupa
   }
 
   function testPageNotFound() {
-    $this->drupalGet($this->randomName(10));
+    $this->browser->get($this->randomName(10));
     $this->assertText(t('Page not found'), t('Found the default 404 page'));
 
     $edit = array(
@@ -444,26 +444,26 @@ class PageNotFoundTestCase extends Drupa
     $node = $this->drupalCreateNode($edit);
 
     // Use a custom 404 page.
-    $this->drupalPost('admin/settings/error-reporting', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
+    $this->browser->post('admin/settings/error-reporting', array('site_404' => 'node/' . $node->nid), t('Save configuration'));
 
-    $this->drupalGet($this->randomName(10));
+    $this->browser->get($this->randomName(10));
     $this->assertText($node->title, t('Found the custom 404 page'));
 
     // Logout and check that the user login block is not shown on custom 404 pages.
     $this->drupalLogout();
 
-    $this->drupalGet($this->randomName(10));
+    $this->browser->get($this->randomName(10));
     $this->assertText($node->title, t('Found the custom 404 page'));
     $this->assertNoText(t('User login'), t('Blocks are not shown on the custom 404 page'));
 
     // Log back in and remove the custom 404 page.
     $this->drupalLogin($this->admin_user);
-    $this->drupalPost('admin/settings/error-reporting', array(), t('Reset to defaults'));
+    $this->browser->post('admin/settings/error-reporting', array(), t('Reset to defaults'));
 
     // Logout and check that the user login block is not shown on default 404 pages.
     $this->drupalLogout();
 
-    $this->drupalGet($this->randomName(10));
+    $this->browser->get($this->randomName(10));
     $this->assertText(t('Page not found'), t('Found the default 404 page'));
     $this->assertNoText(t('User login'), t('Blocks are not shown on the default 404 page'));
   }
@@ -497,18 +497,18 @@ class DateTimeFunctionalTest extends Dru
     $node2 = $this->drupalCreateNode(array('created' => strtotime($date2), 'type' => 'article'));
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->browser->get("node/$node1->nid");
     $this->assertText('2007-01-31 21:00:00 -1000', t('Date should be identical, with GMT offset of -10 hours.'));
-    $this->drupalGet("node/$node2->nid");
+    $this->browser->get("node/$node2->nid");
     $this->assertText('2007-07-31 21:00:00 -1000', t('Date should be identical, with GMT offset of -10 hours.'));
 
     // Set time zone to Los Angeles time.
     variable_set('date_default_timezone', 'America/Los_Angeles');
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->browser->get("node/$node1->nid");
     $this->assertText('2007-01-31 23:00:00 -0800', t('Date should be two hours ahead, with GMT offset of -8 hours.'));
-    $this->drupalGet("node/$node2->nid");
+    $this->browser->get("node/$node2->nid");
     $this->assertText('2007-08-01 00:00:00 -0700', t('Date should be three hours ahead, with GMT offset of -7 hours.'));
   }
 }
@@ -568,11 +568,11 @@ class PageTitleFiltering extends DrupalW
      'body' => '!SimpleTest! test body' . $this->randomName(200),
     );
     // Create the node with HTML in the title.
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
 
     $node = node_load(array('title' => $edit['title']));
     $this->assertNotNull($node, 'Node created and found in database');
-    $this->drupalGet("node/" . $node->nid);
+    $this->browser->get("node/" . $node->nid);
     $this->assertText(check_plain($edit['title']), 'Check to make sure tags in the node title are converted.');
   }
 }
Index: modules/taxonomy/taxonomy.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/taxonomy/taxonomy.test,v
retrieving revision 1.15
diff -u -p -r1.15 taxonomy.test
--- modules/taxonomy/taxonomy.test	22 Nov 2008 13:43:13 -0000	1.15
+++ modules/taxonomy/taxonomy.test	30 Nov 2008 16:22:04 -0000
@@ -63,10 +63,10 @@ class TaxonomyVocabularyFunctionalTest e
    */
   function testVocabularyInterface() {
     // Visit the main taxonomy administration page.
-    $this->drupalGet('admin/content/taxonomy');
+    $this->browser->get('admin/content/taxonomy');
 
     // Create a new vocabulary.
-    $this->clickLink(t('Add vocabulary'));
+    $this->browser->clickLink(t('Add vocabulary'));
     $edit = array();
     $edit['name'] = $this->randomName();
     $edit['description'] = $this->randomName();
@@ -76,18 +76,18 @@ class TaxonomyVocabularyFunctionalTest e
     $edit['multiple'] = 1;
     $edit['required'] = 1;
     $edit['weight'] = 0;
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $this->assertRaw(t('Created new vocabulary %name.', array('%name' => $edit['name'])), t('Vocabulary created successfully'));
 
     // Edit the vocabulary.
-    $this->drupalGet('admin/content/taxonomy');
+    $this->browser->get('admin/content/taxonomy');
     $this->assertText($edit['name'], t('Vocabulary found in the vocabulary overview listing.'));
-    $this->clickLink(t('edit vocabulary'));
+    $this->browser->clickLink(t('edit vocabulary'));
     $edit = array();
     $edit['name'] = $this->randomName();
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $this->assertRaw(t('Updated vocabulary %name.', array('%name' => $edit['name'])));
-    $this->drupalGet('admin/content/taxonomy');
+    $this->browser->get('admin/content/taxonomy');
     $this->assertText($edit['name'], t('Vocabulary found in the vocabulary overview listing.'));
   }
 
@@ -108,7 +108,7 @@ class TaxonomyVocabularyFunctionalTest e
       $edit[$key .'[weight]'] = $vocabulary->weight;
     }
     // Saving the new weights via the interface.
-    $this->drupalPost('admin/content/taxonomy/', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/', $edit, t('Save'));
 
     // Load the vocabularies from the database.
     $new_vocabularies = taxonomy_get_vocabularies();
@@ -127,9 +127,9 @@ class TaxonomyVocabularyFunctionalTest e
     $vocabularies = taxonomy_get_vocabularies();
     foreach ($vocabularies as $key => $vocabulary) {
       $edit = array();
-      $this->drupalPost('admin/content/taxonomy/' . $vocabulary->vid, $edit, t('Delete'));
+      $this->browser->post('admin/content/taxonomy/' . $vocabulary->vid, $edit, t('Delete'));
       // Submit the confirm form for deletion.
-      $this->drupalPost(NULL, NULL, t('Delete'));
+      $this->browser->post(NULL, NULL, t('Delete'));
     }
     // Confirm that no vocabularies are found in the database.
     $this->assertFalse(taxonomy_get_vocabularies(), t('No vocabularies found in the database'));
@@ -146,7 +146,7 @@ class TaxonomyVocabularyFunctionalTest e
       'name' => $this->randomName(),
       'nodes[article]' => 'article',
     );
-    $this->drupalPost('admin/content/taxonomy/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/add', $edit, t('Save'));
     $this->assertText(t('Created new vocabulary'), t('New vocabulary was created.'));
 
     // Check the created vocabulary.
@@ -157,12 +157,12 @@ class TaxonomyVocabularyFunctionalTest e
 
     // Delete the vocabulary.
     $edit = array();
-    $this->drupalPost('admin/content/taxonomy/' .$vid, $edit, t('Delete'));
+    $this->browser->post('admin/content/taxonomy/' .$vid, $edit, t('Delete'));
     $this->assertRaw(t('Are you sure you want to delete the vocabulary %name?', array('%name' => $vocabulary->name)), t('[confirm deletion] Asks for confirmation.'));
     $this->assertText(t('Deleting a vocabulary will delete all the terms in it. This action cannot be undone.'), t('[confirm deletion] Inform that all terms will be deleted.'));
 
     // Confirm deletion.
-    $this->drupalPost(NULL, NULL, t('Delete'));
+    $this->browser->post(NULL, NULL, t('Delete'));
     $this->assertRaw(t('Deleted vocabulary %name.', array('%name' => $vocabulary->name)), t('Vocabulary deleted'));
     $this->assertFalse(taxonomy_vocabulary_load($vid, TRUE), t('Vocabulary is not found in the database'));
   }
@@ -267,7 +267,7 @@ class TaxonomyTermTestCase extends Taxon
     // Edit $term1 and add $term2 as a relationship.
     $edit = array();
     $edit['relations[]'] = $term2->tid;
-    $this->drupalPost('taxonomy/term/' . $term1->tid . '/edit', $edit, t('Save'));
+    $this->browser->post('taxonomy/term/' . $term1->tid . '/edit', $edit, t('Save'));
 
     $related = taxonomy_get_related($term1->tid);
     $this->assertTrue(isset($related[$term2->tid]), t('Related term was found'));
@@ -303,7 +303,7 @@ class TaxonomyTermTestCase extends Taxon
     // Edit $term2, setting $term1 as parent.
     $edit = array();
     $edit['parent[]'] = $term1->tid;
-    $this->drupalPost('taxonomy/term/' . $term2->tid . '/edit', $edit, t('Save'));
+    $this->browser->post('taxonomy/term/' . $term2->tid . '/edit', $edit, t('Save'));
 
     // Check the hierarchy.
     $children = taxonomy_get_children($term1->tid);
@@ -334,23 +334,23 @@ class TaxonomyTermTestCase extends Taxon
     $edit['title'] = $this->randomName();
     $edit['body'] = $this->randomName();
     $edit['taxonomy[' . $this->vocabulary->vid . ']'] = $term1->tid;
-    $this->drupalPost('node/add/article', $edit, t('Save'));
+    $this->browser->post('node/add/article', $edit, t('Save'));
 
     // Check that the term is displayed when the node is viewed.
     $node = node_load(array('title' => $edit['title']));
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertText($term1->name, t('Term is displayed when viewing the node.'));
 
     // Edit the node with a different term.
     $edit['taxonomy[' . $this->vocabulary->vid . ']'] = $term2->tid;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
 
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
     $this->assertText($term2->name, t('Term is displayed when viewing the node.'));
 
     // Delete node through browser.
-    $this->drupalPost('node/' . $node->nid . '/delete', array(), t('Delete'));
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->post('node/' . $node->nid . '/delete', array(), t('Delete'));
+    $this->browser->get('node/' . $node->nid);
     $this->assertNoText($term2->name, t('Checking if node exists'));
     // Checking database fields.
     $result = db_query('SELECT * FROM {term_node} WHERE nid = :nid', array(':nid' => $node->nid))->fetch();
@@ -375,7 +375,7 @@ class TaxonomyTermTestCase extends Taxon
     // free-tagging field created by the default profile.
     $edit['taxonomy[tags][' . $this->vocabulary->vid .']'] =  implode(', ', $terms);
     $edit['body'] = $this->randomName();
-    $this->drupalPost('node/add/article', $edit, t('Save'));
+    $this->browser->post('node/add/article', $edit, t('Save'));
     $this->assertRaw(t('@type %title has been created.', array('@type' => t('Article'), '%title' => $edit['title'])), t('The node was created successfully'));
     foreach ($terms as $term) {
       $this->assertText($term, t('The term was saved and appears on the node page'));
@@ -395,18 +395,18 @@ class TaxonomyTermTestCase extends Taxon
     $edit['parent[]'] = 0;
 
     // Create the term to edit.
-    $this->drupalPost('admin/content/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save'));
+    $this->browser->post('admin/content/taxonomy/' . $this->vocabulary->vid . '/add', $edit, t('Save'));
 
     $term = taxonomy_get_term_by_name($edit['name']);
     $this->assertNotNull($term, t('Term found in database'));
 
     // Submitting a term takes us to the add page; we need the List page.
-    $this->drupalGet('admin/content/taxonomy/' . $this->vocabulary->vid . '/list');
+    $this->browser->get('admin/content/taxonomy/' . $this->vocabulary->vid . '/list');
 
     // Test edit link as accessed from Taxonomy administration pages.
     // Because Simpletest creates its own database when running tests, we know
     // the first edit link found on the listing page is to our term.
-    $this->clickLink(t('edit'));
+    $this->browser->clickLink(t('edit'));
 
     // This failed inexplicably with assertText, so used assertRaw. @TODO: Why?
     $this->assertText($edit['name'], t('The randomly generated term name is present.'));
@@ -418,10 +418,10 @@ class TaxonomyTermTestCase extends Taxon
     );
 
     // Edit the term.
-    $this->drupalPost('taxonomy/term/' . $term[0]->tid . '/edit', $edit, t('Save'));
+    $this->browser->post('taxonomy/term/' . $term[0]->tid . '/edit', $edit, t('Save'));
 
     // View the term and check that it is correct.
-    $this->drupalGet('taxonomy/term/' . $term[0]->tid);
+    $this->browser->get('taxonomy/term/' . $term[0]->tid);
     $this->assertText($edit['name'], t('The randomly generated term name is present.'));
     $this->assertText($edit['description'], t('The randomly generated term description is present.'));
   }
Index: modules/tracker/tracker.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/tracker/tracker.test,v
retrieving revision 1.5
diff -u -p -r1.5 tracker.test
--- modules/tracker/tracker.test	25 Nov 2008 13:14:29 -0000	1.5
+++ modules/tracker/tracker.test	30 Nov 2008 16:22:04 -0000
@@ -39,7 +39,7 @@ class TrackerTest extends DrupalWebTestC
     $this->drupalCreateNode($page1);
     $this->drupalCreateNode($page2);
 
-    $this->drupalGet('tracker');
+    $this->browser->get('tracker');
     $this->assertText($page1['title'], t('Nodes show up in the tracker listing.'));
     $this->assertNoText($page2['title'], t('Unpublished nodes do not show up in the tracker listing.'));
   }
@@ -63,7 +63,7 @@ class TrackerTest extends DrupalWebTestC
     $this->drupalCreateNode($page1);
     $this->drupalCreateNode($page2);
 
-    $this->drupalGet('user/' . $this->user->uid . '/track');
+    $this->browser->get('user/' . $this->user->uid . '/track');
     $this->assertText($page1['title'], t("Nodes show up in the author's tracker listing."));
     $this->assertNoText($page2['title'], t("Unpublished nodes do not show up in the author's tracker listing."));
   }
@@ -79,19 +79,19 @@ class TrackerTest extends DrupalWebTestC
     );
     $node = $this->drupalCreateNode($edit);
 
-    $this->drupalGet('tracker');
+    $this->browser->get('tracker');
     $this->assertPattern('/' . $edit['title'] . '.*new/', t('New nodes are flagged as such in the tracker listing.'));
 
-    $this->drupalGet('node/' . $node->nid);
-    $this->drupalGet('tracker');
+    $this->browser->get('node/' . $node->nid);
+    $this->browser->get('tracker');
     $this->assertNoPattern('/' . $edit['title'] . '.*new/', t('Visited nodes are not flagged as new.'));
 
     $this->drupalLogin($this->other_user);
-    $this->drupalGet('tracker');
+    $this->browser->get('tracker');
     $this->assertPattern('/' . $edit['title'] . '.*new/', t('For another user, new nodes are flagged as such in the tracker listing.'));
 
-    $this->drupalGet('node/' . $node->nid);
-    $this->drupalGet('tracker');
+    $this->browser->get('node/' . $node->nid);
+    $this->browser->get('tracker');
     $this->assertNoPattern('/' . $edit['title'] . '.*new/', t('For another user, visited nodes are not flagged as new.'));
   }
 
@@ -115,12 +115,12 @@ class TrackerTest extends DrupalWebTestC
       'subject' => $this->randomName(),
       'comment' => $this->randomName(20),
     );
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save')); // The new comment is automatically viewed by the current user.
+    $this->browser->post('comment/reply/' . $node->nid, $comment, t('Save')); // The new comment is automatically viewed by the current user.
 
     $this->drupalLogin($this->other_user);
-    $this->drupalGet('tracker');
+    $this->browser->get('tracker');
     $this->assertText('1 new', t('New comments are counted on the tracker listing pages.'));
-    $this->drupalGet('node/' . $node->nid);
+    $this->browser->get('node/' . $node->nid);
 
     // Add another comment as other_user.
     $comment = array(
@@ -130,10 +130,10 @@ class TrackerTest extends DrupalWebTestC
     // If the comment is posted in the same second as the last one then Drupal
     // can't tell a difference, so wait one second here.
     sleep(1);
-    $this->drupalPost('comment/reply/' . $node->nid, $comment, t('Save'));
+    $this->browser->post('comment/reply/' . $node->nid, $comment, t('Save'));
 
     $this->drupalLogin($this->user);
-    $this->drupalGet('tracker');
+    $this->browser->get('tracker');
     $this->assertText('1 new', t('New comments are counted on the tracker listing pages.'));
   }
 }
Index: modules/translation/translation.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/translation/translation.test,v
retrieving revision 1.5
diff -u -p -r1.5 translation.test
--- modules/translation/translation.test	25 Nov 2008 13:14:29 -0000	1.5
+++ modules/translation/translation.test	30 Nov 2008 16:22:04 -0000
@@ -31,10 +31,10 @@ class TranslationTestCase extends Drupal
     $this->addLanguage('es');
 
     // Set page content type to use multilingual support with translation.
-    $this->drupalGet('admin/build/node-type/page');
+    $this->browser->get('admin/build/node-type/page');
     $edit = array();
     $edit['language_content_type'] = 2;
-    $this->drupalPost('admin/build/node-type/page', $edit, t('Save content type'));
+    $this->browser->post('admin/build/node-type/page', $edit, t('Save content type'));
     $this->assertRaw(t('The content type %type has been updated.', array('%type' => 'Page')), t('Page content type has been updated.'));
 
     $this->drupalLogout();
@@ -54,18 +54,18 @@ class TranslationTestCase extends Drupal
     $edit = array();
     $edit['body'] = $this->randomName();
     $edit['translation[retranslate]'] = TRUE;
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node_title)), t('Original node updated.'));
 
     // Check to make sure that interface shows translation as outdated
-    $this->drupalGet('node/' . $node->nid . '/translate');
+    $this->browser->get('node/' . $node->nid . '/translate');
     $this->assertRaw('<span class="marker">' . t('outdated') . '</span>', t('Translation marked as outdated.'));
 
     // Update translation and mark as updated.
     $edit = array();
     $edit['body'] = $this->randomName();
     $edit['translation[status]'] = FALSE;
-    $this->drupalPost('node/' . $node_translation->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node_translation->nid . '/edit', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been updated.', array('%title' => $node_translation_title)), t('Translated node updated.'));
   }
 
@@ -77,13 +77,13 @@ class TranslationTestCase extends Drupal
    */
   function addLanguage($language_code) {
     // Check to make sure that language has not already been installed.
-    $this->drupalGet('admin/settings/language');
+    $this->browser->get('admin/settings/language');
 
-    if (strpos($this->drupalGetContent(), 'enabled[' . $language_code . ']') === FALSE) {
+    if (strpos($this->browser->content, 'enabled[' . $language_code . ']') === FALSE) {
       // Doesn't have language installed so add it.
       $edit = array();
       $edit['langcode'] = $language_code;
-      $this->drupalPost('admin/settings/language/add', $edit, t('Add language'));
+      $this->browser->post('admin/settings/language/add', $edit, t('Add language'));
 
       $languages = language_list('language', TRUE); // Make sure we're not using a stale list.
       $this->assertTrue(array_key_exists($language_code, $languages), t('Language was installed successfully.'));
@@ -95,7 +95,7 @@ class TranslationTestCase extends Drupal
     else {
       // Ensure that it is enabled.
       $this->assertTrue(true, 'Language [' . $language_code . '] already installed.');
-      $this->drupalPost(NULL, array('enabled[' . $language_code . ']' => TRUE), t('Save configuration'));
+      $this->browser->post(NULL, array('enabled[' . $language_code . ']' => TRUE), t('Save configuration'));
 
       $this->assertRaw(t('Configuration saved.'), t('Language successfully enabled.'));
     }
@@ -113,7 +113,7 @@ class TranslationTestCase extends Drupal
     $edit['title'] = $title;
     $edit['body'] = $body;
     $edit['language'] = $language;
-    $this->drupalPost('node/add/page', $edit, t('Save'));
+    $this->browser->post('node/add/page', $edit, t('Save'));
     $this->assertRaw(t('Page %title has been created.', array('%title' => $edit['title'])), t('Page created.'));
 
     // Check to make sure the node was created.
@@ -132,12 +132,12 @@ class TranslationTestCase extends Drupal
    * @param string $language Langauge code.
    */
   function createTranslation($nid, $title, $body, $language) {
-    $this->drupalGet('node/add/page', array('query' => array('translation' => $nid, 'language' => $language)));
+    $this->browser->get('node/add/page', array('query' => array('translation' => $nid, 'language' => $language)));
 
     $edit = array();
     $edit['title'] = $title;
     $edit['body'] = $body;
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $this->assertRaw(t('Page %title has been created.', array('%title' => $edit['title'])), t('Translation created.'));
 
     // Check to make sure that translation was successfull.
Index: modules/trigger/trigger.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/trigger/trigger.test,v
retrieving revision 1.4
diff -u -p -r1.4 trigger.test
--- modules/trigger/trigger.test	25 Nov 2008 13:14:29 -0000	1.4
+++ modules/trigger/trigger.test	30 Nov 2008 16:22:04 -0000
@@ -32,7 +32,7 @@ class TriggerContentTestCase extends Dru
       $test_user = $this->drupalCreateUser(array('administer actions'));
       $this->drupalLogin($test_user);
       $edit = array('aid' => $hash);
-      $this->drupalPost('admin/build/trigger/node', $edit, t('Assign'));
+      $this->browser->post('admin/build/trigger/node', $edit, t('Assign'));
       // Create an unpublished node.
       $web_user = $this->drupalCreateUser(array('create page content', 'access content', 'administer nodes'));
       $this->drupalLogin($web_user);
@@ -40,7 +40,7 @@ class TriggerContentTestCase extends Dru
       $edit['title']    = '!SimpleTest test node! ' . $this->randomName(10);
       $edit['body']     = '!SimpleTest test body! ' . $this->randomName(32) . ' ' . $this->randomName(32);
       $edit[$info['property']] = !$info['expected'];
-      $this->drupalPost('node/add/page', $edit, t('Save'));
+      $this->browser->post('node/add/page', $edit, t('Save'));
       // Make sure the text we want appears.
       $this->assertRaw(t('!post %title has been created.', array ('!post' => 'Page', '%title' => $edit['title'])), t('Make sure the page has actually been created'));
       // Action should have been fired.
@@ -52,13 +52,13 @@ class TriggerContentTestCase extends Dru
       $test_user = $this->drupalCreateUser(array('administer actions'));
       $this->drupalLogin($test_user);
       $edit = array('aid' => $hash);
-      $this->drupalPost('admin/build/trigger/node', $edit, t('Assign'));
+      $this->browser->post('admin/build/trigger/node', $edit, t('Assign'));
       $edit = array('aid' => $hash);
-      $this->drupalPost('admin/build/trigger/node', $edit, t('Assign'));
+      $this->browser->post('admin/build/trigger/node', $edit, t('Assign'));
       $this->assertRaw(t('The action you chose is already assigned to that trigger.'), t('Check to make sure an error occurs when assigning an action to a trigger twice.'));
 
       // Test 3: The action should be able to be unassigned from a trigger.
-      $this->drupalPost('admin/build/trigger/unassign/nodeapi/presave/' . $hash, array(), t('Unassign'));
+      $this->browser->post('admin/build/trigger/unassign/nodeapi/presave/' . $hash, array(), t('Unassign'));
       $this->assertRaw(t('Action %action has been unassigned.', array('%action' => ucfirst($info['name']))), t('Check to make sure the @action action can be unassigned from the trigger.', array('@action' => $info['name'])));
       $assigned = db_result(db_query("SELECT COUNT(*) FROM {trigger_assignments} WHERE aid IN ('" . implode("','", $content_actions) . "')"));
       $this->assertFalse($assigned, t('Check to make sure unassign worked properly at the database level.'));
Index: modules/upload/upload.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/upload/upload.test,v
retrieving revision 1.8
diff -u -p -r1.8 upload.test
--- modules/upload/upload.test	25 Nov 2008 13:14:29 -0000	1.8
+++ modules/upload/upload.test	30 Nov 2008 16:22:04 -0000
@@ -30,7 +30,7 @@ class UploadTestCase extends DrupalWebTe
     $edit['upload_extensions_default'] = 'jpg jpeg gif png txt doc xls pdf ppt pps odt ods odp';
     $edit['upload_uploadsize_default'] = '1.5';
     $edit['upload_usersize_default'] = '1.5';
-    $this->drupalPost('admin/settings/uploads', $edit, t('Save configuration'));
+    $this->browser->post('admin/settings/uploads', $edit, t('Save configuration'));
     $this->assertText('The configuration options have been saved.', 'Upload setting saved.');
 
     $this->drupalLogout();
@@ -57,7 +57,7 @@ class UploadTestCase extends DrupalWebTe
       // Rename file.
       $edit = array();
       $edit['files[' . $upload->fid . '][description]'] = $new_name = substr($upload->description, 1);
-      $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+      $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
       $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), 'File renamed successfully.');
 
       $this->assertText($new_name, $new_name . ' found on node.');
@@ -66,11 +66,11 @@ class UploadTestCase extends DrupalWebTe
       // Delete a file.
       $edit = array();
       $edit['files[' . $upload->fid . '][remove]'] = TRUE;
-      $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+      $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
       $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), 'File deleted successfully.');
 
       $this->assertNoText($new_name, $new_name . ' not found on node.');
-      $this->drupalGet($base_url . '/' . file_directory_path() . '/' . $upload->description, array('external' => TRUE));
+      $this->browser->get($base_url . '/' . file_directory_path() . '/' . $upload->description, array('external' => TRUE));
       $this->assertResponse(array(404), 'Uploaded ' . $upload->description . ' is not accessible.');
     }
     else {
@@ -163,7 +163,7 @@ class UploadTestCase extends DrupalWebTe
         $edit[$key . '_' . $rid] = $value;
       }
     }
-    $this->drupalPost('admin/settings/uploads', $edit, 'Save configuration');
+    $this->browser->post('admin/settings/uploads', $edit, 'Save configuration');
     $this->assertText('The configuration options have been saved.', 'Upload setting saved.');
   }
 
@@ -177,7 +177,7 @@ class UploadTestCase extends DrupalWebTe
   function uploadFile($node, $filename, $assert = TRUE) {
     $edit = array();
     $edit['files[upload]'] = $filename; //edit-upload
-    $this->drupalPost('node/' . $node->nid . '/edit', $edit, t('Save'));
+    $this->browser->post('node/' . $node->nid . '/edit', $edit, t('Save'));
     if ($assert) {
       $this->assertRaw(t('Page %title has been updated.', array('%title' => $node->title)), 'File attached successfully.');
     }
@@ -191,9 +191,9 @@ class UploadTestCase extends DrupalWebTe
   function checkUploadedFile($filename) {
     global $base_url;
     $file = realpath(file_directory_path() . '/' . $filename);
-    $this->drupalGet($base_url . '/' . file_directory_path() . '/' . $filename, array('external' => TRUE));
+    $this->browser->get($base_url . '/' . file_directory_path() . '/' . $filename, array('external' => TRUE));
     $this->assertResponse(array(200), 'Uploaded ' . $filename . ' is accessible.');
-    $this->assertEqual(file_get_contents($file), $this->drupalGetContent(), 'Uploaded contents of ' . $filename . ' verified.');
+    $this->assertEqual(file_get_contents($file), $this->browser->content, 'Uploaded contents of ' . $filename . ' verified.');
   }
 
   /**
Index: modules/user/user.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/user/user.test,v
retrieving revision 1.22
diff -u -p -r1.22 user.test
--- modules/user/user.test	25 Nov 2008 13:14:29 -0000	1.22
+++ modules/user/user.test	30 Nov 2008 16:22:04 -0000
@@ -27,7 +27,7 @@ class UserRegistrationTestCase extends D
     $edit = array();
     $edit['name'] = $name = $this->randomName();
     $edit['mail'] = $mail = $edit['name'] . '@example.com';
-    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->browser->post('user/register', $edit, t('Create new account'));
     $this->assertText(t('Your password and further instructions have been sent to your e-mail address.'), t('User registered successfully.'));
 
     // Check database for created user.
@@ -51,16 +51,16 @@ class UserRegistrationTestCase extends D
     $edit = array();
     $edit['name'] = $name;
     $edit['pass'] = 'foo';
-    $this->drupalPost('user', $edit, t('Log in'));
+    $this->browser->post('user', $edit, t('Log in'));
     $this->assertText(t('Sorry, unrecognized username or password. Have you forgotten your password?'), t('Invalid login attempt failed.'));
 
     // Login using password reset page.
     $url = user_pass_reset_url($user);
     sleep(1); // TODO Find better way.
-    $this->drupalGet($url);
+    $this->browser->get($url);
     $this->assertText(t('This login can be used only once.'), t('Login can be used only once.'));
 
-    $this->drupalPost(NULL, NULL, t('Log in'));
+    $this->browser->post(NULL, NULL, t('Log in'));
     $this->assertText(t('You have just used your one-time login link. It is no longer necessary to use this link to login. Please change your password.'), t('This link is no longer valid.'));
 
     // Change user password.
@@ -68,7 +68,7 @@ class UserRegistrationTestCase extends D
     $edit = array();
     $edit['pass[pass1]'] = $new_pass;
     $edit['pass[pass2]'] = $new_pass;
-    $this->drupalPost(NULL, $edit, t('Save'));
+    $this->browser->post(NULL, $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), t('Password changed to @password', array('@password' => $new_pass)));
 
     // Make sure password changes are present in database.
@@ -78,21 +78,21 @@ class UserRegistrationTestCase extends D
     $this->assertTrue(user_check_password($new_pass, $user), t('Correct password in database.'));
 
     // Logout of user account.
-    $this->clickLink(t('Log out'));
+    $this->browser->clickLink(t('Log out'));
     $this->assertNoText($user->name, t('Logged out.'));
 
     // Login user.
     $edit = array();
     $edit['name'] = $user->name;
     $edit['pass'] = $new_pass;
-    $this->drupalPost('user', $edit, t('Log in'));
+    $this->browser->post('user', $edit, t('Log in'));
     $this->assertText(t('Log out'), t('Logged in.'));
 
     $this->assertText($user->name, t('[logged in] Username found.'));
     $this->assertNoText(t('Sorry. Unrecognized username or password.'), t('[logged in] No message for unrecognized username or password.'));
     $this->assertNoText(t('User login'), t('[logged in] No user login form present.'));
 
-    $this->drupalGet('user');
+    $this->browser->get('user');
     $this->assertText($user->name, t('[user auth] Not login page.'));
     $this->assertText(t('View'), t('[user auth] Found view tab on the profile page.'));
     $this->assertText(t('Edit'), t('[user auth] Found edit tab on the profile page.'));
@@ -171,7 +171,7 @@ class UserDeleteTestCase extends DrupalW
     $edit = array();
     $edit['name'] = $this->randomName();
     $edit['mail'] = $edit['name'] . '@example.com';
-    $this->drupalPost('user/register', $edit, t('Create new account'));
+    $this->browser->post('user/register', $edit, t('Create new account'));
     $this->assertText(t('Your password and further instructions have been sent to your e-mail address.'), t('User registered successfully.'));
 
     $user = user_load($edit);
@@ -181,13 +181,13 @@ class UserDeleteTestCase extends DrupalW
     $this->drupalLogin($admin_user);
 
     // Delete user.
-    $this->drupalGet('user/' . $user->uid . '/edit');
-    $this->drupalPost(NULL, NULL, t('Delete'));
+    $this->browser->get('user/' . $user->uid . '/edit');
+    $this->browser->post(NULL, NULL, t('Delete'));
     $this->assertRaw(t('Are you sure you want to delete the account %name?', array('%name' => $user->name)), t('[confirm deletion] Asks for confirmation.'));
     $this->assertText(t('All submissions made by this user will be attributed to the anonymous account. This action cannot be undone.'), t('[confirm deletion] Inform that all submissions will be attributed to anonymouse account.'));
 
     // Confirm deletion.
-    $this->drupalPost(NULL, NULL, t('Delete'));
+    $this->browser->post(NULL, NULL, t('Delete'));
     $this->assertRaw(t('%name has been deleted.', array('%name' => $user->name)), t('User deleted'));
     $this->assertFalse(user_load($edit), t('User is not found in the database'));
   }
@@ -398,7 +398,7 @@ class UserPictureTestCase extends Drupal
 
   function saveUserPicture($image) {
     $edit = array('files[picture_upload]' => realpath($image->filename));
-    $this->drupalPost('user/' . $this->user->uid.'/edit', $edit, t('Save'));
+    $this->browser->post('user/' . $this->user->uid.'/edit', $edit, t('Save'));
 
     $img_info = image_get_info($image->filename);
     $picture_dir = variable_get('user_picture_path', 'pictures');
@@ -444,7 +444,7 @@ class UserPermissionsTestCase extends Dr
     $this->assertFalse(user_access('administer nodes', $account, TRUE), t('User does not have "administer nodes" permission.'));
     $edit = array();
     $edit[$rid . '[administer nodes]'] = TRUE;
-    $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
+    $this->browser->post('admin/user/permissions', $edit, t('Save permissions'));
     $this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
     $this->assertTrue(user_access('administer nodes', $account, TRUE), t('User now has "administer nodes" permission.'));
 
@@ -452,7 +452,7 @@ class UserPermissionsTestCase extends Dr
     $this->assertTrue(user_access('access user profiles', $account, TRUE), t('User has "access user profiles" permission.'));
     $edit = array();
     $edit[$rid . '[access user profiles]'] = FALSE;
-    $this->drupalPost('admin/user/permissions', $edit, t('Save permissions'));
+    $this->browser->post('admin/user/permissions', $edit, t('Save permissions'));
     $this->assertText(t('The changes have been saved.'), t('Successful save message displayed.'));
     $this->assertFalse(user_access('access user profiles', $account, TRUE), t('User no longer has "access user profiles" permission.'));
   }
@@ -480,7 +480,7 @@ class UserAdminTestCase extends DrupalWe
     // Create admin user to delete registered user.
     $admin_user = $this->drupalCreateUser(array('administer users'));
     $this->drupalLogin($admin_user);
-    $this->drupalGet('admin/user/user');
+    $this->browser->get('admin/user/user');
     $this->assertText($user_a->name, t('Found user A on admin users page'));
     $this->assertText($user_b->name, t('Found user B on admin users page'));
     $this->assertText($user_c->name, t('Found user C on admin users page'));
@@ -490,7 +490,7 @@ class UserAdminTestCase extends DrupalWe
     $edit = array();
     $edit['filter'] = 'permission';
     $edit['permission'] = 'administer taxonomy';
-    $this->drupalPost('admin/user/user', $edit, t('Filter'));
+    $this->browser->post('admin/user/user', $edit, t('Filter'));
 
     // Check if the correct users show up.
     $this->assertNoText($user_a->name, t('User A not on filtered by perm  admin users page'));
@@ -503,7 +503,7 @@ class UserAdminTestCase extends DrupalWe
     $edit = array();
     $edit['operation'] = 'block';
     $edit['accounts['. $account->uid .']'] = TRUE;
-    $this->drupalPost('admin/user/user', $edit, t('Update'));
+    $this->browser->post('admin/user/user', $edit, t('Update'));
     $account = user_load(array('name' => $user_b->name));
     $this->assertEqual($account->status, 0, 'User B blocked');
   }
@@ -545,26 +545,26 @@ class UserTimeZoneFunctionalTest extends
     $node3 = $this->drupalCreateNode(array('created' => strtotime($date3), 'type' => 'article'));
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->browser->get("node/$node1->nid");
     $this->assertText('2007-03-09 21:00 PST', t('Date should be PST.'));
-    $this->drupalGet("node/$node2->nid");
+    $this->browser->get("node/$node2->nid");
     $this->assertText('2007-03-11 01:00 PST', t('Date should be PST.'));
-    $this->drupalGet("node/$node3->nid");
+    $this->browser->get("node/$node3->nid");
     $this->assertText('2007-03-20 21:00 PDT', t('Date should be PDT.'));
 
     // Change user time zone to Santiago time.
     $edit = array();
     $edit['mail'] = $web_user->mail;
     $edit['timezone'] = 'America/Santiago';
-    $this->drupalPost("user/$web_user->uid/edit", $edit, t('Save'));
+    $this->browser->post("user/$web_user->uid/edit", $edit, t('Save'));
     $this->assertText(t('The changes have been saved.'), t('Time zone changed to Santiago time.'));
 
     // Confirm date format and time zone.
-    $this->drupalGet("node/$node1->nid");
+    $this->browser->get("node/$node1->nid");
     $this->assertText('2007-03-10 02:00 CLST', t('Date should be Chile summer time; five hours ahead of PST.'));
-    $this->drupalGet("node/$node2->nid");
+    $this->browser->get("node/$node2->nid");
     $this->assertText('2007-03-11 05:00 CLT', t('Date should be Chile time; four hours ahead of PST'));
-    $this->drupalGet("node/$node3->nid");
+    $this->browser->get("node/$node3->nid");
     $this->assertText('2007-03-21 00:00 CLT', t('Date should be Chile time; three hours ahead of PDT.'));
   }
 }
@@ -595,13 +595,13 @@ class UserAutocompleteTestCase extends D
   function testUserAutocomplete() {
     // Check access from unprivileged user, should be denied.
     $this->drupalLogin($this->unprivileged_user);
-    $this->drupalGet('user/autocomplete/' . $this->unprivileged_user->name[0]);
+    $this->browser->get('user/autocomplete/' . $this->unprivileged_user->name[0]);
     $this->assertResponse(403, t('Autocompletion access denied to user without permission.'));
 
     // Check access from privileged user.
     $this->drupalLogout();
     $this->drupalLogin($this->privileged_user);
-    $this->drupalGet('user/autocomplete/' . $this->unprivileged_user->name[0]);
+    $this->browser->get('user/autocomplete/' . $this->unprivileged_user->name[0]);
     $this->assertResponse(200, t('Autocompletion access allowed.'));
 
     // Using first letter of the user's name, make sure the user's full name is in the results.
@@ -648,12 +648,12 @@ class UserBlocksUnitTests extends Drupal
 
     // Test block output.
     $block = user_block('view', 'online');
-    $this->drupalSetContent($block['content']);
+    $this->browser->content = $block['content'];
     $this->assertRaw(t('%members and %visitors', array('%members' => '2 users', '%visitors' => '2 guests')), t('Correct number of online users (2 users and 2 guests).'));
     $this->assertText($user1->name, t('Active user 1 found in online list.'));
     $this->assertText($user2->name, t('Active user 2 found in online list.'));
     $this->assertNoText($user3->name, t("Inactive user not found in online list."));
-    $this->assertTrue(strpos($this->drupalGetContent(), $user1->name) > strpos($this->drupalGetContent(), $user2->name), t('Online users are ordered correctly.'));
+    $this->assertTrue(strpos($this->browser->content, $user1->name) > strpos($this->browser->content, $user2->name), t('Online users are ordered correctly.'));
   }
 
   /**
