Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.76
diff -u -p -r1.76 form.test
--- modules/simpletest/tests/form.test	21 Nov 2010 10:14:25 -0000	1.76
+++ modules/simpletest/tests/form.test	15 Dec 2010 17:38:07 -0000
@@ -835,6 +835,36 @@ class FormsElementsTableSelectFunctional
 }
 
 /**
+ * Test the vertical_tabs form element for expected behavior.
+ */
+class FormsElementsVerticalTabsFunctionalTest extends DrupalWebTestCase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Vertical tabs form element type test',
+      'description' => 'Test the vertical_tabs element for expected behavior',
+      'group' => 'Form API',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('form_test');
+  }
+
+  /**
+   * Ensures that vertical-tabs.js is included before collapse.js.
+   *
+   * Otherwise, collapse.js adds "SHOW" or "HIDE" labels to the tabs.
+   */
+  function testJavaScriptOrdering() {
+    $this->drupalGet('form_test/vertical-tabs');
+    $position1 = strpos($this->content, 'misc/vertical-tabs.js');
+    $position2 = strpos($this->content, 'misc/collapse.js');
+    $this->assertTrue($position1 !== FALSE && $position2 !== FALSE && $position1 < $position2, t('vertical-tabs.js is included before collapse.js'));
+  }
+}
+
+/**
  * Test the form storage on a multistep form.
  *
  * The tested form puts data into the storage during the initial form
Index: modules/simpletest/tests/form_test.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form_test.module,v
retrieving revision 1.56
diff -u -p -r1.56 form_test.module
--- modules/simpletest/tests/form_test.module	27 Nov 2010 19:12:56 -0000	1.56
+++ modules/simpletest/tests/form_test.module	15 Dec 2010 17:38:08 -0000
@@ -61,6 +61,14 @@ function form_test_menu() {
     'type' => MENU_CALLBACK,
   );
 
+  $items['form_test/vertical-tabs'] = array(
+    'title' => 'Vertical tabs tests',
+    'page callback' => 'drupal_get_form',
+    'page arguments' => array('_form_test_vertical_tabs_form'),
+    'access arguments' => array('access content'),
+    'type' => MENU_CALLBACK,
+  );
+
   $items['form_test/form-storage'] = array(
     'title' => 'Form storage test',
     'page callback' => 'drupal_get_form',
@@ -538,6 +546,36 @@ function _form_test_tableselect_js_selec
 }
 
 /**
+ * Tests functionality of vertical tabs.
+ */
+function _form_test_vertical_tabs_form($form, &$form_state) {
+  $form['vertical_tabs'] = array(
+    '#type' => 'vertical_tabs',
+  );
+  $form['tab1'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Tab 1'),
+    '#collapsible' => TRUE,
+    '#group' => 'vertical_tabs',
+  );
+  $form['tab1']['field1'] = array(
+    '#title' => t('Field 1'),
+    '#type' => 'textfield',
+  );
+  $form['tab2'] = array(
+    '#type' => 'fieldset',
+    '#title' => t('Tab 2'),
+    '#collapsible' => TRUE,
+    '#group' => 'vertical_tabs',
+  );
+  $form['tab2']['field2'] = array(
+    '#title' => t('Field 2'),
+    '#type' => 'textfield',
+  );
+  return $form;
+}
+
+/**
  * A multistep form for testing the form storage.
  *
  * It uses two steps for editing a virtual "thing". Any changes to it are saved
Index: modules/system/system.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/system/system.module,v
retrieving revision 1.999
diff -u -p -r1.999 system.module
--- modules/system/system.module	15 Dec 2010 02:59:01 -0000	1.999
+++ modules/system/system.module	15 Dec 2010 17:38:13 -0000
@@ -1097,7 +1097,7 @@ function system_library() {
     'title' => 'Drupal batch API',
     'version' => VERSION,
     'js' => array(
-      'misc/batch.js' => array('cache' => FALSE),
+      'misc/batch.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
     ),
     'dependencies' => array(
       array('system', 'drupal.progress'),
@@ -1109,7 +1109,7 @@ function system_library() {
     'title' => 'Drupal progress indicator',
     'version' => VERSION,
     'js' => array(
-      'misc/progress.js' => array('cache' => FALSE),
+      'misc/progress.js' => array('group' => JS_DEFAULT, 'cache' => FALSE),
     ),
   );
 
@@ -1136,7 +1136,7 @@ function system_library() {
     'title' => 'Drupal collapsible fieldset',
     'version' => VERSION,
     'js' => array(
-      'misc/collapse.js' => array(),
+      'misc/collapse.js' => array('group' => JS_DEFAULT),
     ),
     'dependencies' => array(
       // collapse.js relies on drupalGetSummary in form.js
@@ -1149,7 +1149,7 @@ function system_library() {
     'title' => 'Drupal resizable textarea',
     'version' => VERSION,
     'js' => array(
-      'misc/textarea.js' => array(),
+      'misc/textarea.js' => array('group' => JS_DEFAULT),
     ),
   );
 
@@ -1158,7 +1158,7 @@ function system_library() {
     'title' => 'Drupal autocomplete',
     'version' => VERSION,
     'js' => array(
-      'misc/autocomplete.js' => array(),
+      'misc/autocomplete.js' => array('group' => JS_DEFAULT),
     ),
   );
 
