diff --git modules/simpletest/tests/common.test modules/simpletest/tests/common.test
index ca29e11..08e1b42 100644
--- modules/simpletest/tests/common.test
+++ modules/simpletest/tests/common.test
@@ -1522,6 +1522,64 @@ class DrupalRenderTestCase extends DrupalWebTestCase {
   }
 
   /**
+   * Test #attached functionality in children elements.
+   */
+  function testDrupalRenderChildrenAttached() {
+    // The cache system is turned off for POST requests.
+    $request_method = $_SERVER['REQUEST_METHOD'];
+    $_SERVER['REQUEST_METHOD'] = 'GET';
+
+    // Create a cached element with a child and subchild.
+    $parent_js = drupal_get_path('module', 'user') . '/user.js';
+    $child_js = drupal_get_path('module', 'forum') . '/forum.js';
+    $subchild_js = drupal_get_path('module', 'book') . '/book.js';
+    $element = array(
+      '#type' => 'fieldset',
+      '#cache' => array(
+        'keys' => array('simpletest', 'drupal_render', 'children_attached'),
+        'bin' => 'cache',
+        'expire' => time() + 60,
+        'granularity' => DRUPAL_CACHE_PER_PAGE | DRUPAL_CACHE_PER_ROLE,
+      ),
+      '#attached' => array(
+        'js' => array($parent_js),
+      ),
+      '#title' => 'Parent',
+    );
+    $element['child'] = array(
+      '#type' => 'fieldset',
+      '#attached' => array(
+        'js' => array($child_js),
+      ),
+      '#title' => 'Child',
+    );
+    $element['child']['subchild'] = array(
+      '#attached' => array(
+        'js' => array($subchild_js),
+      ),
+      '#markup' => 'Subchild',
+    );
+
+    // Render the element and verify the presense of #attached Javascript.
+    drupal_render($element);
+    $scripts = drupal_get_js();
+    $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached Javascript was included.'));
+    $this->assertTrue(strpos($scripts, $child_js), t('The child #attached Javascript was included.'));
+    $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached Javascript was included.'));
+
+    // Load the element from cache and verify the presense of #attached
+    // Javascript.
+    drupal_static_reset('drupal_add_js');
+    $this->assertTrue(drupal_render_cache_get($element), t('The element was retrieved from cache.'));
+    $scripts = drupal_get_js();
+    $this->assertTrue(strpos($scripts, $parent_js), t('The element #attached Javascript was included when loading from cache.'));
+    $this->assertTrue(strpos($scripts, $child_js), t('The child #attached Javascript was included when loading from cache.'));
+    $this->assertTrue(strpos($scripts, $subchild_js), t('The subchild #attached Javascript was included when loading from cache.'));
+
+    $_SERVER['REQUEST_METHOD'] = $request_method;
+  }
+
+  /**
    * Test passing arguments to the theme function.
    */
   function testDrupalRenderThemeArguments() {
