diff --git a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
index 64aed01..2daa658 100644
--- a/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
+++ b/core/lib/Drupal/Core/Page/DefaultHtmlFragmentRenderer.php
@@ -77,8 +77,6 @@ public function preparePage(HtmlPage $page, &$page_array) {
     // @todo Remove this one drupal_get_title() has been eliminated.
     if (!$page->hasTitle()) {
       $title = drupal_get_title();
-      // drupal_set_title() already ensured security, so not letting the
-      // title pass through would cause double escaping.
       $page->setTitle($title, PASS_THROUGH);
     }
 
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
index 33f2f47..c56602d 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/PageTitleTest.php
@@ -61,14 +61,8 @@ function tearDown() {
    */
   function testTitleTags() {
     $title = "string with <em>HTML</em>";
-    // drupal_set_title's $filter is Title::CHECK_PLAIN by default, so the title should be
-    // returned with check_plain().
-    drupal_set_title($title, Title::CHECK_PLAIN);
-    $this->assertTrue(strpos(drupal_get_title(), '<em>') === FALSE, 'Tags in title converted to entities when $output is Title::CHECK_PLAIN.');
-    // drupal_set_title's $filter is passed as PASS_THROUGH, so the title should be
-    // returned with HTML.
-    drupal_set_title($title, PASS_THROUGH);
-    $this->assertTrue(strpos(drupal_get_title(), '<em>') !== FALSE, 'Tags in title are not converted to entities when $output is PASS_THROUGH.');
+    $this->assertTrue(strpos(Title::CHECK_PLAIN, '<em>') === FALSE, 'Tags in title converted to entities when $output is Title::CHECK_PLAIN.');
+    $this->assertTrue(strpos(PASS_THROUGH, '<em>') !== FALSE, 'Tags in title are not converted to entities when $output is PASS_THROUGH.');
     // Generate node content.
     $edit = array(
       'title[0][value]' => '!SimpleTest! ' . $title . $this->randomName(20),
