diff --git a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
index 00e7f14..eba365a 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Ajax/FrameworkTest.php
@@ -21,10 +21,6 @@ public static function getInfo() {
 
   /**
    * Ensures ajax_render() returns JavaScript settings from the page request.
-   *
-   * @todo Add tests to ensure that ajax_render() returns commands for new CSS
-   *   and JavaScript files to be loaded by the page. See
-   *   http://drupal.org/node/561858.
    */
   function testAJAXRender() {
     $commands = $this->drupalGetAJAX('ajax-test/render');
@@ -130,21 +126,24 @@ function testLazyLoad() {
     $new_css = $new_settings['ajaxPageState']['css'];
     $new_js = $new_settings['ajaxPageState']['js'];
 
-    // Verify the expected setting was added.
+    // Verify the expected setting was added, both to Drupal.settings, and as
+    // the first Ajax command.
     $this->assertIdentical($new_settings[$expected['setting_name']], $expected['setting_value'], format_string('Page now has the %setting.', array('%setting' => $expected['setting_name'])));
+    $this->assertCommand(array_slice($commands, 0, 1), array('settings' => array($expected['setting_name'] => $expected['setting_value'])), format_string('The settings command was first.'));
 
     // Verify the expected CSS file was added, both to Drupal.settings, and as
-    // an Ajax command for inclusion into the HTML.
+    // the second Ajax command for inclusion into the HTML.
     $this->assertEqual($new_css, $original_css + array($expected['css'] => 1), format_string('Page state now has the %css file.', array('%css' => $expected['css'])));
-    $this->assertCommand($commands, array('data' => $expected_css_html), format_string('Page now has the %css file.', array('%css' => $expected['css'])));
+    $this->assertCommand(array_slice($commands, 1, 1), array('data' => $expected_css_html), format_string('Page now has the %css file.', array('%css' => $expected['css'])));
 
     // Verify the expected JS file was added, both to Drupal.settings, and as
-    // an Ajax command for inclusion into the HTML. By testing for an exact HTML
-    // string containing the SCRIPT tag, we also ensure that unexpected
-    // JavaScript code, such as a jQuery.extend() that would potentially clobber
-    // rather than properly merge settings, didn't accidentally get added.
+    // the third Ajax command for inclusion into the HTML. By testing for an
+    // exact HTML string containing the SCRIPT tag, we also ensure that
+    // unexpected JavaScript code, such as a jQuery.extend() that would
+    // potentially clobber rather than properly merge settings, didn't
+    // accidentally get added.
     $this->assertEqual($new_js, $original_js + array($expected['js'] => 1), format_string('Page state now has the %js file.', array('%js' => $expected['js'])));
-    $this->assertCommand($commands, array('data' => $expected_js_html), format_string('Page now has the %js file.', array('%js' => $expected['js'])));
+    $this->assertCommand(array_slice($commands, 2, 1), array('data' => $expected_js_html), format_string('Page now has the %js file.', array('%js' => $expected['js'])));
   }
 
   /**
diff --git a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
index 96288f9..41a1056 100644
--- a/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
+++ b/core/modules/system/tests/modules/ajax_forms_test/ajax_forms_test.module
@@ -480,8 +480,10 @@ function ajax_forms_test_lazy_load_form($form, &$form_state) {
     '#type' => 'submit',
     '#value' => t('Submit'),
     '#ajax' => array(
+      'wrapper' => 'ajax-forms-test-lazy-load-ajax-wrapper',
       'callback' => 'ajax_forms_test_lazy_load_form_ajax',
     ),
+    '#prefix' => '<div id="ajax-forms-test-lazy-load-ajax-wrapper"></div>',
   );
   return $form;
 }
@@ -500,11 +502,7 @@ function ajax_forms_test_lazy_load_form_submit($form, &$form_state) {
 
 /**
  * AJAX form callback: Selects for the ajax_forms_test_lazy_load_form() form.
- *
- * This function returns nothing, because all we're interested in testing is
- * ajax_render() adding commands for JavaScript and CSS added during the page
- * request, such as the ones added in ajax_forms_test_lazy_load_form_submit().
  */
 function ajax_forms_test_lazy_load_form_ajax($form, &$form_state) {
-  return NULL;
+  return array('#markup' => 'new content');
 }
