diff --git a/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTest.php b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTest.php
new file mode 100644
index 0000000..1e6dc6e
--- /dev/null
+++ b/core/modules/block/custom_block/lib/Drupal/custom_block/Tests/CustomBlockTest.php
@@ -0,0 +1,164 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\custom_block\Tests\CustomBlockTest.
+ */
+
+namespace Drupal\custom_block\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests the functionality of the custom block module.
+ */
+class CustomBlockTest extends WebTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('block', 'custom_block', 'test_page_test');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Custom blocks',
+      'description' => 'Tests the functionality of the custom block module.',
+      'group' => 'Block',
+    );
+  }
+
+  function setUp() {
+    parent::setUp();
+
+    // Use the test page as the front page.
+    config('system.site')->set('page.front', 'test-page')->save();
+
+    // Create Full HTML text format.
+    $full_html_format = array(
+      'format' => 'full_html',
+      'name' => 'Full HTML',
+    );
+    $full_html_format = (object) $full_html_format;
+    filter_format_save($full_html_format);
+    $this->checkPermissions(array(), TRUE);
+
+    // Create and log in an administrative user having access to the Full HTML
+    // text format.
+    $adminUser = $this->drupalCreateUser(array(
+      'administer blocks',
+      filter_permission_name($full_html_format),
+      'access administration pages',
+    ));
+    $this->drupalLogin($adminUser);
+  }
+
+  /**
+   * Tests creation, configuration, and deletion of a custom block instance.
+   */
+  public function testCustomBlock() {
+    $default_theme = variable_get('theme_default', 'stark');
+
+    // Clear the block cache to load the custom block definitions.
+    $manager = $this->container->get('plugin.manager.block');
+    $manager->clearCachedDefinitions();
+
+    // Enable a second theme.
+    theme_enable(array('seven'));
+
+    // Confirm that the add block link appears on block overview pages.
+    $this->drupalGet("admin/structure/block/list/block_plugin_ui:$default_theme/add");
+    $this->assertLink(t('Add custom block'));
+
+    // Confirm that hidden regions are not shown as options for block placement
+    // when adding a new block.
+    theme_enable(array('bartik'));
+    $themes = list_themes();
+    $this->drupalGet('admin/structure/block/add');
+    foreach ($themes as $key => $theme) {
+      if ($theme->status) {
+        foreach ($theme->info['regions_hidden'] as $hidden_region) {
+          $elements = $this->xpath('//select[@id=:id]//option[@value=:value]', array(':id' => 'edit-regions-' . $key, ':value' => $hidden_region));
+          $this->assertFalse(isset($elements[0]), format_string('The hidden region @region is not available for @theme.', array('@region' => $hidden_region, '@theme' => $key)));
+        }
+      }
+    }
+
+    // Add a new custom block by filling out the input form on the
+    // admin/structure/block/add page.
+    $info = strtolower($this->randomName(8));
+    $custom_block['machine_name'] = $info;
+    $custom_block['info'] = $info;
+    $custom_block['title'] = $this->randomName(8);
+    $custom_block['body[value]'] = $this->randomName(32);
+    $custom_block['region'] = 'header';
+    $this->drupalPost("admin/structure/block/list/block_plugin_ui:$default_theme/add/custom_blocks", $custom_block, t('Save block'));
+    $plugin_id = "plugin.core.block.$default_theme.$info";
+    $block = $manager->getInstance(array('config' => $plugin_id));
+    $config = $block->getConfig();
+
+    // Confirm that the custom block has been created.
+    $this->assertText(t('The block configuration has been saved.'), 'Custom block successfully created.');
+
+    // Check that block_block_view() returns the correct title and content.
+    $data = $block->build();
+    $format = $config['format'];
+    $this->assertEqual(check_markup($custom_block['body[value]'], $format), render($data), 'BlockInterface::build() provides correct block content.');
+
+    // Verify presence of configure and delete links for custom block.
+    $this->drupalGet('admin/structure/block');
+    $config_block_id = "admin/structure/block/manage/plugin.core.block.$default_theme.$info/$default_theme";
+    $this->assertLinkByHref("$config_block_id/configure", 0, 'Custom block configure link found.');
+    $this->assertLinkByHref("$config_block_id/delete", 0, 'Custom block delete link found.');
+
+    // Delete the created custom block.
+    $this->clickLink(t('delete'));
+    $this->drupalPost("$config_block_id/delete", array(), t('Delete'));
+    $this->assertRaw(t('The block %title has been removed.', array('%title' => $custom_block['title'])), 'Custom block successfully deleted.');
+    $this->drupalGet(NULL);
+    $this->assertNoText(t($custom_block['title']), 'Custom block no longer appears on page.');
+  }
+
+  /**
+   * Tests creating custom block using Full HTML.
+   */
+  public function testCustomBlockFormat() {
+    $default_theme = variable_get('theme_default', 'stark');
+
+    // Add a new custom block by filling out the input form on the
+    // admin/structure/block/add page.
+    $info = $this->randomName(8);
+    $custom_block['machine_name'] = $info;
+    $custom_block['info'] = $info;
+    $custom_block['title'] = $this->randomName(8);
+    $custom_block['body[value]'] = '<h1>Full HTML</h1>';
+    $full_html_format = filter_format_load('full_html');
+    $custom_block['body[format]'] = $full_html_format->format;
+    $custom_block['region'] = 'header';
+    $this->drupalPost("admin/structure/block/list/block_plugin_ui:$default_theme/add/custom_blocks", $custom_block, t('Save block'));
+
+    // Set the created custom block to a specific region.
+    $edit['blocks[0][region]'] = 'sidebar_first';
+    $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
+
+    // Confirm that the custom block uses the configured text format.
+    $this->drupalGet('');
+    $this->assertRaw('<h1>Full HTML</h1>', 'Custom block successfully being displayed using Full HTML.');
+
+    // Confirm that a user without access to Full HTML can not see the body
+    // field, but can still submit the form without errors.
+    $block_admin = $this->drupalCreateUser(array('administer blocks'));
+    $config_block_id = "admin/structure/block/manage/plugin.core.block.$default_theme.$info/$default_theme";
+    $this->drupalLogin($block_admin);
+    $this->drupalGet("$config_block_id/configure");
+    $this->assertFieldByXPath("//textarea[@name='body[value]' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), 'Body field contains denied message');
+    $this->drupalPost("$config_block_id/configure", array(), t('Save block'));
+    $this->assertNoText(t('Ensure that each block description is unique.'));
+
+    // Confirm that the custom block is still being displayed using configured text format.
+    $this->drupalGet('');
+    $this->assertRaw('<h1>Full HTML</h1>', 'Custom block successfully being displayed using Full HTML.');
+  }
+
+}
diff --git a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
index 6a3dd0c..b5faa83 100644
--- a/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
+++ b/core/modules/block/lib/Drupal/block/Tests/BlockTest.php
@@ -24,7 +24,7 @@ class BlockTest extends WebTestBase {
   public static function getInfo() {
     return array(
       'name' => 'Block functionality',
-      'description' => 'Custom block functionality.',
+      'description' => 'Tests basic block functionality.',
       'group' => 'Block',
     );
   }
@@ -63,136 +63,6 @@ function setUp() {
   }
 
   /**
-   * Removes default blocks to avoid conflicts in the Block UI.
-   */
-  protected function removeDefaultBlocks() {
-    $default_theme = variable_get('theme_default', 'stark');
-    $manager = $this->container->get('plugin.manager.block');
-    $instances = config_get_storage_names_with_prefix('plugin.core.block.' . $default_theme);
-    foreach ($instances as $plugin_id) {
-      config($plugin_id)->delete();
-    }
-  }
-
-  /**
-   * Test creating custom block, moving it to a specific region and then deleting it.
-   */
-  public function testCustomBlock() {
-    $default_theme = variable_get('theme_default', 'stark');
-    $this->removeDefaultBlocks();
-
-    // Clear the block cache to load the Custom Block module's block definitions.
-    $manager = $this->container->get('plugin.manager.block');
-    $manager->clearCachedDefinitions();
-
-    // Enable a second theme.
-    theme_enable(array('seven'));
-
-    // Confirm that the add block link appears on block overview pages.
-    $this->drupalGet("admin/structure/block/list/block_plugin_ui:$default_theme/add");
-    $this->assertLink(t('Add custom block'));
-
-    // Confirm that hidden regions are not shown as options for block placement
-    // when adding a new block.
-    theme_enable(array('bartik'));
-    $themes = list_themes();
-    $this->drupalGet('admin/structure/block/add');
-    foreach ($themes as $key => $theme) {
-      if ($theme->status) {
-        foreach ($theme->info['regions_hidden'] as $hidden_region) {
-          $elements = $this->xpath('//select[@id=:id]//option[@value=:value]', array(':id' => 'edit-regions-' . $key, ':value' => $hidden_region));
-          $this->assertFalse(isset($elements[0]), format_string('The hidden region @region is not available for @theme.', array('@region' => $hidden_region, '@theme' => $key)));
-        }
-      }
-    }
-
-    // Add a new custom block by filling out the input form on the admin/structure/block/add page.
-    $info = strtolower($this->randomName(8));
-    $custom_block['machine_name'] = $info;
-    $custom_block['info'] = $info;
-    $custom_block['title'] = $this->randomName(8);
-    $custom_block['body[value]'] = $this->randomName(32);
-    $custom_block['region'] = $this->regions[0];
-    $this->drupalPost("admin/structure/block/list/block_plugin_ui:$default_theme/add/custom_blocks", $custom_block, t('Save block'));
-    $plugin_id = "plugin.core.block.$default_theme.$info";
-    $block = $manager->getInstance(array('config' => $plugin_id));
-    $config = $block->getConfig();
-
-    // Confirm that the custom block has been created, and then query the created bid.
-    $this->assertText(t('The block configuration has been saved.'), 'Custom block successfully created.');
-
-    // Check that block_block_view() returns the correct title and content.
-    $data = $block->build();
-    $format = $config['format'];
-    $this->assertEqual(check_markup($custom_block['body[value]'], $format), render($data), 'BlockInterface::build() provides correct block content.');
-
-    // Check whether the block can be moved to all available regions.
-    $custom_block['module'] = 'block';
-    foreach ($this->regions as $region) {
-      $this->moveBlockToRegion($custom_block, $region);
-    }
-
-    // Verify presence of configure and delete links for custom block.
-    $this->drupalGet('admin/structure/block');
-    $config_block_id = "admin/structure/block/manage/plugin.core.block.$default_theme.$info/$default_theme";
-    $this->assertLinkByHref("$config_block_id/configure", 0, 'Custom block configure link found.');
-    $this->assertLinkByHref("$config_block_id/delete", 0, 'Custom block delete link found.');
-
-    // Set visibility only for authenticated users, to verify delete functionality.
-    $edit = array();
-    $edit['visibility[role][roles][' . DRUPAL_AUTHENTICATED_RID . ']'] = TRUE;
-    $this->drupalPost("$config_block_id/configure", $edit, t('Save block'));
-
-    // Delete the created custom block & verify that it's been deleted and no longer appearing on the page.
-    $this->clickLink(t('delete'));
-    $this->drupalPost("$config_block_id/delete", array(), t('Delete'));
-    $this->assertRaw(t('The block %title has been removed.', array('%title' => $custom_block['title'])), 'Custom block successfully deleted.');
-    $this->drupalGet(NULL);
-    $this->assertNoText(t($custom_block['title']), 'Custom block no longer appears on page.');
-  }
-
-  /**
-   * Test creating custom block using Full HTML.
-   */
-  public function testCustomBlockFormat() {
-    $default_theme = variable_get('theme_default', 'stark');
-    $this->removeDefaultBlocks();
-
-    // Add a new custom block by filling out the input form on the admin/structure/block/add page.
-    $info = $this->randomName(8);
-    $custom_block['machine_name'] = $info;
-    $custom_block['info'] = $info;
-    $custom_block['title'] = $this->randomName(8);
-    $custom_block['body[value]'] = '<h1>Full HTML</h1>';
-    $full_html_format = filter_format_load('full_html');
-    $custom_block['body[format]'] = $full_html_format->format;
-    $custom_block['region'] = $this->regions[0];
-    $this->drupalPost("admin/structure/block/list/block_plugin_ui:$default_theme/add/custom_blocks", $custom_block, t('Save block'));
-
-    // Set the created custom block to a specific region.
-    $edit['blocks[0][region]'] = $this->regions[1];
-    $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
-
-    // Confirm that the custom block is being displayed using configured text format.
-    $this->drupalGet('');
-    $this->assertRaw('<h1>Full HTML</h1>', 'Custom block successfully being displayed using Full HTML.');
-
-    // Confirm that a user without access to Full HTML can not see the body field,
-    // but can still submit the form without errors.
-    $block_admin = $this->drupalCreateUser(array('administer blocks'));
-    $config_block_id = "admin/structure/block/manage/plugin.core.block.$default_theme.$info/$default_theme";
-    $this->drupalLogin($block_admin);
-    $this->drupalGet("$config_block_id/configure");
-    $this->assertFieldByXPath("//textarea[@name='body[value]' and @disabled='disabled']", t('This field has been disabled because you do not have sufficient permissions to edit it.'), 'Body field contains denied message');
-    $this->drupalPost("$config_block_id/configure", array(), t('Save block'));
-    $this->assertNoText(t('Ensure that each block description is unique.'));
-
-    // Confirm that the custom block is still being displayed using configured text format.
-    $this->drupalGet('');
-    $this->assertRaw('<h1>Full HTML</h1>', 'Custom block successfully being displayed using Full HTML.');
-  }
-
-  /**
    * Test block visibility.
    */
   function testBlockVisibility() {
@@ -268,7 +138,6 @@ function testBlockVisibilityListedEmpty() {
    * Test configuring and moving a module-define block to specific regions.
    */
   function testBlock() {
-    $this->removeDefaultBlocks();
     // Select the 'Powered by Drupal' block to be configured and moved.
     $block = array();
     $block['id'] = 'system_powered_by_block';
@@ -309,38 +178,6 @@ function testBlock() {
     $this->assertNoFieldByXPath($xpath, FALSE, 'Block found in no regions.');
   }
 
-  /**
-   * Moves a block to a given region via the UI and confirms the result.
-   *
-   * @param array $block
-   *   An array of information about the block, including the following keys:
-   *   - module: The module providing the block.
-   *   - title: The title of the block.
-   *   - delta: The block's delta key.
-   * @param string $region
-   *   The machine name of the theme region to move the block to, for example
-   *   'header' or 'sidebar_first'.
-   */
-  function moveBlockToRegion(array $block, $region) {
-    // Set the created block to a specific region.
-    $edit = array();
-    $edit['blocks[0][region]'] = $region;
-    $this->drupalPost('admin/structure/block', $edit, t('Save blocks'));
-
-    // Confirm that the block was moved to the proper region.
-    $this->assertText(t('The block settings have been updated.'), format_string('Block successfully moved to %region_name region.', array( '%region_name' => $region)));
-
-    // Confirm that the block is being displayed.
-    $this->drupalGet('');
-    $this->assertText(t($block['title']), 'Block successfully being displayed on the page.');
-
-    // Confirm that the custom block was found at the proper region.
-    $xpath = $this->buildXPathQuery('//div[@class=:region-class]//div[@id=:block-id]/*', array(
-      ':region-class' => 'region region-' . drupal_html_class($region),
-      ':block-id' => 'block-' . strtr(strtolower($block['machine_name']), '-', '_'),
-    ));
-    $this->assertFieldByXPath($xpath, NULL, t('Block found in %region_name region.', array('%region_name' => drupal_html_class($region))));
-  }
 
   /**
    * Test _block_rehash().
@@ -379,4 +216,5 @@ function testBlockRehash() {
     $config = $instance->getConfig();
     $this->assertEqual($config['cache'], DRUPAL_NO_CACHE, "Test block's database entry updated to DRUPAL_NO_CACHE.");
   }
+
 }
