diff --git a/core/modules/comment/src/Plugin/views/wizard/Comment.php b/core/modules/comment/src/Plugin/views/wizard/Comment.php
index f88e43f..54ddd7f 100644
--- a/core/modules/comment/src/Plugin/views/wizard/Comment.php
+++ b/core/modules/comment/src/Plugin/views/wizard/Comment.php
@@ -150,6 +150,7 @@ protected function defaultDisplayOptions() {
     $display_options['relationships']['node']['required'] = 1;
     $display_options['relationships']['node']['plugin_id'] = 'standard';
     $display_options['relationships']['node']['provider'] = 'views';
+    $display_options['relationships']['node']['dependencies'] = [];
 
     // Remove the default fields, since we are customizing them here.
     unset($display_options['fields']);
@@ -159,6 +160,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['subject']['table'] = 'comment_field_data';
     $display_options['fields']['subject']['field'] = 'subject';
     $display_options['fields']['subject']['provider'] = 'comment';
+    $display_options['fields']['subject']['dependencies'] = [];
     $display_options['fields']['subject']['label'] = '';
     $display_options['fields']['subject']['alter']['alter_text'] = 0;
     $display_options['fields']['subject']['alter']['make_link'] = 0;
diff --git a/core/modules/file/src/Plugin/views/wizard/File.php b/core/modules/file/src/Plugin/views/wizard/File.php
index 94529a0..3f8094e 100644
--- a/core/modules/file/src/Plugin/views/wizard/File.php
+++ b/core/modules/file/src/Plugin/views/wizard/File.php
@@ -54,6 +54,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['filename']['table'] = 'file_managed';
     $display_options['fields']['filename']['field'] = 'filename';
     $display_options['fields']['filename']['provider'] = 'file';
+    $display_options['fields']['filename']['dependencies'] = [];
     $display_options['fields']['filename']['label'] = '';
     $display_options['fields']['filename']['alter']['alter_text'] = 0;
     $display_options['fields']['filename']['alter']['make_link'] = 0;
diff --git a/core/modules/node/src/Plugin/views/wizard/Node.php b/core/modules/node/src/Plugin/views/wizard/Node.php
index 05ba0d1..686ea72 100644
--- a/core/modules/node/src/Plugin/views/wizard/Node.php
+++ b/core/modules/node/src/Plugin/views/wizard/Node.php
@@ -138,6 +138,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['title']['table'] = 'node_field_data';
     $display_options['fields']['title']['field'] = 'title';
     $display_options['fields']['title']['provider'] = 'node';
+    $display_options['fields']['title']['dependencies'] = [];
     $display_options['fields']['title']['label'] = '';
     $display_options['fields']['title']['alter']['alter_text'] = 0;
     $display_options['fields']['title']['alter']['make_link'] = 0;
diff --git a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
index 3eb7d2e..bd28f8d 100644
--- a/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
+++ b/core/modules/node/src/Plugin/views/wizard/NodeRevision.php
@@ -99,6 +99,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['changed']['table'] = 'node_field_revision';
     $display_options['fields']['changed']['field'] = 'changed';
     $display_options['fields']['changed']['provider'] = 'node';
+    $display_options['fields']['changed']['dependencies'] = [];
     $display_options['fields']['changed']['alter']['alter_text'] = FALSE;
     $display_options['fields']['changed']['alter']['make_link'] = FALSE;
     $display_options['fields']['changed']['alter']['absolute'] = FALSE;
@@ -115,6 +116,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['title']['table'] = 'node_field_revision';
     $display_options['fields']['title']['field'] = 'title';
     $display_options['fields']['title']['provider'] = 'node';
+    $display_options['fields']['title']['dependencies'] = [];
     $display_options['fields']['title']['label'] = '';
     $display_options['fields']['title']['alter']['alter_text'] = 0;
     $display_options['fields']['title']['alter']['make_link'] = 0;
diff --git a/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php b/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php
index 480dc26..bd16b39 100644
--- a/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php
+++ b/core/modules/taxonomy/src/Plugin/views/wizard/TaxonomyTerm.php
@@ -52,6 +52,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['name']['table'] = 'taxonomy_term_field_data';
     $display_options['fields']['name']['field'] = 'name';
     $display_options['fields']['name']['provider'] = 'taxonomy';
+    $display_options['fields']['name']['dependencies'] = [];
     $display_options['fields']['name']['label'] = '';
     $display_options['fields']['name']['alter']['alter_text'] = 0;
     $display_options['fields']['name']['alter']['make_link'] = 0;
diff --git a/core/modules/user/src/Plugin/views/wizard/Users.php b/core/modules/user/src/Plugin/views/wizard/Users.php
index 127b84b..24b71df 100644
--- a/core/modules/user/src/Plugin/views/wizard/Users.php
+++ b/core/modules/user/src/Plugin/views/wizard/Users.php
@@ -75,6 +75,7 @@ protected function defaultDisplayOptions() {
     $display_options['fields']['name']['table'] = 'users_field_data';
     $display_options['fields']['name']['field'] = 'name';
     $display_options['fields']['name']['provider'] = 'user';
+    $display_options['fields']['name']['dependencies'] = [];
     $display_options['fields']['name']['label'] = '';
     $display_options['fields']['name']['alter']['alter_text'] = 0;
     $display_options['fields']['name']['alter']['make_link'] = 0;
diff --git a/core/modules/views/src/Entity/View.php b/core/modules/views/src/Entity/View.php
index 19d13c1..78906e5 100644
--- a/core/modules/views/src/Entity/View.php
+++ b/core/modules/views/src/Entity/View.php
@@ -100,6 +100,13 @@ class View extends ConfigEntityBase implements ViewStorageInterface {
   protected $executable;
 
   /**
+   * The views data.
+   *
+   * @var \Drupal\views\ViewsData
+   */
+  protected $viewsData;
+
+  /**
    * The module implementing this view.
    *
    * @var string
@@ -248,20 +255,12 @@ public function calculateDependencies() {
 
     // Ensure that the view is dependant on the module that implements the view.
     $this->addDependency('module', $this->module);
-    // Ensure that the view is dependent on the module that provides the schema
-    // for the base table.
-    $schema = $this->drupalGetSchema($this->base_table);
-    // @todo Entity base tables are no longer registered in hook_schema(). Once
-    //   we automate the views data for entity types add the entity type
-    //   type provider as a dependency. See https://drupal.org/node/1740492.
-    if ($schema && $this->module != $schema['module']) {
-      $this->addDependency('module', $schema['module']);
-    }
 
     $handler_types = array();
     foreach (Views::getHandlerTypes() as $type) {
       $handler_types[] = $type['plural'];
     }
+
     foreach ($this->get('display') as $display) {
       // Add dependency for the display itself.
       if (isset($display['provider'])) {
@@ -279,15 +278,23 @@ public function calculateDependencies() {
             // Add the additional dependencies from the handler configuration.
             if (!empty($handler['dependencies'])) {
               $this->addDependencies($handler['dependencies']);
+            }
           }
         }
       }
-    }
+
+      // @todo This totally does not work for argument validator/default
+      //   plugins.
 
       // Collect all dependencies of plugins.
       foreach (Views::getPluginTypes('plugin') as $plugin_type) {
-        if (!empty($display['display_options'][$plugin_type]['options']['dependencies'])) {
-          $this->addDependencies($display['display_options'][$plugin_type]['options']['dependencies']);
+        // Add the provider as a dependency.
+        if (!empty($display['display_options'][$plugin_type]['provider'])) {
+          $this->addDependency('module', $display['display_options'][$plugin_type]['provider']);
+        }
+        // Add the plugin dependencies.
+        if (!empty($display['display_options'][$plugin_type]['dependencies'])) {
+          $this->addDependencies($display['display_options'][$plugin_type]['dependencies']);
         }
       }
     }
@@ -447,11 +454,4 @@ public function mergeDefaultDisplaysOptions() {
     $this->set('display', $displays);
   }
 
-  /**
-   * Wraps drupal_get_schema().
-   */
-  protected function drupalGetSchema($table = NULL, $rebuild = FALSE) {
-    return drupal_get_schema($table, $rebuild);
-  }
-
 }
diff --git a/core/modules/views/src/EntityViewsData.php b/core/modules/views/src/EntityViewsData.php
index 88a0577..4bb38fe 100644
--- a/core/modules/views/src/EntityViewsData.php
+++ b/core/modules/views/src/EntityViewsData.php
@@ -129,6 +129,7 @@ public function getViewsData() {
     // Setup base information of the views data.
     $data[$base_table]['table']['entity type'] = $this->entityType->id();
     $data[$base_table]['table']['group'] = $this->entityType->getLabel();
+    $data[$base_table]['table']['provider'] = $this->entityType->getProvider();
     $data[$base_table]['table']['base'] = [
       'field' => $base_field,
       'title' => $this->entityType->getLabel(),
@@ -157,10 +158,12 @@ public function getViewsData() {
       ];
       $data[$data_table]['table']['entity type'] = $this->entityType->id();
       $data[$data_table]['table']['group'] = $this->entityType->getLabel();
+      $data[$data_table]['table']['provider'] = $this->entityType->getProvider();
     }
     if ($revision_table) {
       $data[$revision_table]['table']['entity type'] = $this->entityType->id();
       $data[$revision_table]['table']['group'] = $this->t('@entity_type revision', ['@entity_type' => $this->entityType->getLabel()]);
+      $data[$revision_table]['table']['provider'] = $this->entityType->getProvider();
       $data[$revision_table]['table']['base'] = array(
         'field' => $revision_field,
         'title' => $this->t('@entity_type revisions', array('@entity_type' => $this->entityType->getLabel())),
diff --git a/core/modules/views/src/Plugin/views/ViewsPluginInterface.php b/core/modules/views/src/Plugin/views/ViewsPluginInterface.php
index df5de7a..e44d88a 100644
--- a/core/modules/views/src/Plugin/views/ViewsPluginInterface.php
+++ b/core/modules/views/src/Plugin/views/ViewsPluginInterface.php
@@ -20,10 +20,10 @@
 interface ViewsPluginInterface extends PluginInspectionInterface, DerivativeInspectionInterface {
 
   /**
-   * Returns an array of module dependencies for this plugin.
+   * Returns an array of dependencies for this plugin.
    *
-   * Dependencies are a list of module names, which might depend on the
-   * configuration.
+   * Dependencies are keyed by the type of dependency. 'module', 'entity' and
+   * 'config' are common dependency types for it.
    *
    * @return array
    */
diff --git a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
index 3810df3..93d1176 100644
--- a/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
+++ b/core/modules/views/src/Plugin/views/display/DisplayPluginBase.php
@@ -902,7 +902,7 @@ public function getHandlers($type) {
       $types = ViewExecutable::getHandlerTypes();
       $plural = $types[$type]['plural'];
 
-      foreach ($this->getOption($plural) as $id => $info) {
+      foreach ((array) $this->getOption($plural) as $id => $info) {
         // If this is during form submission and there are temporary options
         // which can only appear if the view is in the edit cache, use those
         // options instead. This is used for AJAX multi-step stuff.
@@ -1982,7 +1982,8 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
             $plugin_options = array(
               'type' => $type,
               'options' => $plugin->options,
-              'provider' => $plugin->definition['provider']
+              'provider' => $plugin->definition['provider'],
+              'dependencies' => $plugin->getDependencies(),
             );
             $this->setOption($plugin_type, $plugin_options);
             if ($plugin->usesOptions()) {
@@ -2005,6 +2006,9 @@ public function submitOptionsForm(&$form, FormStateInterface $form_state) {
           $plugin_options = $this->getOption($plugin_type);
           $plugin->submitOptionsForm($form[$plugin_type . '_options'], $form_state);
           $plugin_options['options'] = $form_state->getValue($section);
+          // Dependencies could change if the plugin settings form has been
+          // re-configured.
+          $plugin_options['dependencies'] = $plugin->getDependencies();
           $this->setOption($plugin_type, $plugin_options);
         }
         break;
@@ -2622,6 +2626,7 @@ protected function mergePlugin($type) {
     if (($options = $this->getOption($type)) && isset($options['options'])) {
       $plugin = $this->getPlugin($type);
       $options['options'] = $options['options'] + $plugin->options;
+      $options['dependencies'] = $plugin->getDependencies();
       $this->setOption($type, $options);
     }
   }
@@ -2639,6 +2644,7 @@ protected function mergeHandler($type) {
     foreach ($this->getHandlers($type) as $id => $handler) {
       if (isset($options[$id])) {
         $options[$id] = $options[$id] + $handler->options;
+        $options[$id]['dependencies'] = $handler->getDependencies();
       }
     }
 
diff --git a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
index 2db89fd..460babb 100644
--- a/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
+++ b/core/modules/views/src/Plugin/views/query/QueryPluginBase.php
@@ -118,6 +118,23 @@ public function summaryTitle() {
   }
 
   /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    $dependencies = [];
+
+    foreach ($this->getEntityTableInfo() as $entity_type => $info) {
+      $dependencies['entity'][] = $entity_type;
+
+      if (!empty($info['provider'])) {
+        $dependencies['module'][] = $info['provider'];
+      }
+    }
+
+    return $dependencies;
+  }
+
+  /**
    * Set a LIMIT on the query, specifying a maximum number of results.
    */
   public function setLimit($limit) {
@@ -260,7 +277,13 @@ public function getEntityTableInfo() {
         'entity_type' => $base_table_data['table']['entity type'],
         'revision' => FALSE,
       );
+
+      // Include the entity provider.
+      if (!empty($table_data['table']['provider'])) {
+        $entity_tables[$table_data['table']['entity type']]['provider'] = $table_data['table']['provider'];
+      }
     }
+
     // Include all relationships.
     foreach ($this->view->relationship as $relationship_id => $relationship) {
       $table_data = $views_data->get($relationship->definition['base']);
@@ -272,6 +295,11 @@ public function getEntityTableInfo() {
           'entity_type' => $table_data['table']['entity type'],
           'revision' => FALSE,
         );
+
+        // Include the entity provider.
+        if (!empty($table_data['table']['provider'])) {
+          $entity_tables[$table_data['table']['entity type']]['provider'] = $table_data['table']['provider'];
+        }
       }
     }
 
diff --git a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
index e111fe2..e2e930a 100644
--- a/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
+++ b/core/modules/views/src/Tests/Entity/ViewEntityDependenciesTest.php
@@ -8,6 +8,7 @@
 namespace Drupal\views\Tests\Entity;
 
 use Drupal\views\Tests\ViewTestBase;
+use Drupal\views\Tests\ViewUnitTestBase;
 use Drupal\views\Views;
 
 /**
@@ -15,56 +16,58 @@
  *
  * @group views
  */
-class ViewEntityDependenciesTest extends ViewTestBase {
+class ViewEntityDependenciesTest extends ViewUnitTestBase {
 
   /**
    * Views used by this test.
    *
    * @var array
    */
-  public static $testViews = array('test_field_get_entity');
+  public static $testViews = ['test_field_get_entity', 'test_relationship_dependency', 'test_plugin_dependencies'];
 
   /**
    * Modules to enable.
    *
    * @var array
    */
-  public static $modules = array('node', 'comment');
+  public static $modules = ['node', 'comment', 'user', 'field'];
 
   /**
    * Tests the calculateDependencies method.
    */
   public function testCalculateDependencies() {
-    // The view is a view of comments, their nodes and their authors, so there
-    // are three layers of entities.
-    $account = entity_create('user', array('name' => $this->randomMachineName(), 'bundle' => 'user'));
-    $account->save();
-    $this->drupalCreateContentType(array('type' => 'page'));
-    $this->container->get('comment.manager')->addDefaultField('node', 'page');
-    // Force a flush of the in-memory storage.
-    $this->container->get('views.views_data')->clear();
-
-    $node = entity_create('node', array('uid' => $account->id(), 'type' => 'page'));
-    $node->save();
-    $comment = entity_create('comment', array(
-      'uid' => $account->id(),
-      'entity_id' => $node->id(),
-      'entity_type' => 'node',
-      'field_name' => 'comment'
-    ));
-    $comment->save();
-
-    $view = Views::getView('test_field_get_entity');
-
-    $expected_dependencies = array(
-      'module' => array(
+    $expected = [];
+    $expected['test_field_get_entity'] = [
+      'module' => [
         'comment',
         'node',
         'user',
-      )
-    );
-    $dependencies = $view->calculateDependencies();
-    $this->assertEqual($expected_dependencies, $dependencies);
+      ]
+    ];
+    // Tests dependencies of relationships.
+    $expected['test_relationship_dependency'] = [
+      'module' => [
+        'comment',
+        'node',
+      ]
+    ];
+    $expected['test_plugin_dependencies'] = [
+      'module' => [
+        'comment',
+        // The argument handler has an explicit dependency on views_test_data.
+        'views_test_data',
+      ],
+      'test_dependency' => [
+        'row',
+        'style',
+      ]
+    ];
+    foreach ($expected as $view_id => $expected_dependencies) {
+      $view = Views::getView($view_id);
+
+      $dependencies = $view->calculateDependencies();
+      $this->assertEqual($expected_dependencies, $dependencies);
+    }
   }
 
 }
diff --git a/core/modules/views/src/ViewsData.php b/core/modules/views/src/ViewsData.php
index 9578994..796e94b 100644
--- a/core/modules/views/src/ViewsData.php
+++ b/core/modules/views/src/ViewsData.php
@@ -7,6 +7,7 @@
 
 namespace Drupal\views;
 
+use Drupal\Component\Utility\NestedArray;
 use Drupal\Core\Cache\Cache;
 use Drupal\Core\Cache\CacheBackendInterface;
 use Drupal\Core\Config\ConfigFactoryInterface;
@@ -230,7 +231,18 @@ protected function getData() {
       return $data->data;
     }
     else {
-      $data = $this->moduleHandler->invokeAll('views_data');
+      $modules = $this->moduleHandler->getImplementations('views_data');
+      $data = [];
+      foreach ($modules as $module) {
+        $views_data = $this->moduleHandler->invoke($module, 'views_data');
+        // Set the provider key for each base table.
+        foreach ($views_data as &$table) {
+          if (isset($table['table']) && !isset($table['table']['provider'])) {
+            $table['table']['provider'] = $module;
+          }
+        }
+        $data = NestedArray::mergeDeep($data, $views_data);
+      }
       $this->moduleHandler->alter('views_data', $data);
 
       $this->processEntityTypes($data);
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml
new file mode 100644
index 0000000..b029dd4
--- /dev/null
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_plugin_dependencies.yml
@@ -0,0 +1,61 @@
+base_table: comment
+core: 8.0-dev
+description: ''
+status: '1'
+display:
+  default:
+    display_options:
+      access:
+        type: test_static
+        dependencies:
+          test_dependency:
+            - style
+      arguments:
+        'null':
+          default_action: default
+          default_argument_type: fixed
+          id: 'null'
+          must_not_be: '0'
+          style_plugin: default_summary
+          table: views
+          field: null
+          plugin_id: 'null'
+          provider: views_test_data
+      cache:
+        type: none
+      exposed_form:
+        type: basic
+      fields:
+        cid:
+          field: cid
+          id: cid
+          table: comment
+          plugin_id: comment
+          provider: comment
+      filter_groups:
+        groups: {  }
+        operator: AND
+      filters: {  }
+      pager:
+        type: full
+      query:
+        type: views_query
+      relationships:
+      sorts: {  }
+      style:
+        type: test_style
+        dependencies:
+          test_dependency:
+            - style
+      row:
+        type: test_row
+        dependencies:
+          test_dependency:
+            - row
+    display_plugin: default
+    display_title: Master
+    id: default
+    position: 0
+label: test_plugin_dependencies
+id: test_plugin_dependencies
+tag: default
diff --git a/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml
new file mode 100644
index 0000000..c72e6ac
--- /dev/null
+++ b/core/modules/views/tests/modules/views_test_config/test_views/views.view.test_relationship_dependency.yml
@@ -0,0 +1,51 @@
+base_table: comment
+core: 8.0-dev
+description: ''
+status: '1'
+display:
+  default:
+    display_options:
+      access:
+        type: perm
+      cache:
+        type: none
+      exposed_form:
+        type: basic
+      fields:
+        cid:
+          field: cid
+          id: cid
+          table: comment
+          plugin_id: comment
+          provider: comment
+      filter_groups:
+        groups: {  }
+        operator: AND
+      filters: {  }
+      pager:
+        type: full
+      query:
+        type: views_query
+      relationships:
+        node:
+          field: node
+          id: node
+          required: '1'
+          table: comment_field_data
+          plugin_id: standard
+          provider: views
+          dependencies:
+            module:
+              - node
+      sorts: {  }
+      style:
+        type: default
+      row:
+        type: fields
+    display_plugin: default
+    display_title: Master
+    id: default
+    position: 0
+label: test_relationship_dependency
+id: test_relationship_dependency
+tag: default
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php
index e880b48..503787c 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/access/StaticTest.php
@@ -42,4 +42,13 @@ public function alterRouteDefinition(Route $route) {
     }
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return [
+      'test_dependency' => ['access'],
+    ];
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php
index ece75e0..a3487f2 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/argument_default/ArgumentDefaultTest.php
@@ -36,4 +36,13 @@ public function getArgument() {
     return $this->options['value'];
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return [
+      'test_dependency' => ['argument_default'],
+    ];
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
index 0fd5c1a..9ff43ea 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/display/DisplayTest.php
@@ -140,4 +140,13 @@ public function preview() {
     return $this->execute();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return parent::getDependencies() + [
+      'test_dependency' => ['display'],
+    ];
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
index 546a635..efd5f55 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/query/QueryTest.php
@@ -146,5 +146,13 @@ public function match($element, $condition) {
     return FALSE;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return parent::getDependencies() + [
+      'test_dependency' => ['query'],
+    ];
+  }
 
 }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
index 1a7dbdc..da4122a 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/row/RowTest.php
@@ -82,4 +82,13 @@ public function render($row) {
     return $this->getOutput();
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return [
+      'test_dependency' => ['row'],
+    ];
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
index 3cf8779..e1c64b9 100644
--- a/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
+++ b/core/modules/views/tests/modules/views_test_data/src/Plugin/views/style/StyleTest.php
@@ -111,4 +111,13 @@ public function render() {
     return $output;
   }
 
+  /**
+   * {@inheritdoc}
+   */
+  public function getDependencies() {
+    return [
+      'test_dependency' => ['style'],
+    ];
+  }
+
 }
diff --git a/core/modules/views/tests/modules/views_test_data/views_test_data.views.inc b/core/modules/views/tests/modules/views_test_data/views_test_data.views.inc
index 4fe1fe4..fffe9b3 100644
--- a/core/modules/views/tests/modules/views_test_data/views_test_data.views.inc
+++ b/core/modules/views/tests/modules/views_test_data/views_test_data.views.inc
@@ -23,7 +23,7 @@ function views_test_data_views_data() {
   $count++;
   $state->set('views_test_data_views_data_count', $count);
 
-  return $state->get('views_test_data_views_data');
+  return $state->get('views_test_data_views_data') ?: [];
 }
 
 /**
diff --git a/core/modules/views/tests/src/Unit/Entity/ViewTest.php b/core/modules/views/tests/src/Unit/Entity/ViewTest.php
index 8af4e6d..ecd01f3 100644
--- a/core/modules/views/tests/src/Unit/Entity/ViewTest.php
+++ b/core/modules/views/tests/src/Unit/Entity/ViewTest.php
@@ -46,21 +46,29 @@ protected function setUp() {
    */
   public function testCalculateDependencies($values, $deps) {
     $view = new TestView($values, 'view');
-    $this->assertEquals(array('module' => $deps), $view->calculateDependencies());
+    $views_deps = $view->calculateDependencies();
+    $this->assertEquals(['module' => $deps], $views_deps);
   }
 
+  /**
+   * Data provider for testCalculateDependencies.
+   */
   public function calculateDependenciesProvider(){
+    $handler = [];
     $handler['display']['default']['provider'] = 'block';
-    $handler['display']['default']['display_options']['fields']['example']['dependencies'] = array();
-    $handler['display']['default']['display_options']['fields']['example2']['dependencies']['module'] = array('views', 'field');
-    $handler['display']['default']['display_options']['fields']['example3']['dependencies']['module'] = array('views', 'image');
+    $handler['display']['default']['display_options']['fields']['example']['dependencies'] = [];
+    $handler['display']['default']['display_options']['fields']['example2']['dependencies']['module'] = ['views', 'field'];
+    $handler['display']['default']['display_options']['fields']['example3']['dependencies']['module'] = ['views', 'image'];
+    $handler['display']['default']['display_options']['query']['dependencies']['module'] = ['node'];
 
-    $plugin['display']['default']['display_options']['access']['options']['dependencies'] = array();
-    $plugin['display']['default']['display_options']['row']['options']['dependencies']['module'] = array('views', 'field');
-    $plugin['display']['default']['display_options']['style']['options']['dependencies']['module'] = array('views', 'image');
+    $plugin = [];
+    $plugin['display']['default']['display_options']['access']['dependencies'] = [];
+    $plugin['display']['default']['display_options']['row']['dependencies']['module'] = ['views', 'field'];
+    $plugin['display']['default']['display_options']['style']['dependencies']['module'] = ['views', 'image'];
+    $plugin['display']['default']['display_options']['query']['dependencies']['module'] = ['node'];
 
     return array(
-      array(array(), array('node', 'views')),
+      array(array(), array('views')),
       array($handler, array('block', 'field', 'image', 'node', 'views')),
       array($plugin, array('field', 'image', 'node', 'views')),
     );
diff --git a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
index 3199a51..476a199 100644
--- a/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/EntityViewsDataTest.php
@@ -35,7 +35,7 @@ class EntityViewsDataTest extends UnitTestCase {
   /**
    * Entity info to use in this test.
    *
-   * @var \Drupal\Core\Entity\EntityTypeInterface
+   * @var \Drupal\Core\Entity\EntityTypeInterface|\Drupal\views\Tests\TestEntityType
    */
   protected $baseEntityType;
 
@@ -88,6 +88,7 @@ protected function setUp() {
       'id' => 'entity_test',
       'label' => 'Entity test',
       'entity_keys' => ['id' => 'id'],
+      'provider' => 'entity_test',
     ]);
 
     $this->translationManager = $this->getStringTranslationStub();
@@ -160,6 +161,7 @@ public function testBaseTables() {
 
     $this->assertEquals('entity_test', $data['entity_test']['table']['entity type']);
     $this->assertEquals('Entity test', $data['entity_test']['table']['group']);
+    $this->assertEquals('entity_test', $data['entity_test']['table']['provider']);
 
     $this->assertEquals('id', $data['entity_test']['table']['base']['field']);
     $this->assertEquals('Entity test', $data['entity_test']['table']['base']['title']);
@@ -188,6 +190,7 @@ public function testDataTable() {
 
     $this->assertEquals('entity_test_mul', $data['entity_test_mul_property_data']['table']['entity type']);
     $this->assertEquals('Entity test', $data['entity_test_mul_property_data']['table']['group']);
+    $this->assertEquals('entity_test', $data['entity_test']['table']['provider']);
     $this->assertEquals(['field' => 'label', 'table' => 'entity_test_mul_property_data'], $data['entity_test']['table']['base']['defaults']);
 
     // Ensure the join information is set up properly.
@@ -214,6 +217,7 @@ public function testRevisionTable() {
     $this->assertEquals('entity_test_mulrev', $data['entity_test_mulrev_revision']['table']['entity type']);
     $this->assertEquals('entity_test_mulrev', $data['entity_test_mulrev_property_revision']['table']['entity type']);
     $this->assertEquals('Entity test revision', $data['entity_test_mulrev_revision']['table']['group']);
+    $this->assertEquals('entity_test', $data['entity_test']['table']['provider']);
 
     // Ensure the join information is set up properly.
     // Tests the join definition between the base and the revision table.
diff --git a/core/modules/views/tests/src/Unit/ViewsDataTest.php b/core/modules/views/tests/src/Unit/ViewsDataTest.php
index 43528c3..0476ffd 100644
--- a/core/modules/views/tests/src/Unit/ViewsDataTest.php
+++ b/core/modules/views/tests/src/Unit/ViewsDataTest.php
@@ -109,20 +109,51 @@ protected function viewsData() {
   }
 
   /**
-   * Tests the fetchBaseTables() method.
+   * Returns the views data definition with the provider key.
+   *
+   * @return array
+   *
+   * @see static::viewsData()
    */
-  public function testFetchBaseTables() {
-    $views_data = $this->viewsData();
+  protected function viewsDataWithProvider() {
+    $views_data = static::viewsData();
+    foreach (array_keys($views_data) as $table) {
+      $views_data[$table]['table']['provider'] = 'views_test_data';
+    }
+    return $views_data;
+  }
 
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
+  /**
+   * Mocks the basic module handler used for the test.
+   *
+   * @return \Drupal\Core\Extension\ModuleHandlerInterface|\PHPUnit_Framework_MockObject_MockObject
+   */
+  protected function setupMockedModuleHandler() {
+    $views_data = $this->viewsData();
+    $this->moduleHandler->expects($this->at(0))
+      ->method('getImplementations')
       ->with('views_data')
-      ->will($this->returnValue($views_data));
+      ->willReturn(array('views_test_data'));
+    $this->moduleHandler->expects($this->at(1))
+      ->method('invoke')
+      ->with('views_test_data', 'views_data')
+      ->willReturn($views_data);
+  }
 
+  /**
+   * Tests the fetchBaseTables() method.
+   */
+  public function testFetchBaseTables() {
+    $this->setupMockedModuleHandler();
     $data = $this->viewsData->get();
 
     $base_tables = $this->viewsData->fetchBaseTables();
 
+    // Ensure that 'provider' is set for each base table.
+    foreach (array_keys($base_tables) as $base_table) {
+      $this->assertEquals('views_test_data', $data[$base_table]['table']['provider']);
+    }
+
     // Test the number of tables returned and their order.
     $this->assertCount(6, $base_tables, 'The correct amount of base tables were returned.');
     $base_tables_keys = array_keys($base_tables);
@@ -151,24 +182,19 @@ public function testFetchBaseTables() {
    * Tests fetching all the views data without a static cache.
    */
   public function testGetOnFirstCall() {
-    $views_data = $this->viewsData();
-
     // Ensure that the hooks are just invoked once.
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
-      ->with('views_data')
-      ->will($this->returnValue($views_data));
+    $this->setupMockedModuleHandler();
 
-    $this->moduleHandler->expects($this->once())
+    $this->moduleHandler->expects($this->at(2))
       ->method('alter')
-      ->with('views_data', $views_data);
+      ->with('views_data', $this->viewsDataWithProvider());
 
     $this->cacheBackend->expects($this->once())
       ->method('get')
       ->with("views_data:en")
       ->will($this->returnValue(FALSE));
 
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $views_data = $this->viewsData->get();
     $this->assertSame($expected_views_data, $views_data);
   }
@@ -177,21 +203,37 @@ public function testGetOnFirstCall() {
    * Tests the cache of the full and single table data.
    */
   public function testFullAndTableGetCache() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $table_name = 'views_test_data';
     $table_name_2 = 'views_test_data_2';
     $random_table_name = $this->randomMachineName();
 
     // Views data should be invoked twice due to the clear call.
-    $this->moduleHandler->expects($this->exactly(2))
-      ->method('invokeAll')
+    $this->moduleHandler->expects($this->at(0))
+      ->method('getImplementations')
       ->with('views_data')
-      ->will($this->returnValue($expected_views_data));
+      ->willReturn(array('views_test_data'));
+    $this->moduleHandler->expects($this->at(1))
+      ->method('invoke')
+      ->with('views_test_data', 'views_data')
+      ->willReturn($this->viewsData());
+    $this->moduleHandler->expects($this->at(2))
+      ->method('alter')
+      ->with('views_data', $expected_views_data);
 
-    $this->moduleHandler->expects($this->exactly(2))
+    $this->moduleHandler->expects($this->at(3))
+      ->method('getImplementations')
+      ->with('views_data')
+      ->willReturn(array('views_test_data'));
+    $this->moduleHandler->expects($this->at(4))
+      ->method('invoke')
+      ->with('views_test_data', 'views_data')
+      ->willReturn($this->viewsData());
+    $this->moduleHandler->expects($this->at(5))
       ->method('alter')
       ->with('views_data', $expected_views_data);
 
+
     // The cache should only be called once (before the clear() call) as get
     // will get all table data in the first get().
     $this->cacheBackend->expects($this->at(0))
@@ -252,13 +294,10 @@ public function testFullAndTableGetCache() {
    * Tests the caching of the full views data.
    */
   public function testFullGetCache() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
 
     // Views data should be invoked once.
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
-      ->with('views_data')
-      ->will($this->returnValue($expected_views_data));
+    $this->setupMockedModuleHandler();
 
     $this->moduleHandler->expects($this->once())
       ->method('alter')
@@ -281,17 +320,14 @@ public function testFullGetCache() {
    */
   public function testSingleTableGetCache() {
     $table_name = 'views_test_data';
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
 
     // Views data should be invoked once.
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
-      ->with('views_data')
-      ->will($this->returnValue($expected_views_data));
+    $this->setupMockedModuleHandler();
 
     $this->moduleHandler->expects($this->once())
       ->method('alter')
-      ->with('views_data', $expected_views_data);
+      ->with('views_data', $this->viewsDataWithProvider());
 
     $this->cacheBackend->expects($this->at(0))
       ->method('get')
@@ -320,17 +356,13 @@ public function testSingleTableGetCache() {
    */
   public function testNonExistingTableGetCache() {
     $random_table_name = $this->randomMachineName();
-    $expected_views_data = $this->viewsData();
 
     // Views data should be invoked once.
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
-      ->with('views_data')
-      ->will($this->returnValue($expected_views_data));
+    $this->setupMockedModuleHandler();
 
     $this->moduleHandler->expects($this->once())
       ->method('alter')
-      ->with('views_data', $expected_views_data);
+      ->with('views_data', $this->viewsDataWithProvider());
 
     $this->cacheBackend->expects($this->at(0))
       ->method('get')
@@ -354,12 +386,9 @@ public function testNonExistingTableGetCache() {
    * Tests the cache backend behavior with requesting the same table multiple
    */
   public function testCacheCallsWithSameTableMultipleTimes() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
 
-    $this->moduleHandler->expects($this->any())
-      ->method('invokeAll')
-      ->with('views_data')
-      ->will($this->returnValue($expected_views_data));
+    $this->setupMockedModuleHandler();
 
     $this->cacheBackend->expects($this->at(0))
       ->method('get')
@@ -392,9 +421,9 @@ public function testCacheCallsWithSameTableMultipleTimes() {
    *   - views_test_data
    */
   public function testCacheCallsWithSameTableMultipleTimesAndWarmCache() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $this->moduleHandler->expects($this->never())
-      ->method('invokeAll');
+      ->method('getImplementations');
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->once())
@@ -422,9 +451,9 @@ public function testCacheCallsWithSameTableMultipleTimesAndWarmCache() {
    *   - views_test_data_2
    */
   public function testCacheCallsWithWarmCacheAndDifferentTable() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $this->moduleHandler->expects($this->never())
-      ->method('invokeAll');
+      ->method('getImplementations');
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->at(0))
@@ -457,10 +486,10 @@ public function testCacheCallsWithWarmCacheAndDifferentTable() {
    *   - $non_existing_table
    */
   public function testCacheCallsWithWarmCacheAndInvalidTable() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $non_existing_table = $this->randomMachineName();
     $this->moduleHandler->expects($this->never())
-      ->method('invokeAll');
+      ->method('getImplementations');
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->at(0))
@@ -496,7 +525,7 @@ public function testCacheCallsWithWarmCacheAndInvalidTable() {
   public function testCacheCallsWithWarmCacheForInvalidTable() {
     $non_existing_table = $this->randomMachineName();
     $this->moduleHandler->expects($this->never())
-      ->method('invokeAll');
+      ->method('getImplementations');
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->once())
@@ -521,10 +550,8 @@ public function testCacheCallsWithWarmCacheForInvalidTable() {
    * Tests the cache calls for all views data without a warm cache.
    */
   public function testCacheCallsWithoutWarmCacheAndGetAllTables() {
-    $expected_views_data = $this->viewsData();
-    $this->moduleHandler->expects($this->once())
-      ->method('invokeAll')
-      ->will($this->returnValue($expected_views_data));
+    $expected_views_data = $this->viewsDataWithProvider();
+    $this->setupMockedModuleHandler();
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->once())
@@ -549,9 +576,9 @@ public function testCacheCallsWithoutWarmCacheAndGetAllTables() {
    *   - all tables
    */
   public function testCacheCallsWithWarmCacheAndGetAllTables() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $this->moduleHandler->expects($this->never())
-      ->method('invokeAll');
+      ->method('getImplementations');
 
     // Setup a warm cache backend for a single table.
     $this->cacheBackend->expects($this->once())
@@ -575,7 +602,7 @@ public function testCacheCallsWithWarmCacheAndGetAllTables() {
    * @covers ::get
    */
   public function testCacheCallsWithoutWarmCacheAndGetMultipleTables() {
-    $expected_views_data = $this->viewsData();
+    $expected_views_data = $this->viewsDataWithProvider();
     $table_name = 'views_test_data';
     $table_name_2 = 'views_test_data_2';
 
