Bug 1511834 - Improving site Information header in reader mode r=johannh

Differential Revision: https://phabricator.services.mozilla.com/D21869

--HG--
extra : moz-landing-system : lando
This commit is contained in:
neha 2019-03-07 12:36:51 +00:00
Родитель c33b5e6569
Коммит 5677a00d88
2 изменённых файлов: 30 добавлений и 0 удалений

Просмотреть файл

@ -743,6 +743,11 @@ var gIdentityHandler = {
// Some URIs might have no hosts.
}
let readerStrippedURI = ReaderMode.getOriginalUrlObjectForDisplay(this._uri.displaySpec);
if (readerStrippedURI) {
host = readerStrippedURI.host;
}
if (this._pageExtensionPolicy) {
host = this._pageExtensionPolicy.name;
}

Просмотреть файл

@ -24,6 +24,13 @@ function getConnectionState() {
return document.getElementById("identity-popup").getAttribute("connection");
}
function getReaderModeURL() {
// Gets the reader mode URL from "identity-popup mainView panel header span"
document.getElementById("identity-box").click();
gIdentityHandler.refreshIdentityPopup();
return document.getElementById("identity-popup-mainView-panel-header-span").innerHTML;
}
// This test is slow on Linux debug e10s
requestLongerTimeout(2);
@ -349,6 +356,24 @@ add_task(async function test_about_uri() {
await aboutUriTest(false);
});
async function readerUriTest(secureCheck) {
await SpecialPowers.pushPrefEnv({set: [[INSECURE_ICON_PREF, secureCheck]]});
let newTab = await loadNewTab("about:reader?url=http://example.com");
gBrowser.selectedTab = newTab;
let readerURL = getReaderModeURL();
is(readerURL, "Site Information for example.com", "should be the correct URI in reader mode");
gBrowser.removeTab(newTab);
await SpecialPowers.popPrefEnv();
}
add_task(async function test_reader_uri() {
await readerUriTest(true);
await readerUriTest(false);
});
async function dataUriTest(secureCheck) {
let oldTab = gBrowser.selectedTab;
await SpecialPowers.pushPrefEnv({set: [[INSECURE_ICON_PREF, secureCheck]]});