diff --git a/core/modules/system/src/Tests/Module/ExperimentalModuleTest.php b/core/modules/system/src/Tests/Module/ExperimentalModuleTest.php
new file mode 100644
index 0000000..09d58fc
--- /dev/null
+++ b/core/modules/system/src/Tests/Module/ExperimentalModuleTest.php
@@ -0,0 +1,131 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\system\Tests\Module\ExperimentalModuleTest.
+ */
+
+namespace Drupal\system\Tests\Module;
+
+use Drupal\Core\Extension\ExtensionNameLengthException;
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests the installation of modules.
+ *
+ * @group Module
+ */
+class ExperimentalModuleTest extends WebTestBase {
+
+
+  /**
+   * The admin user.
+   *
+   * @var \Drupal\user\UserInterface
+   */
+  protected $adminUser;
+
+  /**
+   * {@inheritoc}
+   */
+  protected function setUp() {
+    parent::setUp();
+    $this->adminUser = $this->drupalCreateUser(['access administration pages', 'administer modules']);
+    $this->drupalLogin($this->adminUser);
+  }
+
+  /**
+   * Tests installing experimental modules and dependencies in the UI.
+   */
+  function testExperimentalConfirmForm() {
+
+    // First, test installing a non-experimental module with no dependencies.
+    // There should be no confirmation form and no experimental module warning.
+    $edit = [];
+    $edit["modules[Testing][test_page_test][enable]"] = TRUE;
+    $this->drupalPostForm('admin/modules', $edit, t('Install'));
+    $this->assertText('Module Test page has been enabled.');
+    $this->assertNoText('Experimental modules are provided for testing purposes only.');
+
+    // Uninstall the module.
+    \Drupal::service('module_installer')->uninstall(['test_page_test']);
+
+    // Next, test installing an experimental module with no dependencies.
+    // There should be a confirmation form with an experimental warning, but no
+    // list of dependencies.
+    $edit = [];
+    $edit["modules[Core (Experimental)][experimental_module_test][enable]"] = TRUE;
+    $this->drupalPostForm('admin/modules', $edit, 'Install');
+
+    // The module should not be enabled and there should be a warning and a
+    // list of the experimental modules with only this one.
+    $this->assertNoText('Experimental Test has been enabled.');
+    $this->assertText('Experimental modules are provided for testing purposes only.');
+    $this->assertText('The following modules are experimental: Experimental Test');
+
+    // There should be no message about enabling dependencies.
+    $this->assertNoText('You must enable');
+
+    // Enable the module and confirm that it worked.
+    $this->drupalPostForm(NULL, [], 'Continue');
+    $this->assertText('Experimental Test has been enabled.');
+
+    // Uninstall the module.
+    \Drupal::service('module_installer')->uninstall(['experimental_module_test']);
+
+    // Test enabling a module that is not itself experimental, but that depends
+    // on an experimental module.
+    $edit = [];
+    $edit["modules[Testing][experimental_module_dependency_test][enable]"] = TRUE;
+    $this->drupalPostForm('admin/modules', $edit, 'Install');
+
+    // The module should not be enabled and there should be a warning and a
+    // list of the experimental modules with only this one.
+    $this->assertNoText('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
+    $this->assertText('Experimental modules are provided for testing purposes only.');
+
+    $this->assertText('The following modules are experimental: Experimental Test');
+
+    // Ensure the non-experimental module is not listed as experimental.
+    $this->assertNoText('The following modules are experimental: Experimental Test, Experimental Dependency Test');
+    $this->assertNoText('The following modules are experimental: Experimental Dependency Test');
+
+    // There should be a message about enabling dependencies.
+    $this->assertText('You must enable the Experimental Test module to install Experimental Dependency Test');
+
+    // Enable the module and confirm that it worked.
+    $this->drupalPostForm(NULL, [], 'Continue');
+    $this->assertText('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
+
+    // Uninstall the modules.
+    \Drupal::service('module_installer')->uninstall(['experimental_module_test', 'experimental_module_dependency_test']);
+
+    // Finally, check both the module and its experimental dependency. There is
+    // still a warning about experimental modules, but no message about
+    // dependencies, since the user specifically enabled the dependency.
+    $edit = [];
+    $edit["modules[Core (Experimental)][experimental_module_test][enable]"] = TRUE;
+    $edit["modules[Testing][experimental_module_dependency_test][enable]"] = TRUE;
+    $this->drupalPostForm('admin/modules', $edit, 'Install');
+
+    // The module should not be enabled and there should be a warning and a
+    // list of the experimental modules with only this one.
+    $this->assertNoText('2 modules have been enabled: Experimental Dependency Test, Experimental Test');
+    $this->assertText('Experimental modules are provided for testing purposes only.');
+
+    $this->assertText('The following modules are experimental: Experimental Test');
+
+    // Ensure the non-experimental module is not listed as experimental.
+    $this->assertNoText('The following modules are experimental: Experimental Test, Experimental Dependency Test');
+    $this->assertNoText('The following modules are experimental: Experimental Dependency Test');
+
+    // There should be no message about enabling dependencies.
+    $this->assertNoText('You must enable');
+
+    // Enable the module and confirm that it worked.
+    $this->drupalPostForm(NULL, [], 'Continue');
+    $this->assertText('2 modules have been enabled: Experimental Test, Experimental Dependency Test');
+
+  }
+
+}
diff --git a/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.info.yml b/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.info.yml
new file mode 100644
index 0000000..665417f
--- /dev/null
+++ b/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.info.yml
@@ -0,0 +1,8 @@
+name: 'Experimental Dependency Test'
+type: module
+description: 'Module with a dependency in the experimental package.'
+package: Testing
+dependencies:
+  - experimental_module_test
+version: VERSION
+core: 8.x
diff --git a/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.module b/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.module
new file mode 100644
index 0000000..6136004
--- /dev/null
+++ b/core/modules/system/tests/modules/experimental_module_dependency_test/experimental_module_dependency_test.module
@@ -0,0 +1,6 @@
+<?php
+
+/**
+ * @file
+ * Tests dependencies on an experimental module.
+ */
diff --git a/core/modules/system/tests/modules/experimental_module_test/experimental_module_test.info.yml b/core/modules/system/tests/modules/experimental_module_test/experimental_module_test.info.yml
index e69a9d5..6cf19cd 100644
--- a/core/modules/system/tests/modules/experimental_module_test/experimental_module_test.info.yml
+++ b/core/modules/system/tests/modules/experimental_module_test/experimental_module_test.info.yml
@@ -4,4 +4,3 @@ description: 'Module in the experimental package to test experimental functional
 package: Core (Experimental)
 version: 8.y.x-unstable
 core: 8.x
-hidden: true
