Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.56
diff -u -9 -p -r1.56 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	9 Nov 2008 03:07:54 -0000	1.56
+++ modules/simpletest/drupal_web_test_case.php	22 Nov 2008 15:13:34 -0000
@@ -778,25 +778,25 @@ class DrupalWebTestCase {
       // Rebuild caches.
       $this->refreshVariables();
 
       // Close the CURL handler.
       $this->curlClose();
     }
   }
 
   /**
-   * Initializes the cURL connection and gets a session cookie.
+   * Initializes the cURL connection.
    *
-   * This function will add authentication headers as specified in
-   * simpletest_httpauth_username and simpletest_httpauth_pass variables.
-   * Also, see the description of $curl_options among the properties.
+   * 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 curlConnect() {
+  protected function curlInitialize() {
     global $base_url, $db_prefix;
     if (!isset($this->ch)) {
       $this->ch = curl_init();
       $curl_options = $this->curl_options + array(
         CURLOPT_COOKIEJAR => $this->cookie_file,
         CURLOPT_URL => $base_url,
         CURLOPT_FOLLOWLOCATION => TRUE,
         CURLOPT_RETURNTRANSFER => TRUE,
         CURLOPT_SSL_VERIFYPEER => FALSE,  // Required to make the tests run on https://
@@ -806,32 +806,32 @@ class DrupalWebTestCase {
       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;
       }
-      return $this->curlExec($curl_options);
+      curl_setopt_array($this->ch, $this->curl_options + $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->curlConnect();
+    $this->curlInitialize();
     $url = empty($curl_options[CURLOPT_URL]) ? curl_getinfo($this->ch, CURLINFO_EFFECTIVE_URL) : $curl_options[CURLOPT_URL];
     curl_setopt_array($this->ch, $this->curl_options + $curl_options);
     $this->drupalSetContent(curl_exec($this->ch), curl_getinfo($this->ch, 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.
Index: modules/simpletest/tests/bootstrap.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/bootstrap.test,v
retrieving revision 1.5
diff -u -9 -p -r1.5 bootstrap.test
--- modules/simpletest/tests/bootstrap.test	22 Nov 2008 13:33:00 -0000	1.5
+++ modules/simpletest/tests/bootstrap.test	22 Nov 2008 15:13:34 -0000
@@ -94,19 +94,21 @@ class BootstrapPageCacheTestCase extends
     );
   }
 
   /**
    * Enable cache and examine HTTP headers.
    */
   function testPageCache() {
     global $base_url;
     variable_set('cache', 1);
-    // Retrieve the front page, which has already been cached by $this->curlConnect();
+    // Fill the cache.
+    $this->drupalGet($base_url);
+
     $this->drupalHead($base_url);
     $this->assertText('ETag: ', t('Verify presence of ETag header indicating that page caching is enabled.'));
   }
 
 }
 
 class BootstrapVariableTestCase extends DrupalWebTestCase {
 
   function setUp() {
@@ -158,24 +160,22 @@ class HookBootExitTestCase extends Drupa
 
   function setUp() {
     parent::setUp('system_test', 'dblog');
   }
 
   /**
    * Test calling of hook_boot() and hook_exit().
    */
   function testHookBootExit() {
-    // Test with cache disabled. Boot and exit should always fire. Initialize
-    // the number of hook calls to one since the first call to two since the
-    // first call to drupalGet actually performs two HTTP requests.
+    // Test with cache disabled. Boot and exit should always fire.
     variable_set('cache', CACHE_DISABLED);
     $this->drupalGet('');
-    $calls = 2;
+    $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('');
     $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.'));
