diff --git a/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php b/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php
index 4cd379abc2fcd610539aca1380fc0eea93c619c5..5c1e3f546c339ccee705bc3032fe16bd303c2213 100644
--- a/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php
+++ b/core/modules/simpletest/tests/src/Functional/BrowserTestBaseTest.php
@@ -17,7 +17,7 @@ class BrowserTestBaseTest extends BrowserTestBase {
    *
    * @var array
    */
-  public static $modules = array('test_page_test', 'form_test');
+  public static $modules = array('test_page_test', 'form_test', 'system_test');
 
   /**
    * Tests basic page test.
@@ -52,6 +52,13 @@ public function testGoTo() {
 
     // Test page contains some text.
     $this->assertSession()->pageTextContains('Hello Drupal');
+
+    // Test that setting headers with drupalGet() works.
+    $this->drupalGet('system-test/header', array(), array(
+      'Test-Header' => 'header value',
+    ));
+    $returned_header = $this->getSession()->getResponseHeader('Test-Header');
+    $this->assertSame('header value', $returned_header);
   }
 
   /**
diff --git a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
index 9bf4fae1342836235f80fd3dd95ecb61d39480a7..f2e138621e297b0442b0866e1de3ca655d065085 100644
--- a/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
+++ b/core/modules/system/tests/modules/system_test/src/Controller/SystemTestController.php
@@ -348,4 +348,16 @@ public function getCurrentDate() {
     return $response;
   }
 
+  /**
+   * Returns a response with a test header set from the request.
+   *
+   * @return \Symfony\Component\HttpFoundation\Response $response
+   *   A Response object containing the test header.
+   */
+  public function getTestHeader(Request $request) {
+    $response = new Response();
+    $response->headers->set('Test-Header', $request->headers->get('Test-Header'));
+    return $response;
+  }
+
 }
diff --git a/core/modules/system/tests/modules/system_test/system_test.routing.yml b/core/modules/system/tests/modules/system_test/system_test.routing.yml
index a91e83b1e3e4ee02867848a552921499bc791068..f35f5462b31444751bf5695906946c0bdb814930 100644
--- a/core/modules/system/tests/modules/system_test/system_test.routing.yml
+++ b/core/modules/system/tests/modules/system_test/system_test.routing.yml
@@ -175,3 +175,10 @@ system_test.always_denied:
     _controller: 'chop'
   requirements:
     _access: 'FALSE'
+
+system_test.header:
+  path: '/system-test/header'
+  defaults:
+    _controller: '\Drupal\system_test\Controller\SystemTestController::getTestHeader'
+  requirements:
+    _access: 'TRUE'
diff --git a/core/tests/Drupal/Tests/BrowserTestBase.php b/core/tests/Drupal/Tests/BrowserTestBase.php
index 3767ad1b5b2820c10a54f2198ef88e5d59566b2a..c8df47c7261e781e7f6808382fcb89c4ce81b855 100644
--- a/core/tests/Drupal/Tests/BrowserTestBase.php
+++ b/core/tests/Drupal/Tests/BrowserTestBase.php
@@ -655,17 +655,29 @@ protected function buildUrl($path, array $options = array()) {
    *   Drupal path or URL to load into Mink controlled browser.
    * @param array $options
    *   (optional) Options to be forwarded to the url generator.
+   * @param string[] $headers
+   *   An array containing additional HTTP request headers, the array keys are
+   *   the header names and the array values the header values. This is useful
+   *   to set for example the "Accept-Language" header for requesting the page
+   *   in a different language. Note that not all headers are supported, for
+   *   example the "Accept" header is always overridden by the browser. For
+   *   testing REST APIs it is recommended to directly use an HTTP client such
+   *   as Guzzle instead.
    *
    * @return string
    *   The retrieved HTML string, also available as $this->getRawContent()
    */
-  protected function drupalGet($path, array $options = array()) {
+  protected function drupalGet($path, array $options = array(), array $headers = array()) {
     $options['absolute'] = TRUE;
     $url = $this->buildUrl($path, $options);
 
     $session = $this->getSession();
 
     $this->prepareRequest();
+    foreach ($headers as $header_name => $header_value) {
+      $session->setRequestHeader($header_name, $header_value);
+    }
+
     $session->visit($url);
     $out = $session->getPage()->getContent();