diff --git a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php
index 1797b78..a6730da 100644
--- a/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/Image/ToolkitGdTest.php
@@ -293,6 +293,33 @@ function testManipulations() {
         }
       }
     }
+  }
+
+  /**
+   * Test allowed extensions.
+   */
+  public function testExtensions() {
+    $toolkit = $this->container->get('image.toolkit.manager')->createInstance('gd');
+    $image_factory = $this->container->get('image.factory')->setToolkit($toolkit);
 
+    // Define a list of files to be tested.
+    $files = array();
+    foreach (array('png', 'gif', 'jpg') as $extension) {
+      $files[$extension] = drupal_get_path('module', 'simpletest') . '/files/image-test.' . $extension;
+    }
+
+    // Add also a .jpeg extension file and a JPEG file without any extension.
+    foreach (array('jpeg', '') as $extension) {
+      $destination = 'public://image-test' . (empty($extension) ? '' : '.') . $extension;
+      file_unmanaged_copy($files['jpg'], $destination);
+      $files[$extension] = $destination;
+    }
+
+    foreach ($files as $extension => $file) {
+      $image = $image_factory->get($file);
+      $expected = $extension ?: 'jpg';
+      $this->assertEqual($image->getExtension(), $expected);
+    }
   }
+
 }
