Backed out changeset dc33bb49347d (bug 1175702)
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 06 Aug 2015 17:00:16 -0700
changeset 288316 6e9c284ce3f8d9a67942939a46d64246af20f012
parent 288315 38ee781d437c8e442be901c0644392b5eecbc2c6
child 288317 0fb83409ff34131af0c1cb49f1b27e1fafa7f79a
push id5067
push userraliiev@mozilla.com
push dateMon, 21 Sep 2015 14:04:52 +0000
treeherdermozilla-beta@14221ffe5b2f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1175702
milestone42.0a1
backs outdc33bb49347daad4d6332d26bedc3ad74bb0fc71
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset dc33bb49347d (bug 1175702)
browser/base/content/browser.js
browser/base/content/test/general/browser_identity_UI.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -6853,34 +6853,24 @@ var gIdentityHandler = {
    * be called by onSecurityChange
    *
    * @param PRUint32 state
    * @param nsIURI uri The address for which the UI should be updated.
    */
   checkIdentity : function(state, uri) {
     let nsIWebProgressListener = Ci.nsIWebProgressListener;
 
-    // For some URIs like data: we can't get a host. URIs without a host will
-    // usually be treated as a non-secure connection if they're not on the
-    // whitelist below and don't resolve to file:// URIs internally.
-    let unknown = false;
-    try {
-      uri.host;
-    } catch (e) { unknown = true; }
-
     // Chrome URIs however get special treatment. Some chrome URIs are
     // whitelisted to provide a positive security signal to the user.
     let whitelist = /^about:(accounts|addons|app-manager|config|crashes|customizing|downloads|healthreport|home|license|newaddon|permissions|preferences|privatebrowsing|rights|sessionrestore|support|welcomeback)/i;
     let isChromeUI = uri.schemeIs("about") && whitelist.test(uri.spec);
     let mode = this.IDENTITY_MODE_UNKNOWN;
 
     if (isChromeUI) {
       mode = this.IDENTITY_MODE_CHROMEUI;
-    } else if (unknown) {
-      // Use default mode.
     } else if (state & nsIWebProgressListener.STATE_IDENTITY_EV_TOPLEVEL) {
       if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
         mode = this.IDENTITY_MODE_MIXED_ACTIVE_BLOCKED_IDENTIFIED;
       } else {
         mode = this.IDENTITY_MODE_IDENTIFIED;
       }
     } else if (state & nsIWebProgressListener.STATE_IS_SECURE) {
       if (state & nsIWebProgressListener.STATE_BLOCKED_MIXED_ACTIVE_CONTENT) {
--- a/browser/base/content/test/general/browser_identity_UI.js
+++ b/browser/base/content/test/general/browser_identity_UI.js
@@ -38,16 +38,17 @@ var tests = [
   {
     name: "subdomain with port",
     location: "http://sub1.test1.example.org:8000/",
     effectiveHost: "example.org"
   },
   {
     name: "subdomain HTTPS",
     location: "https://test1.example.com/",
+
     effectiveHost: "example.com",
     isHTTPS: true
   },
   {
     name: "view-source HTTPS",
     location: "view-source:https://example.com/",
     effectiveHost: null,
     isHTTPS: true
@@ -98,19 +99,17 @@ function nextTest() {
     if (!gForward)
       gTestDesc += " (second time)";
     content.location.reload(true);
   }
 }
 
 function checkResult() {
   // Sanity check other values, and the value of gIdentityHandler.getEffectiveHost()
-  is(gIdentityHandler._uri.spec, gCurrentTest.location, "location matches for test " + gTestDesc);
+  is(gIdentityHandler._lastUri.spec, gCurrentTest.location, "location matches for test " + gTestDesc);
   // getEffectiveHost can't be called for all modes
-  if (gCurrentTest.effectiveHost === null) {
-    let identityBox = document.getElementById("identity-box");
-    is(identityBox.className == gIdentityHandler.IDENTITY_MODE_UNKNOWN || identityBox.className == gIdentityHandler.IDENTITY_MODE_CHROMEUI, true, "mode matched");
-  } else {
+  if (gCurrentTest.effectiveHost === null)
+    is(gIdentityHandler._mode == gIdentityHandler.IDENTITY_MODE_UNKNOWN || gIdentityHandler._mode == gIdentityHandler.IDENTITY_MODE_CHROMEUI, true, "mode matched");
+  else
     is(gIdentityHandler.getEffectiveHost(), gCurrentTest.effectiveHost, "effectiveHost matches for test " + gTestDesc);
-  }
 
   executeSoon(nextTest);
 }