diff --git a/modules/file/tests/file.test b/modules/file/tests/file.test
index ea8c5c6..74f52c3 100644
--- a/modules/file/tests/file.test
+++ b/modules/file/tests/file.test
@@ -462,6 +462,47 @@ class FileFieldWidgetTestCase extends FileFieldTestCase {
   }
 
   /**
+   * Tests upload with multiple fields, with and without Ajax, for multi-valued File fields.
+   */
+  function testMultiFieldMultiValuedWidget() {
+    $type_name = 'page';
+    $field_name = strtolower($this->randomName());
+    $field_name2 = strtolower($this->randomName());
+    $this->createFileField($field_name, $type_name, array('cardinality' => -1));
+    $this->createFileField($field_name2, $type_name, array('cardinality' => -1));
+    $field = field_info_field($field_name);
+    $field2 = field_info_field($field_name2);
+    $instance = field_info_instance('node', $field_name, $type_name);
+    $instance2 = field_info_instance('node', $field_name2, $type_name);
+
+    $test_file = $this->getTestFile('text');
+
+    foreach (array('nojs', 'js') as $type) {
+      // Visit the node creation form, and upload 2 files in the first and second fields
+      // Then upload 1 file to the first field. This will verify that:
+      // - There is no error
+      // - Files uploaded are not lost
+      // - The "Add a new file" is still present in both fields
+      // @todo This is only testing a non-Ajax upload, because drupalPostAJAX()
+      //   does not yet emulate jQuery's file upload.
+      $this->drupalGet("node/add/$type_name");
+      for ($delta = 0; $delta < 2; $delta++) {
+        $edit = array('files[' . $field_name . '_' . LANGUAGE_NONE . '_' . $delta . ']' => drupal_realpath($test_file->uri));
+        $this->drupalPost(NULL, $edit, t('Upload'));
+      }
+      for ($delta = 0; $delta < 2; $delta++) {
+        $edit = array('files[' . $field_name2 . '_' . LANGUAGE_NONE . '_' . $delta . ']' => drupal_realpath($test_file->uri));
+        $this->drupalPost(NULL, $edit, t('Upload'));
+      }
+      $edit = array('files[' . $field_name . '_' . LANGUAGE_NONE . '_2]' => drupal_realpath($test_file->uri));
+      $this->drupalPost(NULL, $edit, t('Upload'));
+      $this->assertNoText(t('Title field is required'), t('After uploading to two file fields there is no errors.'));
+      $this->assertFieldByXpath('//div[@id="edit-field-files-und"]//div[@class="form-type-managed-file"]', NULL, t('After uploading 5 files in 2 fields alternatively The "Add new file" is still present in both fields.'));
+      $this->assertFieldByXpath('//table[@id="edit-field-files-und-table"]//tr[@class="even"]', NULL, t('After uploading 5 files in 2 fields alternatively ensure that no files are lost.'));
+    }
+  }
+
+  /**
    * Tests a file field with a "Private files" upload destination setting.
    */
   function testPrivateFileSetting() {
