diff --git a/modules/locale/locale.test b/modules/locale/locale.test
index 6dad7e0..eb00ab2 100644
--- a/modules/locale/locale.test
+++ b/modules/locale/locale.test
@@ -1790,6 +1790,19 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
     $this->drupalLogin($admin_user);
   }
 
+  function loginHTTPS($user) {
+    global $base_url, $base_path;
+    $secure_base_url = str_replace('http://', 'https://', $base_url);
+    $edit = array(
+      'name' => $user->name,
+      'pass' => $user->pass_raw,
+    );
+    $this->drupalGet($secure_base_url . $base_path . 'user');
+    $form = $this->xpath('//form[@id="user-login"]');
+    $form[0]['action'] = $secure_base_url . $base_path . 'user';
+    $this->drupalPost(NULL, $edit, t('Log in'));
+  }
+
   /**
    * Tests for language switching by URL path.
    */
@@ -1901,7 +1914,7 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
 
     // Setup for domain negotiation, first configure the language to have domain
     // URL.
-    $edit = array('prefix' => '', 'domain' => "http://$language_domain");
+    $edit = array('prefix' => '', 'domain' => "$language_domain");
     $this->drupalPost("admin/config/regional/language/edit/$language", $edit, t('Save language'));
     // Set the site to use domain language negotiation.
 
@@ -1931,6 +1944,14 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
     foreach ($tests as $test) {
       $this->runTest($test);
     }
+    
+    // Repeat test for https
+    $this->admin2_user = $this->drupalCreateUser(array('administer languages', 'translate interface', 'access administration pages', 'administer blocks'));
+    $this->loginHTTPS($this->admin2_user);
+    foreach ($tests as $test) {
+      $test['message'] .= ' (HTTPS)';
+      $this->runTestHTTPS($test);
+    }
   }
 
   private function runTest($test) {
@@ -1948,6 +1969,24 @@ class LocaleUILanguageNegotiationTest extends DrupalWebTestCase {
     $this->assertText($test['expect'], $test['message']);
   }
 
+  private function runTestHTTPS($test) {
+    global $base_url, $base_path;
+    $secure_base_url = str_replace('http://', 'https://', $base_url);
+    
+    if (!empty($test['language_negotiation'])) {
+      $negotiation = array_flip($test['language_negotiation']);
+      language_negotiation_set(LANGUAGE_TYPE_INTERFACE, $negotiation);
+    }
+    if (!empty($test['locale_language_negotiation_url_part'])) {
+      variable_set('locale_language_negotiation_url_part', $test['locale_language_negotiation_url_part']);
+    }
+    if (!empty($test['locale_test_domain'])) {
+      variable_set('locale_test_domain', $test['locale_test_domain']);
+    }
+    $this->drupalGet($secure_base_url . $base_path . $test['path'], array('https' => TRUE, 'absolute' => TRUE), $test['http_header']);
+    $this->assertText($test['expect'], $test['message']);
+  }
+
   /**
    * Test URL language detection when the requested URL has no language.
    */
