diff --git a/core/modules/comment/comment.module b/core/modules/comment/comment.module
index a6230f2..16819a2 100644
--- a/core/modules/comment/comment.module
+++ b/core/modules/comment/comment.module
@@ -963,6 +963,7 @@ function comment_view(Comment $comment, Node $node, $view_mode = 'full', $langco
 
   $build += array(
     '#theme' => 'comment__node_' . $node->type,
+    '#build_name' => '#comment',
     '#comment' => $comment,
     '#node' => $node,
     '#view_mode' => $view_mode,
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
index 7f5f5cd..f795090 100644
--- a/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentTestBase.php
@@ -18,7 +18,14 @@ class CommentTestBase extends WebTestBase {
   protected $node;
 
   function setUp() {
-    parent::setUp('comment', 'search');
+    $modules = func_get_args();
+    if (isset($modules[0]) && is_array($modules[0])) {
+      $modules = $modules[0];
+    }
+    $modules[] = 'comment';
+    $modules[] = 'search';
+    parent::setUp($modules);
+
     // Create users and test node.
     $this->admin_user = $this->drupalCreateUser(array('administer content types', 'administer comments', 'administer blocks'));
     $this->web_user = $this->drupalCreateUser(array('access comments', 'post comments', 'create article content', 'edit own comments'));
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentViewAlterTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentViewAlterTest.php
new file mode 100644
index 0000000..edad09b
--- /dev/null
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentViewAlterTest.php
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\comment\Tests\CommentViewAlterTest.
+ */
+
+namespace Drupal\comment\Tests;
+
+/**
+ * Tests hook_entity_view_alter() for comments.
+ */
+class CommentViewAlterTest extends CommentTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment view alter',
+      'description' => 'Tests hook_entity_view_alter() for comments.',
+      'group' => 'Comment',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('entity_test');
+  }
+
+  /**
+   * Tests that the #build_name is set correctly for comments.
+   */
+  function testCommentViewAlter() {
+    // Update the comment settings so preview isn't required.
+    $this->drupalLogin($this->admin_user);
+    $this->setCommentSubject(TRUE);
+    $this->setCommentPreview(DRUPAL_OPTIONAL);
+    $this->drupalLogout();
+
+    // Log in as the web user and add the comment.
+    $this->drupalLogin($this->web_user);
+    $subject_text = $this->randomName();
+    $comment_text = $this->randomName();
+    $comment = $this->postComment($this->node, $comment_text, $subject_text, TRUE);
+
+    $this->drupalGet('node/' . $this->node->nid . '/' . $comment->id);
+    $this->assertText('hook_entity_view_alter:build_name:#comment', 'Build name for comment is specified in hook_entity_view_alter');
+  }
+}
diff --git a/core/modules/entity/tests/modules/entity_test/entity_test.module b/core/modules/entity/tests/modules/entity_test/entity_test.module
index f97d2e9..9294ae1 100644
--- a/core/modules/entity/tests/modules/entity_test/entity_test.module
+++ b/core/modules/entity/tests/modules/entity_test/entity_test.module
@@ -67,3 +67,12 @@ function entity_test_load_multiple($ids = array(), $conditions = array(), $reset
 function entity_test_delete_multiple(array $ids) {
   entity_get_controller('entity_test')->delete($ids);
 }
+
+/**
+ * Implements hook_entity_view_alter().
+ */
+function entity_test_entity_view_alter(&$build, $type) {
+  if (isset($build['#build_name'])) {
+    drupal_set_message('hook_entity_view_alter:build_name:' . $build['#build_name']);
+  }
+}
diff --git a/core/modules/node/lib/Drupal/node/Tests/NodeViewAlterTest.php b/core/modules/node/lib/Drupal/node/Tests/NodeViewAlterTest.php
new file mode 100644
index 0000000..bf96bc0
--- /dev/null
+++ b/core/modules/node/lib/Drupal/node/Tests/NodeViewAlterTest.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\node\Tests\NodeViewAlterTest.
+ */
+
+namespace Drupal\node\Tests;
+
+/**
+ * Tests hook_entity_view_alter() for nodes.
+ */
+class NodeViewAlterTest extends NodeTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'Node view alter',
+      'description' => 'Tests hook_entity_view_alter() for nodes.',
+      'group' => 'Node',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('entity_test');
+    $this->admin_user = $this->drupalCreateUser(array('administer nodes', 'create article content', 'create page content'));
+    $this->drupalLogin($this->admin_user);
+  }
+
+  /**
+   * Tests that the #build_name is set correctly for nodes.
+   */
+  function testNodeViewAlter() {
+    $node = $this->drupalCreateNode();
+
+    $this->drupalGet('node/' . $node->nid);
+    $this->assertText('hook_entity_view_alter:build_name:#node', 'Build name for node is specified in hook_entity_view_alter');
+  }
+}
diff --git a/core/modules/node/node.module b/core/modules/node/node.module
index 49d20a7..446bc52 100644
--- a/core/modules/node/node.module
+++ b/core/modules/node/node.module
@@ -1190,6 +1190,7 @@ function node_view(Node $node, $view_mode = 'full', $langcode = NULL) {
 
   $build += array(
     '#theme' => 'node',
+    '#build_name' => '#node',
     '#node' => $node,
     '#view_mode' => $view_mode,
     '#langcode' => $langcode,
diff --git a/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermViewAlterTest.php b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermViewAlterTest.php
new file mode 100644
index 0000000..12b2956
--- /dev/null
+++ b/core/modules/taxonomy/lib/Drupal/taxonomy/Tests/TermViewAlterTest.php
@@ -0,0 +1,37 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\taxonomy\Tests\TermViewAlterTest.
+ */
+
+namespace Drupal\taxonomy\Tests;
+
+/**
+ * Tests hook_entity_view_alter() for taxonomy terms.
+ */
+class TermViewAlterTest extends TaxonomyTestBase {
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Taxonomy term view alter',
+      'description' => 'Tests hook_entity_view_alter() for taxonomy terms.',
+      'group' => 'Taxonomy',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('entity_test');
+  }
+
+  /**
+   * Tests that the #build_name is set correctly for taxonomy terms.
+   */
+  function testTaxonomyTermViewAlter() {
+    $vocabulary = $this->createVocabulary();
+    $term = $this->createTerm($vocabulary);
+    $this->drupalGet('taxonomy/term/' . $term->tid);
+
+    $this->assertText('hook_entity_view_alter:build_name:#term', 'Build name for taxonomy term is specified in hook_entity_view_alter');
+  }
+}
diff --git a/core/modules/taxonomy/taxonomy.module b/core/modules/taxonomy/taxonomy.module
index 6697a0a..3936c90 100644
--- a/core/modules/taxonomy/taxonomy.module
+++ b/core/modules/taxonomy/taxonomy.module
@@ -592,6 +592,7 @@ function taxonomy_term_view(Term $term, $view_mode = 'full', $langcode = NULL) {
 
   $build = array(
     '#theme' => 'taxonomy_term',
+    '#build_name' => '#term',
     '#term' => $term,
     '#view_mode' => $view_mode,
     '#language' => $langcode,
diff --git a/core/modules/user/lib/Drupal/user/Tests/UserViewAlterTest.php b/core/modules/user/lib/Drupal/user/Tests/UserViewAlterTest.php
new file mode 100644
index 0000000..eee6fec
--- /dev/null
+++ b/core/modules/user/lib/Drupal/user/Tests/UserViewAlterTest.php
@@ -0,0 +1,38 @@
+<?php
+
+/**
+ * @file
+ * Definition of Drupal\user\Tests\UserViewAlterTest.
+ */
+
+namespace Drupal\user\Tests;
+
+use Drupal\simpletest\WebTestBase;
+
+/**
+ * Tests hook_entity_view_alter() for users.
+ */
+class UserViewAlterTest extends WebTestBase {
+  public static function getInfo() {
+    return array(
+      'name' => 'User view alter',
+      'description' => 'Tests hook_entity_view_alter() for users.',
+      'group' => 'User',
+    );
+  }
+
+  function setUp() {
+    parent::setUp('entity_test');
+
+    $this->account = $this->drupalCreateUser(array('administer users'));
+    $this->drupalLogin($this->account);
+  }
+
+  /**
+   * Tests that the #build_name is set correctly for users.
+   */
+  function testUserViewAlter() {
+    $this->drupalGet('user/' . $this->account->uid);
+    $this->assertText('hook_entity_view_alter:build_name:#account', 'Build name for user is specified in hook_entity_view_alter');
+  }
+}
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 89706c4..a54ea0c 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -2375,6 +2375,7 @@ function user_view($account, $view_mode = 'full', $langcode = NULL) {
 
   $build += array(
     '#theme' => 'user_profile',
+    '#build_name' => '#account',
     '#account' => $account,
     '#view_mode' => $view_mode,
     '#language' => $langcode,
