Index: includes/form.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/form.inc,v
retrieving revision 1.406
diff -u -9 -p -r1.406 form.inc
--- includes/form.inc	24 Nov 2009 21:56:15 -0000	1.406
+++ includes/form.inc	25 Nov 2009 20:14:04 -0000
@@ -1433,19 +1433,19 @@ function form_type_checkbox_value($eleme
       // Successful (checked) checkboxes are present with a value (possibly '0').
       // http://www.w3.org/TR/html401/interact/forms.html#successful-controls
       // For an unchecked checkbox, we return numeric 0, so we can explicitly
       // test for a value different than string '0'.
       return isset($input) ? $element['#return_value'] : 0;
     }
     else {
       // Disabled form controls are not submitted by the browser. Ignore any
       // submitted value and always return default.
-      return $element['#default_value'];
+      return $element['#return_value'];
     }
   }
 }
 
 /**
  * Helper function to determine the value for a checkboxes form element.
  *
  * @param $element
  *   The form element whose value is being populated.
Index: modules/simpletest/tests/form.test
===================================================================
RCS file: /cvs/drupal/drupal/modules/simpletest/tests/form.test,v
retrieving revision 1.25
diff -u -9 -p -r1.25 form.test
--- modules/simpletest/tests/form.test	18 Nov 2009 18:51:11 -0000	1.25
+++ modules/simpletest/tests/form.test	25 Nov 2009 20:14:04 -0000
@@ -130,26 +130,26 @@ class FormsTestCase extends DrupalWebTes
     $this->drupalPost('form-test/checkbox', $edit, t('Submit'));
     $this->assertRaw(t('!name field is required.', array('!name' => 'required_checkbox')), t('A required checkbox is actually mandatory'));
 
     // Now try to submit the form correctly.
     $this->drupalPost(NULL, array('required_checkbox' => 1), t('Submit'));
 
     $values = json_decode($this->drupalGetContent(), TRUE);
     $expected_values = array(
       'disabled_checkbox_on' => 'disabled_checkbox_on',
-      'disabled_checkbox_off' => '',
+      'disabled_checkbox_off' => 'disabled_checkbox_off',
       'checkbox_on' => 'checkbox_on',
-      'checkbox_off' => '',
+      'checkbox_off' => 0,
       'zero_checkbox_on' => '0',
-      'zero_checkbox_off' => '',
+      'zero_checkbox_off' => 0,
     );
     foreach ($expected_values as $widget => $expected_value) {
-      $this->assertEqual($values[$widget], $expected_value, t('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
+      $this->assertIdentical($values[$widget], $expected_value, t('Checkbox %widget returns expected value (expected: %expected, got: %value)', array(
         '%widget' => var_export($widget, TRUE),
         '%expected' => var_export($expected_value, TRUE),
         '%value' => var_export($values[$widget], TRUE),
       )));
     }
   }
 }
 
 /**
