Index: includes/module.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/module.inc,v
retrieving revision 1.179
diff -u -p -r1.179 module.inc
--- includes/module.inc	13 Jan 2010 05:08:29 -0000	1.179
+++ includes/module.inc	14 Jan 2010 20:27:37 -0000
@@ -291,12 +291,11 @@ function module_load_all_includes($type,
  *   If TRUE, dependencies will automatically be added and enabled in the
  *   correct order. This incurs a significant performance cost, so use FALSE
  *   if you know $module_list is already complete and in the correct order.
- * @param $disable_modules_installed_hook
- *   Normally just testing wants to set this to TRUE.
+ *
  * @return
  *   FALSE if one or more dependencies are missing, TRUE otherwise.
  */
-function module_enable($module_list, $enable_dependencies = TRUE, $disable_modules_installed_hook = FALSE) {
+function module_enable($module_list, $enable_dependencies = TRUE) {
   if ($enable_dependencies) {
     // Get all module data so we can find dependencies and sort.
     $module_data = system_rebuild_module_data();
@@ -368,7 +367,7 @@ function module_enable($module_list, $en
     drupal_get_schema(NULL, TRUE);
 
     // If any modules were newly installed, execute the hook for them.
-    if (!$disable_modules_installed_hook && !empty($modules_installed)) {
+    if (!empty($modules_installed)) {
       module_invoke_all('modules_installed', $modules_installed);
     }
     _system_update_bootstrap_status();
Index: modules/simpletest/drupal_web_test_case.php
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/drupal_web_test_case.php,v
retrieving revision 1.192
diff -u -p -r1.192 drupal_web_test_case.php
--- modules/simpletest/drupal_web_test_case.php	13 Jan 2010 06:10:43 -0000	1.192
+++ modules/simpletest/drupal_web_test_case.php	14 Jan 2010 20:37:21 -0000
@@ -1135,37 +1135,40 @@ class DrupalWebTestCase extends DrupalTe
 
     $this->preloadRegistry();
 
+    // Reset and reload global $conf array.
+    $this->refreshVariables();
+
     // Include the default profile.
     variable_set('install_profile', 'standard');
     $profile_details = install_profile_info('standard', 'en');
 
     // Install the modules specified by the default profile.
-    module_enable($profile_details['dependencies'], FALSE, TRUE);
-
-    drupal_static_reset('_node_types_build');
+    module_enable($profile_details['dependencies'], FALSE);
 
+    // Install modules needed for this test.
     if ($modules = func_get_args()) {
-      // Install modules needed for this test.
-      module_enable($modules, TRUE, TRUE);
+      module_enable($modules, TRUE);
     }
 
-    // Because the schema is static cached, we need to flush
-    // it between each run. If we don't, then it will contain
-    // stale data for the previous run's database prefix and all
-    // calls to it will fail.
-    drupal_get_schema(NULL, TRUE);
-
     // Run default profile tasks.
-    $install_state = array();
-    module_enable(array('standard'), FALSE, TRUE);
+    module_enable(array('standard'), FALSE);
 
     // Rebuild caches.
-    node_types_rebuild();
+    drupal_flush_all_caches();
+
+    // Register actions declared by any modules.
     actions_synchronize();
-    _drupal_flush_css_js();
-    $this->refreshVariables();
+
     $this->checkPermissions(array(), TRUE);
 
+    // Reset statically cached schema for new database prefix.
+    drupal_get_schema(NULL, TRUE);
+
+    // Run cron to populate update status tables (if available) so that users
+    // will be warned if they've installed an out of date Drupal version.
+    // Will also trigger indexing of profile-supplied content or feeds.
+    drupal_cron_run();
+
     // Log in with a clean $user.
     $this->originalUser = $user;
     drupal_save_session(FALSE);
