Backed out changeset 7216b345380e (bug 1175702)
authorBrian Grinstead <bgrinstead@mozilla.com>
Thu, 06 Aug 2015 16:59:56 -0700
changeset 288270 4fc077aa4dc0151bb7f65f3329f16121451515c7
parent 288269 b735f4eea9359c0d88373be4afda32618c7ce567
child 288271 e78c3243636965c80167c0f54aaaaaab77974208
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 out7216b345380e3acd451fc842bd2e2c49b4d4a144
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 7216b345380e (bug 1175702)
browser/base/content/browser.js
browser/base/content/test/general/browser_bug590206.js
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7175,16 +7175,24 @@ var gIdentityHandler = {
     this._identityPopupContentSupp.textContent = supplemental;
     this._identityPopupContentVerif.textContent = verifier;
 
     // Update per-site permissions section.
     this.updateSitePermissions();
   },
 
   _isURILoadedFromFile(uri) {
+    try {
+      uri.host;
+      // No internal/file URI if we have a host.
+      return false;
+    } catch (e) {
+      // All good, let's continue.
+    }
+
     // Create a channel for the sole purpose of getting the resolved URI
     // of the request to determine if it's loaded from the file system.
     let chanOptions = {uri, loadUsingSystemPrincipal: true};
     let resolvedURI = NetUtil.newChannel(chanOptions).URI;
     if (resolvedURI.schemeIs("jar")) {
       // Given a URI "jar:<jar-file-uri>!/<jar-entry>"
       // create a new URI using <jar-file-uri>!/<jar-entry>
       resolvedURI = NetUtil.newURI(resolvedURI.path);
--- a/browser/base/content/test/general/browser_bug590206.js
+++ b/browser/base/content/test/general/browser_bug590206.js
@@ -1,29 +1,22 @@
 /*
  * Test the identity mode UI for a variety of page types
  */
 
-"use strict";
-
 const DUMMY = "browser/browser/base/content/test/general/dummy_page.html";
 
 function loadNewTab(url) {
   return BrowserTestUtils.openNewForegroundTab(gBrowser, url);
 }
 
 function getIdentityMode() {
   return document.getElementById("identity-box").className;
 }
 
-function getConnectionState() {
-  gIdentityHandler.refreshIdentityPopup();
-  return document.getElementById("identity-popup").getAttribute("connection");
-}
-
 // This test is slow on Linux debug e10s
 requestLongerTimeout(2);
 
 add_task(function* test_webpage() {
   let oldTab = gBrowser.selectedTab;
 
   let newTab = yield loadNewTab("http://example.com/" + DUMMY);
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
@@ -51,23 +44,23 @@ add_task(function* test_blank() {
 
   gBrowser.removeTab(newTab);
 });
 
 add_task(function* test_chrome() {
   let oldTab = gBrowser.selectedTab;
 
   let newTab = yield loadNewTab("chrome://mozapps/content/extensions/extensions.xul");
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be file");
 
   gBrowser.selectedTab = oldTab;
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
 
   gBrowser.selectedTab = newTab;
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be file");
 
   gBrowser.removeTab(newTab);
 });
 
 add_task(function* test_https() {
   let oldTab = gBrowser.selectedTab;
 
   let newTab = yield loadNewTab("https://example.com/" + DUMMY);
@@ -97,40 +90,40 @@ add_task(function* test_addons() {
   gBrowser.removeTab(newTab);
 });
 
 add_task(function* test_file() {
   let oldTab = gBrowser.selectedTab;
   let fileURI = getTestFilePath("");
 
   let newTab = yield loadNewTab(fileURI);
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be file");
 
   gBrowser.selectedTab = oldTab;
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
 
   gBrowser.selectedTab = newTab;
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be file");
 
   gBrowser.removeTab(newTab);
 });
 
 add_task(function test_resource_uri() {
   let oldTab = gBrowser.selectedTab;
-  let dataURI = "resource://gre/modules/Services.jsm";
+  let dataURI = "resource://gre/modules/Services.jsm"
 
   let newTab = yield loadNewTab(dataURI);
 
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be unknown");
 
   gBrowser.selectedTab = oldTab;
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
 
   gBrowser.selectedTab = newTab;
-  is(getConnectionState(), "file", "Connection should be file");
+  is(getIdentityMode(), "fileURI", "Identity should be unknown");
 
   gBrowser.removeTab(newTab);
 });
 
 add_task(function test_data_uri() {
   let oldTab = gBrowser.selectedTab;
   let dataURI = "data:text/html,hi"
 
@@ -140,24 +133,8 @@ add_task(function test_data_uri() {
   gBrowser.selectedTab = oldTab;
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
 
   gBrowser.selectedTab = newTab;
   is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
 
   gBrowser.removeTab(newTab);
 });
-
-add_task(function test_about_uri() {
-  let oldTab = gBrowser.selectedTab;
-  let aboutURI = "about:robots"
-
-  let newTab = yield loadNewTab(aboutURI);
-  is(getConnectionState(), "file", "Connection should be file");
-
-  gBrowser.selectedTab = oldTab;
-  is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
-
-  gBrowser.selectedTab = newTab;
-  is(getConnectionState(), "file", "Connection should be file");
-
-  gBrowser.removeTab(newTab);
-});