Index: modules/simpletest/tests/common.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common.test,v
retrieving revision 1.115
diff -u -9 -p -r1.115 common.test
--- modules/simpletest/tests/common.test	21 Jun 2010 14:59:14 -0000	1.115
+++ modules/simpletest/tests/common.test	1 Jul 2010 20:46:11 -0000
@@ -881,68 +881,68 @@ class DrupalHTTPRequestTestCase extends 
     // @link http://bugs.php.net/bug.php?id=47929
     if (!$is_https) {
       // Test that timeout is respected. The test machine is expected to be able
       // to make the connection (i.e. complete the fsockopen()) in 2 seconds and
       // return within a total of 5 seconds. If the test machine is extremely
       // slow, the test will fail. fsockopen() has been seen to time out in
       // slightly less than the specified timeout, so allow a little slack on
       // the minimum expected time (i.e. 1.8 instead of 2).
       timer_start(__METHOD__);
-      $result = drupal_http_request(url('system-test/sleep/10', array('absolute' => TRUE)), array('timeout' => 2));
+      $result = drupal_http_request(url('common-test/sleep/10', array('absolute' => TRUE)), array('timeout' => 2));
       $time = timer_read(__METHOD__) / 1000;
       $this->assertTrue(1.8 < $time && $time < 5, t('Request timed out (%time seconds).', array('%time' => $time)));
       $this->assertTrue($result->error, t('An error message was returned.'));
       $this->assertEqual($result->code, HTTP_REQUEST_TIMEOUT, t('Proper error code was returned.'));
     }
   }
 
   function testDrupalHTTPRequestBasicAuth() {
     $username = $this->randomName();
     $password = $this->randomName();
-    $url = url('system-test/auth', array('absolute' => TRUE));
+    $url = url('common-test/auth', array('absolute' => TRUE));
 
     $auth = str_replace('://', '://' . $username . ':' . $password . '@', $url);
     $result = drupal_http_request($auth);
 
     $this->drupalSetContent($result->data);
     $this->assertRaw($username, t('$_SERVER["PHP_AUTH_USER"] is passed correctly.'));
     $this->assertRaw($password, t('$_SERVER["PHP_AUTH_PW"] is passed correctly.'));
   }
 
   function testDrupalHTTPRequestRedirect() {
-    $redirect_301 = drupal_http_request(url('system-test/redirect/301', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_301 = drupal_http_request(url('common-test/redirect/301', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_301->redirect_code, 301, t('drupal_http_request follows the 301 redirect.'));
 
-    $redirect_301 = drupal_http_request(url('system-test/redirect/301', array('absolute' => TRUE)), array('max_redirects' => 0));
+    $redirect_301 = drupal_http_request(url('common-test/redirect/301', array('absolute' => TRUE)), array('max_redirects' => 0));
     $this->assertFalse(isset($redirect_301->redirect_code), t('drupal_http_request does not follow 301 redirect if max_redirects = 0.'));
 
-    $redirect_invalid = drupal_http_request(url('system-test/redirect-noscheme', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_invalid = drupal_http_request(url('common-test/redirect-noscheme', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_invalid->code, -1002, t('301 redirect to invalid URL returned with error code !error.', array('!error' => $redirect_invalid->error)));
     $this->assertEqual($redirect_invalid->error, 'missing schema', t('301 redirect to invalid URL returned with error message "!error".', array('!error' => $redirect_invalid->error)));
 
-    $redirect_invalid = drupal_http_request(url('system-test/redirect-noparse', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_invalid = drupal_http_request(url('common-test/redirect-noparse', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_invalid->code, -1001, t('301 redirect to invalid URL returned with error message code "!error".', array('!error' => $redirect_invalid->error)));
     $this->assertEqual($redirect_invalid->error, 'unable to parse URL', t('301 redirect to invalid URL returned with error message "!error".', array('!error' => $redirect_invalid->error)));
 
-    $redirect_invalid = drupal_http_request(url('system-test/redirect-invalid-scheme', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_invalid = drupal_http_request(url('common-test/redirect-invalid-scheme', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_invalid->code, -1003, t('301 redirect to invalid URL returned with error code !error.', array('!error' => $redirect_invalid->error)));
     $this->assertEqual($redirect_invalid->error, 'invalid schema ftp', t('301 redirect to invalid URL returned with error message "!error".', array('!error' => $redirect_invalid->error)));
 
-    $redirect_302 = drupal_http_request(url('system-test/redirect/302', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_302 = drupal_http_request(url('common-test/redirect/302', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_302->redirect_code, 302, t('drupal_http_request follows the 302 redirect.'));
 
-    $redirect_302 = drupal_http_request(url('system-test/redirect/302', array('absolute' => TRUE)), array('max_redirects' => 0));
+    $redirect_302 = drupal_http_request(url('common-test/redirect/302', array('absolute' => TRUE)), array('max_redirects' => 0));
     $this->assertFalse(isset($redirect_302->redirect_code), t('drupal_http_request does not follow 302 redirect if $retry = 0.'));
 
-    $redirect_307 = drupal_http_request(url('system-test/redirect/307', array('absolute' => TRUE)), array('max_redirects' => 1));
+    $redirect_307 = drupal_http_request(url('common-test/redirect/307', array('absolute' => TRUE)), array('max_redirects' => 1));
     $this->assertEqual($redirect_307->redirect_code, 307, t('drupal_http_request follows the 307 redirect.'));
 
-    $redirect_307 = drupal_http_request(url('system-test/redirect/307', array('absolute' => TRUE)), array('max_redirects' => 0));
+    $redirect_307 = drupal_http_request(url('common-test/redirect/307', array('absolute' => TRUE)), array('max_redirects' => 0));
     $this->assertFalse(isset($redirect_307->redirect_code), t('drupal_http_request does not follow 307 redirect if max_redirects = 0.'));
   }
 }
 
 /**
  * Testing drupal_add_region_content and drupal_get_region_content.
  */
 class DrupalSetContentTestCase extends DrupalWebTestCase {
   public static function getInfo() {
Index: modules/simpletest/tests/common_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/common_test.module,v
retrieving revision 1.11
diff -u -9 -p -r1.11 common_test.module
--- modules/simpletest/tests/common_test.module	18 May 2010 06:59:46 -0000	1.11
+++ modules/simpletest/tests/common_test.module	1 Jul 2010 20:46:11 -0000
@@ -47,18 +47,51 @@ function common_test_menu() {
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
   $items['common-test/query-string'] = array(
     'title' => 'Test querystring',
     'page callback' => 'common_test_js_and_css_querystring',
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
+  $items['common-test/auth'] = array(
+    'page callback' => 'common_test_basic_auth_page',
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
+  $items['common-test/redirect/%'] = array(
+    'title' => 'Redirect',
+    'page callback' => 'common_test_redirect',
+    'page arguments' => array(2),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['common-test/redirect-noscheme'] = array(
+    'page callback' => 'common_test_redirect_noscheme',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['common-test/redirect-noparse'] = array(
+    'page callback' => 'common_test_redirect_noparse',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['common-test/redirect-invalid-scheme'] = array(
+    'page callback' => 'common_test_redirect_invalid_scheme',
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+  $items['common-test/sleep/%'] = array(
+    'page callback' => 'common_test_sleep',
+    'page arguments' => array(2),
+    'access callback' => TRUE,
+    'type' => MENU_CALLBACK,
+  );
   return $items;
 }
 
 /**
  * Redirect using drupal_goto().
  */
 function common_test_drupal_goto_redirect() {
   drupal_goto('common-test/drupal_goto');
 }
@@ -96,18 +129,64 @@ function common_test_drupal_goto_alter(&
 /**
  * Print destination query parameter.
  */
 function common_test_destination() {
   $destination = drupal_get_destination();
   print "The destination: " . check_plain($destination['destination']);
 }
 
 /**
+ * Responds with specified HTTP status code.
+ */
+function common_test_redirect($code) {
+  $code = (int) $code;
+  if ($code != 200) {
+    // Header names are case-insensitive.
+    header("locaTION: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
+    exit;
+  }
+  return '';
+}
+
+/**
+ * HTTP redirect to URL without scheme prefix.
+ */
+function common_test_redirect_noscheme() {
+  header("Location: localhost/path", TRUE, 301);
+  exit;
+}
+
+/**
+ * HTTP redirect to invalid URL.
+ */
+function common_test_redirect_noparse() {
+  header("Location: http:///path", TRUE, 301);
+  exit;
+}
+
+/**
+ * HTTP redirect to URL with invalid scheme.
+ */
+function common_test_redirect_invalid_scheme() {
+  header("Location: ftp://localhost/path", TRUE, 301);
+  exit;
+}
+
+/**
+ * Prints HTTP Authentication credentials.
+ */
+function common_test_basic_auth_page() {
+  $output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER']));
+  $output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW']));
+  return $output;
+}
+
+/**
  * Implements hook_TYPE_alter().
  */
 function common_test_drupal_alter_alter(&$data, &$arg2 = NULL, &$arg3 = NULL) {
   // Alter first argument.
   if (is_array($data)) {
     $data['foo'] = 'Drupal';
   }
   elseif (is_object($data)) {
     $data->foo = 'Drupal';
@@ -218,9 +297,16 @@ function common_test_library() {
 
 /**
  * Adds a JavaScript file and a CSS file with a query string appended.
  */
 function common_test_js_and_css_querystring() {
    drupal_add_js(drupal_get_path('module', 'node') . '/node.js?arg1=value1&arg2=value2');
    drupal_add_css(drupal_get_path('module', 'node') . '/node.css?arg1=value1&arg2=value2');
    return '';
 }
+
+/**
+ * Emulate a slow server.
+ */
+function common_test_sleep($seconds) {
+  sleep($seconds);
+}
Index: modules/simpletest/tests/system_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/system_test.module,v
retrieving revision 1.30
diff -u -9 -p -r1.30 system_test.module
--- modules/simpletest/tests/system_test.module	28 Jun 2010 20:27:34 -0000	1.30
+++ modules/simpletest/tests/system_test.module	1 Jul 2010 20:46:11 -0000
@@ -1,54 +1,21 @@
 <?php
 // $Id: system_test.module,v 1.30 2010/06/28 20:27:34 dries Exp $
 
 /**
  * Implements hook_menu().
  */
 function system_test_menu() {
-  $items['system-test/sleep/%'] = array(
-    'page callback' => 'system_test_sleep',
-    'page arguments' => array(2),
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-  $items['system-test/auth'] = array(
-    'page callback' => 'system_test_basic_auth_page',
-    'access callback' => TRUE,
-    'type' => MENU_CALLBACK,
-  );
-  $items['system-test/redirect/%'] = array(
-    'title' => 'Redirect',
-    'page callback' => 'system_test_redirect',
-    'page arguments' => array(2),
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
-  );
   $items['system-test/set-header'] = array(
     'page callback' => 'system_test_set_header',
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
-  $items['system-test/redirect-noscheme'] = array(
-    'page callback' => 'system_test_redirect_noscheme',
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
-  );
-  $items['system-test/redirect-noparse'] = array(
-    'page callback' => 'system_test_redirect_noparse',
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
-  );
-  $items['system-test/redirect-invalid-scheme'] = array(
-    'page callback' => 'system_test_redirect_invalid_scheme',
-    'access arguments' => array('access content'),
-    'type' => MENU_CALLBACK,
-  );
 
   $items['system-test/variable-get'] = array(
     'title' => 'Variable Get',
     'page callback' => 'variable_get',
     'page arguments' => array('simpletest_bootstrap_variable_test', NULL),
     'access arguments' => array('access content'),
     'type' => MENU_CALLBACK,
   );
 
@@ -91,58 +58,23 @@ function system_test_menu() {
     'title' => 'Test main content duplication',
     'page callback' => 'system_test_page_shutdown_functions',
     'access callback' => TRUE,
     'type' => MENU_CALLBACK,
   );
 
   return $items;
 }
 
-function system_test_sleep($seconds) {
-  sleep($seconds);
-}
-
-function system_test_basic_auth_page() {
-  $output = t('$_SERVER[\'PHP_AUTH_USER\'] is @username.', array('@username' => $_SERVER['PHP_AUTH_USER']));
-  $output .= t('$_SERVER[\'PHP_AUTH_PW\'] is @password.', array('@password' => $_SERVER['PHP_AUTH_PW']));
-  return $output;
-}
-
-function system_test_redirect($code) {
-  $code = (int) $code;
-  if ($code != 200) {
-    // Header names are case-insensitive.
-    header("locaTION: " . url('system-test/redirect/200', array('absolute' => TRUE)), TRUE, $code);
-    exit;
-  }
-  return '';
-}
-
 function system_test_set_header() {
   drupal_add_http_header($_GET['name'], $_GET['value']);
   return t('The following header was set: %name: %value', array('%name' => $_GET['name'], '%value' => $_GET['value']));
 }
 
-function system_test_redirect_noscheme() {
-  header("Location: localhost/path", TRUE, 301);
-  exit;
-}
-
-function system_test_redirect_noparse() {
-  header("Location: http:///path", TRUE, 301);
-  exit;
-}
-
-function system_test_redirect_invalid_scheme() {
-  header("Location: ftp://localhost/path", TRUE, 301);
-  exit;
-}
-
 /**
  * Implements hook_modules_installed().
  */
 function system_test_modules_installed($modules) {
   if (in_array('aggregator', $modules)) {
     drupal_set_message(t('hook_modules_installed fired for aggregator'));
   }
 }
 
