зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 7216b345380e (bug 1175702)
--HG-- extra : source : 38ee781d437c8e442be901c0644392b5eecbc2c6
This commit is contained in:
Родитель
6b37d9c465
Коммит
35f4f92f8a
|
@ -7180,6 +7180,14 @@ var gIdentityHandler = {
|
|||
},
|
||||
|
||||
_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};
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
* 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) {
|
||||
|
@ -14,11 +12,6 @@ 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);
|
||||
|
||||
|
@ -56,13 +49,13 @@ 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);
|
||||
});
|
||||
|
@ -102,30 +95,30 @@ add_task(function* test_file() {
|
|||
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);
|
||||
});
|
||||
|
@ -145,19 +138,3 @@ add_task(function test_data_uri() {
|
|||
|
||||
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);
|
||||
});
|
||||
|
|
Загрузка…
Ссылка в новой задаче