Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2015-09-28 14:19:22 +02:00
Родитель 0e0121f2cb 363e40e298
Коммит 601264c5c1
623 изменённых файлов: 6985 добавлений и 3991 удалений

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
@ -122,7 +122,7 @@
<project name="platform/system/media" path="system/media" revision="c1332c21c608f4932a6d7e83450411cde53315ef"/>
<default remote="caf" revision="LNX.LA.3.5.2.1.1" sync-j="4"/>
<!-- Platform common things -->
<project name="device-shinano-common" path="device/sony/shinano-common" remote="b2g" revision="df3d2ae4345ca5d32bce717bb7b3dac18a3afa18"/>
<project name="device-shinano-common" path="device/sony/shinano-common" remote="b2g" revision="2f09386bb130b0111219cfc830316797392d48b0"/>
<project name="device/generic/armv7-a-neon" path="device/generic/armv7-a-neon" revision="1bb28abbc215f45220620af5cd60a8ac1be93722"/>
<project name="device/qcom/common" path="device/qcom/common" revision="2501e5940ba69ece7654ff85611c76ae5bda299c"/>
<project name="codeaurora_kernel_msm" path="kernel" remote="b2g" revision="d620691cad7aee780018e98159ff03bf99840317"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

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

@ -17,7 +17,7 @@
</project>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="828317e64d28138f24d578ab340c2a0ff8552df0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="librecovery" path="librecovery" remote="b2g" revision="1b3591a50ed352fc6ddb77462b7b35d0bfa555a3"/>

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

@ -19,7 +19,7 @@
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="fake-dalvik" path="dalvik" remote="b2g" revision="ca1f327d5acc198bb4be62fa51db2c039032c9ce"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia.git" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="platform_hardware_ril" path="hardware/ril" remote="b2g" revision="27eb2f04e149fc2c9976d881b1b5984bbe7ee089"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>

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

@ -1,9 +1,9 @@
{
"git": {
"git_revision": "285486b417f1cb8316b19c0698a6655fc053fbd6",
"git_revision": "01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c",
"remote": "https://git.mozilla.org/releases/gaia.git",
"branch": ""
},
"revision": "79e34061945d4b9d3cefc2f2d8ec895b05323dd4",
"revision": "d7e928f87e2cc34121db52e65f2eeb7598a01412",
"repo_path": "integration/gaia-central"
}

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="8d83715f08b7849f16a0dfc88f78d5c3a89c0a54">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>

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

@ -18,7 +18,7 @@
<project name="rilproxy" path="rilproxy" remote="b2g" revision="5ef30994f4778b4052e58a4383dbe7890048c87e"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>
<project name="moztt" path="external/moztt" remote="b2g" revision="828317e64d28138f24d578ab340c2a0ff8552df0"/>
<project name="apitrace" path="external/apitrace" remote="apitrace" revision="f004530b30a63c08a16d82536858600446b2abf5"/>

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

@ -15,7 +15,7 @@
<project name="platform_build" path="build" remote="b2g" revision="c9d4fe680662ee44a4bdea42ae00366f5df399cf">
<copyfile dest="Makefile" src="core/root.mk"/>
</project>
<project name="gaia" path="gaia" remote="mozillaorg" revision="285486b417f1cb8316b19c0698a6655fc053fbd6"/>
<project name="gaia" path="gaia" remote="mozillaorg" revision="01ffe82cf088ca8fda9fe6783dc5cad2c3dde01c"/>
<project name="fake-libdvm" path="dalvik" remote="b2g" revision="d50ae982b19f42f0b66d08b9eb306be81687869f"/>
<project name="fake-qemu-kernel" path="prebuilts/qemu-kernel" remote="b2g" revision="939b377d55a2f081d94029a30a75d05e5a20daf3"/>
<project name="gonk-misc" path="gonk-misc" remote="b2g" revision="9465d16f95ab87636b2ae07538ee88e5aeff2d7d"/>

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

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1441833117000">
<blocklist xmlns="http://www.mozilla.org/2006/addons-blocklist" lastupdate="1443217898000">
<emItems>
<emItem blockID="i58" id="webmaster@buzzzzvideos.info">
<versionRange minVersion="0" maxVersion="*">
@ -331,7 +331,7 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i856" id="/^({94d62e35-4b43-494c-bf52-ba5935df36ef}|firefox@advanceelite\.com|{bb7b7a60-f574-47c2-8a0b-4c56f2da9802})$/">
<emItem blockID="i376" id="{9e09ac65-43c0-4b9d-970f-11e2e9616c55}">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
@ -939,7 +939,7 @@
<prefs>
</prefs>
</emItem>
<emItem blockID="i376" id="{9e09ac65-43c0-4b9d-970f-11e2e9616c55}">
<emItem blockID="i856" id="/^({94d62e35-4b43-494c-bf52-ba5935df36ef}|firefox@advanceelite\.com|{bb7b7a60-f574-47c2-8a0b-4c56f2da9802})$/">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
@ -1559,6 +1559,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1012" id="wxtui502n2xce9j@no14">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i692" id="/^(j003-lqgrmgpcekslhg|SupraSavings|j003-dkqonnnthqjnkq|j003-kaggrpmirxjpzh)@jetpack$/">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -1854,6 +1860,12 @@
<pref>browser.startup.homepage</pref>
<pref>browser.search.defaultenginename</pref>
</prefs>
</emItem>
<emItem blockID="i1018" id="grjkntbhr@hgergerherg.com">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i780" id="{b6ef1336-69bb-45b6-8cba-e578fc0e4433}">
<versionRange minVersion="0" maxVersion="*" severity="3">
@ -2510,6 +2522,12 @@
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i1016" id="jid1-uabu5A9hduqzCw@jetpack">
<versionRange minVersion="0" maxVersion="*" severity="3">
</versionRange>
<prefs>
</prefs>
</emItem>
<emItem blockID="i226" id="{462be121-2b54-4218-bf00-b9bf8135b23f}">
<versionRange minVersion="0" maxVersion="*" severity="1">
@ -3183,6 +3201,10 @@
<pluginItem blockID="p1004">
<match name="description" exp="^($|Unity Web Player version 5.0(\.([0-2]|3f1))?[^0-9.])" /> <match name="filename" exp="Unity Web Player\.plugin" /> <versionRange severity="0" vulnerabilitystatus="1"></versionRange>
</pluginItem>
<pluginItem blockID="p1020">
<match name="filename" exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" /> <versionRange minVersion="13.0" maxVersion="13.*" severity="0" vulnerabilitystatus="1"></versionRange>
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
</pluginItem>
</pluginItems>
<gfxItems>
@ -3297,6 +3319,9 @@
</certItem>
<certItem issuerName="MDcxJDAiBgNVBAMTG1JDUyBDZXJ0aWZpY2F0aW9uIEF1dGhvcml0eTEPMA0GA1UEChMGSFQgc3Js">
<serialNumber>AN9bfYOvlR1t</serialNumber>
</certItem>
<certItem issuerName="MEQxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3dGUsIEluYy4xHjAcBgNVBAMTFXRoYXd0ZSBFViBTU0wgQ0EgLSBHMw==">
<serialNumber>CrTHPEE6AZSfI3jysin2bA==</serialNumber>
</certItem>
</certItems>

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

@ -1759,19 +1759,11 @@ pref("plain_text.wrap_long_lines", true);
pref("dom.debug.propagate_gesture_events_through_content", false);
// The request URL of the GeoLocation backend.
#ifdef RELEASE_BUILD
pref("geo.wifi.uri", "https://www.googleapis.com/geolocation/v1/geolocate?key=%GOOGLE_API_KEY%");
#else
pref("geo.wifi.uri", "https://location.services.mozilla.com/v1/geolocate?key=%MOZILLA_API_KEY%");
#endif
#ifdef XP_MACOSX
#ifdef RELEASE_BUILD
pref("geo.provider.use_corelocation", false);
#else
pref("geo.provider.use_corelocation", true);
#endif
#endif
#ifdef XP_WIN
pref("geo.provider.ms-windows-location", false);
@ -1950,3 +1942,9 @@ pref("dom.serviceWorkers.interception.enabled", true);
// Enable Push API.
pref("dom.push.enabled", true);
// These are the thumbnail width/height set in about:newtab.
// If you change this, ENSURE IT IS THE SAME SIZE SET
// by about:newtab. These values are in CSS pixels.
pref("toolkit.pageThumbs.minWidth", 280);
pref("toolkit.pageThumbs.minHeight", 190);

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

@ -313,11 +313,18 @@ var gFxAccounts = {
this.panelUILabel.setAttribute("label", profile.displayName);
}
if (profile.avatar) {
this.panelUIFooter.setAttribute("fxaprofileimage", "set");
let bgImage = "url(\"" + profile.avatar + "\")";
this.panelUIAvatar.style.listStyleImage = bgImage;
let img = new Image();
// Make sure the image is available before attempting to display it
img.onload = () => {
this.panelUIFooter.setAttribute("fxaprofileimage", "set");
this.panelUIAvatar.style.listStyleImage = "url('" + profile.avatar + "')";
img.onerror = () => {
// Clear the image if it has trouble loading. Since this callback is asynchronous
// we check to make sure the image is still the same before we clear it.
if (this.panelUIAvatar.style.listStyleImage === bgImage) {
this.panelUIFooter.removeAttribute("fxaprofileimage");
this.panelUIAvatar.style.removeProperty("list-style-image");
}
};
img.src = profile.avatar;
}

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

@ -334,13 +334,14 @@ var PlacesCommandHook = {
var title;
var description;
var charset;
let docInfo = yield this._getPageDetails(aBrowser);
try {
let isErrorPage = /^about:(neterror|certerror|blocked)/
.test(aBrowser.contentDocumentAsCPOW.documentURI);
title = isErrorPage ? PlacesUtils.history.getPageTitle(uri)
: aBrowser.contentTitle;
title = docInfo.isErrorPage ? PlacesUtils.history.getPageTitle(uri)
: aBrowser.contentTitle;
title = title || uri.spec;
description = PlacesUIUtils.getDescriptionFromDocument(aBrowser.contentDocumentAsCPOW);
description = docInfo.description;
charset = aBrowser.characterSet;
}
catch (e) { }
@ -405,14 +406,15 @@ var PlacesCommandHook = {
// Bug 1148838 - Make this code work for full page plugins.
let description = null;
let charset = null;
let docInfo = yield this._getPageDetails(aBrowser);
try {
let isErrorPage = /^about:(neterror|certerror|blocked)/
.test(aBrowser.contentDocumentAsCPOW.documentURI);
info.title = isErrorPage ?
info.title = docInfo.isErrorPage ?
(yield PlacesUtils.promisePlaceInfo(aBrowser.currentURI)).title :
aBrowser.contentTitle;
info.title = info.title || url.href;
description = PlacesUIUtils.getDescriptionFromDocument(aBrowser.contentDocumentAsCPOW);
description = docInfo.description;
charset = aBrowser.characterSet;
}
catch (e) {
@ -467,6 +469,18 @@ var PlacesCommandHook = {
}
}),
_getPageDetails(browser) {
return new Promise(resolve => {
let mm = browser.messageManager;
mm.addMessageListener("Bookmarks:GetPageDetails:Result", function listener(msg) {
mm.removeMessageListener("Bookmarks:GetPageDetails:Result", listener);
resolve(msg.data);
});
mm.sendAsyncMessage("Bookmarks:GetPageDetails", { })
});
},
/**
* Adds a bookmark to the page loaded in the current tab.
*/
@ -568,21 +582,18 @@ var PlacesCommandHook = {
* @subtitle subtitle
* A short description of the feed. Optional.
*/
addLiveBookmark: function PCH_addLiveBookmark(url, feedTitle, feedSubtitle) {
var feedURI = makeURI(url);
var doc = gBrowser.contentDocumentAsCPOW;
var title = (arguments.length > 1) ? feedTitle : doc.title;
var description;
if (arguments.length > 2)
description = feedSubtitle;
else
description = PlacesUIUtils.getDescriptionFromDocument(doc);
var toolbarIP = new InsertionPoint(PlacesUtils.toolbarFolderId,
addLiveBookmark: Task.async(function *(url, feedTitle, feedSubtitle) {
let toolbarIP = new InsertionPoint(PlacesUtils.toolbarFolderId,
PlacesUtils.bookmarks.DEFAULT_INDEX,
Components.interfaces.nsITreeView.DROP_ON);
let feedURI = makeURI(url);
let title = feedTitle || gBrowser.contentTitle;
let description = feedSubtitle;
if (!description) {
description = (yield this._getPageDetails(gBrowser.selectedBrowser)).description;
}
PlacesUIUtils.showBookmarkDialog({ action: "add"
, type: "livemark"
, feedURI: feedURI
@ -594,7 +605,7 @@ var PlacesCommandHook = {
, "siteLocation"
, "description" ]
}, window);
},
}),
/**
* Opens the Places Organizer.

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

@ -753,6 +753,14 @@ addMessageListener("ContextMenu:SearchFieldBookmarkData", (message) => {
{ spec, title, description, postData, charset });
});
addMessageListener("Bookmarks:GetPageDetails", (message) => {
let doc = content.document;
let isErrorPage = /^about:(neterror|certerror|blocked)/.test(doc.documentURI);
sendAsyncMessage("Bookmarks:GetPageDetails:Result",
{ isErrorPage: isErrorPage,
description: PlacesUIUtils.getDescriptionFromDocument(doc) });
});
var LightWeightThemeWebInstallListener = {
_previewWindow: null,

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

@ -122,6 +122,12 @@ input[type=button] {
pointer-events: none;
}
/*
* If you change the sizes here, make sure you
* change the preferences:
* toolkit.pageThumbs.minWidth
* toolkit.pageThumbs.minHeight
*/
/* CELLS */
.newtab-cell,
.newtab-intro-cell,

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

@ -19,30 +19,19 @@ var tests = [
'https://untrusted.example.com/somepage.html']
];
function generatorTest() {
add_task(function* () {
gBrowser.selectedTab = gBrowser.addTab();
let browser = gBrowser.selectedBrowser;
browser.stop(); // stop the about:blank load.
browser.addEventListener("DOMContentLoaded", event => {
if (event.originalTarget != browser.contentDocument ||
event.target.location.href == "about:blank") {
info("skipping spurious load event");
return;
}
nextStep();
}, true);
registerCleanupFunction(function () {
browser.removeEventListener("DOMContentLoaded", nextStep, true);
gBrowser.removeCurrentTab();
});
// Test that a bookmark of each URI gets the corresponding default title.
for (let i = 0; i < tests.length; ++i) {
let [uri, title] = tests[i];
let promiseLoaded = promisePageLoaded(browser);
content.location = uri;
yield undefined;
checkBookmark(uri, title);
yield promiseLoaded;
yield checkBookmark(uri, title);
}
// Network failure test: now that dummy_page.html is in history, bookmarking
@ -62,20 +51,28 @@ function generatorTest() {
Services.cache2.clear();
let [uri, title] = tests[0];
let promiseLoaded = promisePageLoaded(browser);
content.location = uri;
yield undefined;
yield promiseLoaded;
// The offline mode test is only good if the page failed to load.
is(content.document.documentURI.substring(0, 14), 'about:neterror',
"Offline mode successfully simulated network outage.");
checkBookmark(uri, title);
}
yield checkBookmark(uri, title);
gBrowser.removeCurrentTab();
});
// Bookmark the current page and confirm that the new bookmark has the expected
// title. (Then delete the bookmark.)
function checkBookmark(uri, expected_title) {
function* checkBookmark(uri, expected_title) {
is(gBrowser.selectedBrowser.currentURI.spec, uri,
"Trying to bookmark the expected uri");
let promiseBookmark = promiseOnBookmarkItemAdded(gBrowser.selectedBrowser.currentURI);
PlacesCommandHook.bookmarkCurrentPage(false);
yield promiseBookmark;
let id = PlacesUtils.getMostRecentBookmarkForURI(PlacesUtils._uri(uri));
ok(id > 0, "Found the expected bookmark");
@ -84,3 +81,21 @@ function checkBookmark(uri, expected_title) {
PlacesUtils.bookmarks.removeItem(id);
}
// BrowserTestUtils.browserLoaded doesn't work for the about pages, so use a
// custom page load listener.
function promisePageLoaded(browser)
{
return new Promise(resolve => {
browser.addEventListener("DOMContentLoaded", function pageLoaded(event) {
browser.removeEventListener("DOMContentLoaded", pageLoaded, true);
if (event.originalTarget != browser.contentDocument ||
event.target.location.href == "about:blank") {
info("skipping spurious load event");
return;
}
resolve();
}, true);
});
}

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

@ -24,7 +24,7 @@ add_task(function* test_star_redirect() {
yield promiseStarState(BookmarkingUI.STATUS_UNSTARRED);
let promiseBookmark = promiseOnItemAdded(gBrowser.currentURI);
let promiseBookmark = promiseOnBookmarkItemAdded(gBrowser.currentURI);
BookmarkingUI.star.click();
// This resolves on the next tick, so the star should have already been
// updated at that point.
@ -83,32 +83,3 @@ function promiseTabLoadEvent(aTab, aURL, aFinalURL)
aTab.linkedBrowser.loadURI(aURL);
return deferred.promise;
}
/**
* Waits for a bookmark to be added for the given uri.
*/
function promiseOnItemAdded(aExpectedURI) {
let defer = Promise.defer();
let bookmarksObserver = {
onItemAdded: function (aItemId, aFolderId, aIndex, aItemType, aURI) {
info("Added a bookmark to " + aURI.spec);
PlacesUtils.bookmarks.removeObserver(bookmarksObserver);
if (aURI.equals(aExpectedURI))
defer.resolve();
else
defer.reject(new Error("Added an unexpected bookmark"));
},
onBeginUpdateBatch: function () {},
onEndUpdateBatch: function () {},
onItemRemoved: function () {},
onItemChanged: function () {},
onItemVisited: function () {},
onItemMoved: function () {},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsINavBookmarkObserver,
])
};
info("Waiting for a bookmark to be added");
PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
return defer.promise;
}

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

@ -1072,3 +1072,34 @@ function isSecurityState(expectedState) {
is(expectedState, actualState, "Expected state " + expectedState + " and the actual state is " + actualState + ".");
}
/**
* Resolves when a bookmark with the given uri is added.
*/
function promiseOnBookmarkItemAdded(aExpectedURI) {
return new Promise((resolve, reject) => {
let bookmarksObserver = {
onItemAdded: function (aItemId, aFolderId, aIndex, aItemType, aURI) {
info("Added a bookmark to " + aURI.spec);
PlacesUtils.bookmarks.removeObserver(bookmarksObserver);
if (aURI.equals(aExpectedURI)) {
resolve();
}
else {
reject(new Error("Added an unexpected bookmark"));
}
},
onBeginUpdateBatch: function () {},
onEndUpdateBatch: function () {},
onItemRemoved: function () {},
onItemChanged: function () {},
onItemVisited: function () {},
onItemMoved: function () {},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsINavBookmarkObserver,
])
};
info("Waiting for a bookmark to be added");
PlacesUtils.bookmarks.addObserver(bookmarksObserver, false);
});
}

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

@ -2255,7 +2255,7 @@ var CustomizableUIInternal = {
}
delete widget.implementation.currentArea;
widget.implementation.__defineGetter__("currentArea", function() widget.currentArea);
widget.implementation.__defineGetter__("currentArea", () => widget.currentArea);
const kReqStringProps = ["id"];
for (let prop of kReqStringProps) {
@ -2737,79 +2737,79 @@ this.CustomizableUI = {
/**
* Constant reference to the ID of the menu panel.
*/
get AREA_PANEL() "PanelUI-contents",
AREA_PANEL: "PanelUI-contents",
/**
* Constant reference to the ID of the navigation toolbar.
*/
get AREA_NAVBAR() "nav-bar",
AREA_NAVBAR: "nav-bar",
/**
* Constant reference to the ID of the menubar's toolbar.
*/
get AREA_MENUBAR() "toolbar-menubar",
AREA_MENUBAR: "toolbar-menubar",
/**
* Constant reference to the ID of the tabstrip toolbar.
*/
get AREA_TABSTRIP() "TabsToolbar",
AREA_TABSTRIP: "TabsToolbar",
/**
* Constant reference to the ID of the bookmarks toolbar.
*/
get AREA_BOOKMARKS() "PersonalToolbar",
AREA_BOOKMARKS: "PersonalToolbar",
/**
* Constant reference to the ID of the addon-bar toolbar shim.
* Do not use, this will be removed as soon as reasonably possible.
* @deprecated
*/
get AREA_ADDONBAR() "addon-bar",
AREA_ADDONBAR: "addon-bar",
/**
* Constant indicating the area is a menu panel.
*/
get TYPE_MENU_PANEL() "menu-panel",
TYPE_MENU_PANEL: "menu-panel",
/**
* Constant indicating the area is a toolbar.
*/
get TYPE_TOOLBAR() "toolbar",
TYPE_TOOLBAR: "toolbar",
/**
* Constant indicating a XUL-type provider.
*/
get PROVIDER_XUL() "xul",
PROVIDER_XUL: "xul",
/**
* Constant indicating an API-type provider.
*/
get PROVIDER_API() "api",
PROVIDER_API: "api",
/**
* Constant indicating dynamic (special) widgets: spring, spacer, and separator.
*/
get PROVIDER_SPECIAL() "special",
PROVIDER_SPECIAL: "special",
/**
* Constant indicating the widget is built-in
*/
get SOURCE_BUILTIN() "builtin",
SOURCE_BUILTIN: "builtin",
/**
* Constant indicating the widget is externally provided
* (e.g. by add-ons or other items not part of the builtin widget set).
*/
get SOURCE_EXTERNAL() "external",
SOURCE_EXTERNAL: "external",
/**
* The class used to distinguish items that span the entire menu panel.
*/
get WIDE_PANEL_CLASS() "panel-wide-item",
WIDE_PANEL_CLASS: "panel-wide-item",
/**
* The (constant) number of columns in the menu panel.
*/
get PANEL_COLUMN_COUNT() 3,
PANEL_COLUMN_COUNT: 3,
/**
* Constant indicating the reason the event was fired was a window closing
*/
get REASON_WINDOW_CLOSED() "window-closed",
REASON_WINDOW_CLOSED: "window-closed",
/**
* Constant indicating the reason the event was fired was an area being
* unregistered separately from window closing mechanics.
*/
get REASON_AREA_UNREGISTERED() "area-unregistered",
REASON_AREA_UNREGISTERED: "area-unregistered",
/**
@ -3677,10 +3677,10 @@ function WidgetGroupWrapper(aWidget) {
"showInPrivateBrowsing", "viewId"];
for (let prop of kBareProps) {
let propertyName = prop;
this.__defineGetter__(propertyName, function() aWidget[propertyName]);
this.__defineGetter__(propertyName, () => aWidget[propertyName]);
}
this.__defineGetter__("provider", function() CustomizableUI.PROVIDER_API);
this.__defineGetter__("provider", () => CustomizableUI.PROVIDER_API);
this.__defineSetter__("disabled", function(aValue) {
aValue = !!aValue;
@ -3757,10 +3757,10 @@ function WidgetSingleWrapper(aWidget, aNode) {
// Look at the node for these, instead of the widget data, to ensure the
// wrapper always reflects this live instance.
this.__defineGetter__(propertyName,
function() aNode.getAttribute(propertyName));
() => aNode.getAttribute(propertyName));
}
this.__defineGetter__("disabled", function() aNode.disabled);
this.__defineGetter__("disabled", () => aNode.disabled);
this.__defineSetter__("disabled", function(aValue) {
aNode.disabled = !!aValue;
});

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

@ -97,9 +97,9 @@ var PanelWideWidgetTracker = {
// we want to start with the last widgets. Otherwise we move widgets over other wide
// widgets, which might mess up their order. Likewise, if moving backwards we should start with
// the first widget and work our way down/right from there.
let compareFn = aMoveForwards ? (function(a, b) a < b) : (function(a, b) a > b)
widgetsAffected.sort(function(a, b) compareFn(gPanelPlacements.indexOf(a),
gPanelPlacements.indexOf(b)));
let compareFn = aMoveForwards ? ((a, b) => a < b) : ((a, b) => a > b);
widgetsAffected.sort((a, b) => compareFn(gPanelPlacements.indexOf(a),
gPanelPlacements.indexOf(b)));
for (let widget of widgetsAffected) {
this.adjustPosition(widget, aMoveForwards);
}

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

@ -17,7 +17,9 @@ XPCOMUtils.defineLazyModuleGetter(this, "ShortcutUtils",
const PanelUI = {
/** Panel events that we listen for. **/
get kEvents() ["popupshowing", "popupshown", "popuphiding", "popuphidden"],
get kEvents() {
return ["popupshowing", "popupshown", "popuphiding", "popuphidden"];
},
/**
* Used for lazily getting and memoizing elements from the document. Lazy
* getters are set in init, and memoizing happens after the first retrieval.

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

@ -288,7 +288,9 @@
toolbar: this,
contextMenu: null,
get active () !!this.contextMenu,
get active () {
return !!this.contextMenu;
},
init: function (event) {
let node = event.target;

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

@ -8,19 +8,19 @@ registerCleanupFunction(removeCustomToolbars);
// Sanity checks
add_task(function sanityChecks() {
SimpleTest.doesThrow(function() CustomizableUI.registerArea("@foo"),
SimpleTest.doesThrow(() => CustomizableUI.registerArea("@foo"),
"Registering areas with an invalid ID should throw.");
SimpleTest.doesThrow(function() CustomizableUI.registerArea([]),
SimpleTest.doesThrow(() => CustomizableUI.registerArea([]),
"Registering areas with an invalid ID should throw.");
SimpleTest.doesThrow(function() CustomizableUI.unregisterArea("@foo"),
SimpleTest.doesThrow(() => CustomizableUI.unregisterArea("@foo"),
"Unregistering areas with an invalid ID should throw.");
SimpleTest.doesThrow(function() CustomizableUI.unregisterArea([]),
SimpleTest.doesThrow(() => CustomizableUI.unregisterArea([]),
"Unregistering areas with an invalid ID should throw.");
SimpleTest.doesThrow(function() CustomizableUI.unregisterArea("unknown"),
SimpleTest.doesThrow(() => CustomizableUI.unregisterArea("unknown"),
"Unregistering an area that's not registered should throw.");
});

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

@ -82,7 +82,7 @@ add_task(function() {
yield shownPanelPromise;
let chevron = document.getElementById("nav-bar-overflow-button");
yield waitForCondition(function() chevron.open);
yield waitForCondition(() => chevron.open);
yield waitForSearchBarFocus();
@ -116,7 +116,7 @@ add_task(function() {
openUILinkInCalled = false;
sendWebSearchKeyCommand();
yield waitForCondition(function() openUILinkInCalled);
yield waitForCondition(() => openUILinkInCalled);
ok(openUILinkInCalled, "The search page should have been opened.")
expectOpenUILinkInCall = false;
} catch (e) {

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

@ -15,7 +15,7 @@ add_task(function() {
simulateItemDrag(devButton, downloadsButton);
simulateItemDrag(searchBox, palette);
gCustomizeMode.reset();
yield waitForCondition(function() !gCustomizeMode.resetting);
yield waitForCondition(() => !gCustomizeMode.resetting);
ok(CustomizableUI.inDefaultState, "Should be back in default state");
yield endCustomizing();
});

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

@ -36,7 +36,7 @@ add_task(function() {
yield startCustomizing();
gCustomizeMode.reset();
yield waitForCondition(function() !gCustomizeMode.resetting);
yield waitForCondition(() => !gCustomizeMode.resetting);
yield endCustomizing();
is(bookmarksToolbar.collapsed, true, "Customization reset should restore collapsed-state to the bookmarks toolbar");
@ -60,7 +60,7 @@ add_task(function() {
yield startCustomizing();
gCustomizeMode.reset();
yield waitForCondition(function() !gCustomizeMode.resetting);
yield waitForCondition(() => !gCustomizeMode.resetting);
is(menubar.getAttribute("autohide"), "true", "The menubar should have autohide=true after reset in customization mode");
is(menubar.getBoundingClientRect().height, 0, "The menubar should have height=0 after reset in customization mode");
@ -88,7 +88,7 @@ add_task(function() {
ok(!tabsToolbar.collapsed, "TabsToolbar should not be collapsed");
gCustomizeMode.reset();
yield waitForCondition(function() !gCustomizeMode.resetting);
yield waitForCondition(() => !gCustomizeMode.resetting);
ok(bookmarksToolbar.collapsed, "The bookmarksToolbar should be collapsed after reset");
ok(!tabsToolbar.collapsed, "TabsToolbar should not be collapsed");

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

@ -18,8 +18,8 @@ add_task(function() {
addonsButton.click();
newTab = gBrowser.selectedTab;
yield waitForCondition(function() gBrowser.currentURI &&
gBrowser.currentURI.spec == "about:addons");
yield waitForCondition(() => gBrowser.currentURI &&
gBrowser.currentURI.spec == "about:addons");
let addonsPage = gBrowser.selectedBrowser.contentWindow.document.
getElementById("addons-page");

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

@ -13,7 +13,7 @@ registerCleanupFunction(removeCustomToolbars);
// Sanity checks
add_task(function() {
let brokenSpec = {id: kWidgetId + (widgetCounter++), removable: false};
SimpleTest.doesThrow(function() CustomizableUI.createWidget(brokenSpec),
SimpleTest.doesThrow(() => CustomizableUI.createWidget(brokenSpec),
"Creating non-removable widget without defaultArea should throw.");
// Widget without removable set should be removable:

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

@ -33,7 +33,7 @@ add_task(function() {
yield PanelUI.show();
yield waitForCondition(function() !feedButton.hasAttribute("disabled"));
yield waitForCondition(() => !feedButton.hasAttribute("disabled"));
ok(!feedButton.hasAttribute("disabled"), "The Subscribe button gets enabled");
feedButton.click();

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

@ -20,7 +20,7 @@ add_task(function() {
is(undoResetButton.hidden, false, "The undo button is visible after reset");
undoResetButton.click();
yield waitForCondition(function() !gCustomizeMode.resetting);
yield waitForCondition(() => !gCustomizeMode.resetting);
ok(!CustomizableUI.inDefaultState, "Not in default state after reset-undo");
is(undoResetButton.hidden, true, "The undo button is hidden after clicking on the undo button");
is(CustomizableUI.getPlacementOfWidget(homeButtonId), null, "Home button is in palette");

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

@ -48,7 +48,7 @@ add_task(function* asyncCleanup() {
function mockFunctions() {
// mock needsSetup
gSyncUI._needsSetup = function() Promise.resolve(false);
gSyncUI._needsSetup = () => Promise.resolve(false);
// mock service.errorHandler.syncAndReportErrors()
service.errorHandler.syncAndReportErrors = mocked_syncAndReportErrors;

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

@ -374,7 +374,7 @@ function waitForCondition(aConditionFn, aMaxTries=50, aCheckInterval=100) {
function waitFor(aTimeout=100) {
let deferred = Promise.defer();
setTimeout(function() deferred.resolve(), aTimeout);
setTimeout(() => deferred.resolve(), aTimeout);
return deferred.promise;
}

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

@ -54,7 +54,7 @@ DistributionCustomizer.prototype = {
// Unable to parse INI.
Cu.reportError("Unable to parse distribution.ini");
}
this.__defineGetter__("_ini", function() ini);
this.__defineGetter__("_ini", () => ini);
return this._ini;
},
@ -66,27 +66,27 @@ DistributionCustomizer.prototype = {
catch (e) {
locale = "en-US";
}
this.__defineGetter__("_locale", function() locale);
this.__defineGetter__("_locale", () => locale);
return this._locale;
},
get _prefSvc() {
let svc = Cc["@mozilla.org/preferences-service;1"].
getService(Ci.nsIPrefService);
this.__defineGetter__("_prefSvc", function() svc);
this.__defineGetter__("_prefSvc", () => svc);
return this._prefSvc;
},
get _prefs() {
let branch = this._prefSvc.getBranch(null);
this.__defineGetter__("_prefs", function() branch);
this.__defineGetter__("_prefs", () => branch);
return this._prefs;
},
get _ioSvc() {
let svc = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService);
this.__defineGetter__("_ioSvc", function() svc);
this.__defineGetter__("_ioSvc", () => svc);
return this._ioSvc;
},

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

@ -660,7 +660,9 @@ DownloadsDataCtor.prototype = {
* Iterator for all the available Download objects. This is empty until the
* data has been loaded using the JavaScript API for downloads.
*/
get downloads() this.oldDownloadStates.keys(),
get downloads() {
return this.oldDownloadStates.keys();
},
/**
* True if there are finished downloads that can be removed from the list.

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

@ -151,7 +151,9 @@ this.DownloadsViewUI.DownloadElementShell.prototype = {
* returned by a single property because they are computed together. The
* result may be overridden by derived objects.
*/
get statusTextAndTip() this.rawStatusTextAndTip,
get statusTextAndTip() {
return this.rawStatusTextAndTip;
},
/**
* Derived objects may call this to get the status text.

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

@ -220,16 +220,22 @@ HistoryDownloadElementShell.prototype = {
this._updateUI();
}
},
get active() !!this._active,
get active() {
return !!this._active;
},
/**
* Overrides the base getter to return the Download or HistoryDownload object
* for displaying information and executing commands in the user interface.
*/
get download() this._sessionDownload || this._historyDownload,
get download() {
return this._sessionDownload || this._historyDownload;
},
_sessionDownload: null,
get sessionDownload() this._sessionDownload,
get sessionDownload() {
return this._sessionDownload;
},
set sessionDownload(aValue) {
if (this._sessionDownload != aValue) {
if (!aValue && !this._historyDownload) {
@ -245,7 +251,9 @@ HistoryDownloadElementShell.prototype = {
},
_historyDownload: null,
get historyDownload() this._historyDownload,
get historyDownload() {
return this._historyDownload;
},
set historyDownload(aValue) {
if (this._historyDownload != aValue) {
if (!aValue && !this._sessionDownload) {
@ -550,9 +558,13 @@ function DownloadsPlacesView(aRichListBox, aActive = true) {
}
DownloadsPlacesView.prototype = {
get associatedElement() this._richlistbox,
get associatedElement() {
return this._richlistbox;
},
get active() this._active,
get active() {
return this._active;
},
set active(val) {
this._active = val;
if (this._active)
@ -930,7 +942,9 @@ DownloadsPlacesView.prototype = {
},
_place: "",
get place() this._place,
get place() {
return this._place;
},
set place(val) {
// Don't reload everything if we don't have to.
if (this._place == val) {
@ -955,7 +969,9 @@ DownloadsPlacesView.prototype = {
},
_result: null,
get result() this._result,
get result() {
return this._result;
},
set result(val) {
if (this._result == val) {
return val;
@ -990,7 +1006,9 @@ DownloadsPlacesView.prototype = {
return selectedNodes.length == 1 ? selectedNodes[0] : null;
},
get hasSelection() this.selectedNodes.length > 0,
get hasSelection() {
return this.selectedNodes.length > 0;
},
containerStateChanged(aNode, aOldState, aNewState) {
this.invalidateContainer(aNode)
@ -1085,9 +1103,13 @@ DownloadsPlacesView.prototype = {
nodeURIChanged() {},
batching() {},
get controller() this._richlistbox.controller,
get controller() {
return this._richlistbox.controller;
},
get searchTerm() this._searchTerm,
get searchTerm() {
return this._searchTerm;
},
set searchTerm(aValue) {
if (this._searchTerm != aValue) {
for (let element of this._richlistbox.childNodes) {

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

@ -98,22 +98,33 @@ const DownloadsPanel = {
_state: 0,
/** The panel is not linked to downloads data yet. */
get kStateUninitialized() 0,
get kStateUninitialized() {
return 0;
},
/** This object is linked to data, but the panel is invisible. */
get kStateHidden() 1,
get kStateHidden() {
return 1;
},
/** The panel will be shown as soon as possible. */
get kStateWaitingData() 2,
get kStateWaitingData() {
return 2;
},
/** The panel is almost shown - we're just waiting to get a handle on the
anchor. */
get kStateWaitingAnchor() 3,
get kStateWaitingAnchor() {
return 3;
},
/** The panel is open. */
get kStateShown() 4,
get kStateShown() {
return 4;
},
/**
* Location of the panel overlay.
*/
get kDownloadsOverlay()
"chrome://browser/content/downloads/downloadsOverlay.xul",
get kDownloadsOverlay() {
return "chrome://browser/content/downloads/downloadsOverlay.xul";
},
/**
* Starts loading the download data in background, without opening the panel.
@ -1329,7 +1340,9 @@ const DownloadsSummary = {
/**
* Returns the active state of the downloads summary.
*/
get active() this._active,
get active() {
return this._active;
},
_active: false,

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

@ -40,8 +40,9 @@ const DownloadsButton = {
/**
* Location of the indicator overlay.
*/
get kIndicatorOverlay()
"chrome://browser/content/downloads/indicatorOverlay.xul",
get kIndicatorOverlay() {
return "chrome://browser/content/downloads/indicatorOverlay.xul";
},
/**
* Returns a reference to the downloads button position placeholder, or null

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

@ -10,8 +10,7 @@ add_task(function* test_simple() {
add_task(function* test_background() {
let extension = ExtensionTestUtils.loadExtension("background");
info("load complete");
yield extension.startup();
let x = yield extension.awaitMessage("running");
let [, x] = yield Promise.all([extension.startup(), extension.awaitMessage("running")]);
is(x, 1, "got correct value from extension");
info("startup complete");
extension.sendMessage(10, 20);

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

@ -30,8 +30,7 @@ add_task(function* () {
},
});
yield extension.startup();
yield extension.awaitMessage("check");
yield Promise.all([extension.startup(), extension.awaitMessage("check")]);
ok(gBrowser.selectedTab == tab2, "correct tab selected");

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

@ -40,12 +40,11 @@ add_task(function* () {
},
});
yield extension.startup();
yield extension.awaitMessage("check");
yield Promise.all([extension.startup(), extension.awaitMessage("check")]);
yield promiseWaitForFocus(window1);
yield extension.unload();
yield BrowserTestUtils.closeWindow(window2);
});
});

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

@ -424,7 +424,8 @@ FeedResultService.prototype = {
Cc["@mozilla.org/appshell/window-mediator;1"].
getService(Ci.nsIWindowMediator);
var topWindow = wm.getMostRecentWindow("navigator:browser");
topWindow.PlacesCommandHook.addLiveBookmark(spec, title, subtitle);
topWindow.PlacesCommandHook.addLiveBookmark(spec, title, subtitle)
.catch(Components.utils.reportError);
break;
}
},

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

@ -78,8 +78,7 @@ function parseINIStrings(file) {
function getHash(aStr) {
// return the two-digit hexadecimal code for a byte
function toHexString(charCode)
("0" + charCode.toString(16)).slice(-2);
let toHexString = charCode => ("0" + charCode.toString(16)).slice(-2);
let hasher = Cc["@mozilla.org/security/hash;1"].
createInstance(Ci.nsICryptoHash);

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

@ -245,7 +245,7 @@ FirefoxProfileMigrator.prototype._getResourcesInternal = function(sourceProfileD
};
Object.defineProperty(FirefoxProfileMigrator.prototype, "startupOnlyMigrator", {
get: function() true
get: () => true
});

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

@ -44,7 +44,9 @@ function History() {
History.prototype = {
type: MigrationUtils.resourceTypes.HISTORY,
get exists() true,
get exists() {
return true;
},
migrate: function H_migrate(aCallback) {
let places = [];
@ -347,11 +349,13 @@ function Settings() {
Settings.prototype = {
type: MigrationUtils.resourceTypes.SETTINGS,
get exists() true,
get exists() {
return true;
},
migrate: function S_migrate(aCallback) {
// Converts from yes/no to a boolean.
function yesNoToBoolean(v) v == "yes";
let yesNoToBoolean = v => v == "yes";
// Converts source format like "en-us,ar-kw;q=0.7,ar-om;q=0.3" into
// destination format like "en-us, ar-kw, ar-om".
@ -363,7 +367,7 @@ Settings.prototype = {
let qB = parseFloat(b.split(";q=")[1]) || 1.0;
return qA < qB ? 1 : qA == qB ? 0 : -1;
})
.map(function(a) a.split(";")[0]);
.map(a => a.split(";")[0]);
}
// For reference on some of the available IE Registry settings:
@ -395,7 +399,7 @@ Settings.prototype = {
this._set(kMainKey,
"Display Inline Images",
"permissions.default.image",
function (v) yesNoToBoolean(v) ? 1 : 2);
v => yesNoToBoolean(v) ? 1 : 2);
this._set(kMainKey,
"Move System Caret",
"accessibility.browsewithcaret",
@ -403,11 +407,11 @@ Settings.prototype = {
this._set("Software\\Microsoft\\Internet Explorer\\Settings",
"Always Use My Colors",
"browser.display.document_color_use",
function (v) !Boolean(v) ? 0 : 2);
v => !Boolean(v) ? 0 : 2);
this._set("Software\\Microsoft\\Internet Explorer\\Settings",
"Always Use My Font Face",
"browser.display.use_document_fonts",
function (v) !Boolean(v));
v => !Boolean(v));
this._set(kMainKey,
"SmoothScroll",
"general.smoothScroll",
@ -419,7 +423,7 @@ Settings.prototype = {
this._set("Software\\Microsoft\\Internet Explorer\\TabbedBrowsing\\",
"OpenInForeground",
"browser.tabs.loadInBackground",
function (v) !Boolean(v));
v => !Boolean(v));
aCallback(true);
},

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

@ -325,9 +325,13 @@ function Bookmarks(migrationType) {
Bookmarks.prototype = {
type: MigrationUtils.resourceTypes.BOOKMARKS,
get exists() !!this._favoritesFolder,
get exists() {
return !!this._favoritesFolder;
},
get importedAppLabel() this._migrationType == MSMigrationUtils.MIGRATION_TYPE_IE ? "IE" : "Edge",
get importedAppLabel() {
return this._migrationType == MSMigrationUtils.MIGRATION_TYPE_IE ? "IE" : "Edge";
},
__favoritesFolder: null,
get _favoritesFolder() {

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

@ -98,7 +98,9 @@ this.MigratorPrototype = {
* For a single-profile source (e.g. safari, ie), this returns null,
* and not an empty array. That is the default implementation.
*/
get sourceProfiles() null,
get sourceProfiles() {
return null;
},
/**
* MUST BE OVERRIDDEN.
@ -159,19 +161,25 @@ this.MigratorPrototype = {
* The migrator can call MigrationUtils.profileStartup.doStartup
* at any point in order to initialize the profile.
*/
get startupOnlyMigrator() false,
get startupOnlyMigrator() {
return false;
},
/**
* OVERRIDE IF AND ONLY IF your migrator supports importing the homepage.
* @see nsIBrowserProfileMigrator
*/
get sourceHomePageURL() "",
get sourceHomePageURL() {
return "";
},
/**
* Override if the data to migrate is locked/in-use and the user should
* probably shutdown the source browser.
*/
get sourceLocked() false,
get sourceLocked() {
return false;
},
/**
* DO NOT OVERRIDE - After deCOMing migration, the UI will just call
@ -181,7 +189,7 @@ this.MigratorPrototype = {
*/
getMigrateData: function MP_getMigrateData(aProfile) {
let types = [r.type for each (r in this._getMaybeCachedResources(aProfile))];
return types.reduce(function(a, b) a |= b, 0);
return types.reduce((a, b) => a |= b, 0);
},
/**
@ -266,7 +274,7 @@ this.MigratorPrototype = {
// (=startupOnlyMigrator), as it just copies over the places database
// from another profile.
const BOOKMARKS = MigrationUtils.resourceTypes.BOOKMARKS;
let migratingBookmarks = resources.some(function(r) r.type == BOOKMARKS);
let migratingBookmarks = resources.some(r => r.type == BOOKMARKS);
if (migratingBookmarks) {
let browserGlue = Cc["@mozilla.org/browser/browserglue;1"].
getService(Ci.nsIObserver);
@ -509,7 +517,7 @@ this.MigrationUtils = Object.freeze({
// so that the wizard defaults to import from that browser.
let defaultBrowserKey = getMigratorKeyForDefaultBrowser();
if (defaultBrowserKey)
migratorKeysOrdered.sort(function (a, b) b == defaultBrowserKey ? 1 : 0);
migratorKeysOrdered.sort((a, b) => b == defaultBrowserKey ? 1 : 0);
for (let migratorKey of migratorKeysOrdered) {
let migrator = this.getMigrator(migratorKey);
@ -519,7 +527,9 @@ this.MigrationUtils = Object.freeze({
},
// Whether or not we're in the process of startup migration
get isStartupMigration() gProfileStartup != null,
get isStartupMigration() {
return gProfileStartup != null;
},
/**
* In the case of startup migration, this is set to the nsIProfileStartup
@ -527,7 +537,9 @@ this.MigrationUtils = Object.freeze({
*
* @see showMigrationWizard
*/
get profileStartup() gProfileStartup,
get profileStartup() {
return gProfileStartup;
},
/**
* Show the migration wizard. On mac, this may just focus the wizard if it's

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

@ -325,7 +325,7 @@ Preferences.prototype = {
this._dict = aDict;
let invert = function(webkitVal) !webkitVal;
let invert = webkitVal => !webkitVal;
this._set("AutoFillPasswords", "signon.rememberSignons");
this._set("OpenNewTabsInFront", "browser.tabs.loadInBackground", invert);
this._set("WebKitJavaScriptCanOpenWindowsAutomatically",
@ -342,7 +342,7 @@ Preferences.prototype = {
// Allowed TRUE 1
// Allowed, originating site only -- 3
this._set("WebKitDisplayImagesKey", "permissions.default.image",
function(webkitVal) webkitVal ? 1 : 2);
webkitVal => webkitVal ? 1 : 2);
#ifdef XP_WIN
// Cookie-accept policy.
@ -353,7 +353,7 @@ Preferences.prototype = {
// Never Accept 1 2
this._set("WebKitCookieStorageAcceptPolicy",
"network.cookie.cookieBehavior",
function(webkitVal) webkitVal == 0 ? 0 : webkitVal == 1 ? 2 : 1);
webkitVal => webkitVal == 0 ? 0 : webkitVal == 1 ? 2 : 1);
#endif
this._migrateFontSettings();

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

@ -832,7 +832,7 @@ nsDefaultCommandLineHandler.prototype = {
}
}
var URLlist = urilist.filter(shouldLoadURI).map(function (u) u.spec);
var URLlist = urilist.filter(shouldLoadURI).map(u => u.spec);
if (URLlist.length) {
openWindow(null, gBrowserContentHandler.chromeURL, "_blank",
"chrome,dialog=no,all" + gBrowserContentHandler.getFeatures(cmdLine),

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

@ -128,11 +128,13 @@ this.PlacesUIUtils = {
return bundle.GetStringFromName(key);
},
get _copyableAnnotations() [
this.DESCRIPTION_ANNO,
this.LOAD_IN_SIDEBAR_ANNO,
PlacesUtils.READ_ONLY_ANNO,
],
get _copyableAnnotations() {
return [
this.DESCRIPTION_ANNO,
this.LOAD_IN_SIDEBAR_ANNO,
PlacesUtils.READ_ONLY_ANNO,
];
},
/**
* Get a transaction for copying a uri item (either a bookmark or a history
@ -1437,68 +1439,68 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() {
PlacesUtils;
return {
aggregateTransactions: function(aName, aTransactions)
aggregateTransactions: (aName, aTransactions) =>
new PlacesAggregatedTransaction(aName, aTransactions),
createFolder: function(aName, aContainer, aIndex, aAnnotations,
aChildItemsTransactions)
createFolder: (aName, aContainer, aIndex, aAnnotations,
aChildItemsTransactions) =>
new PlacesCreateFolderTransaction(aName, aContainer, aIndex, aAnnotations,
aChildItemsTransactions),
createItem: function(aURI, aContainer, aIndex, aTitle, aKeyword,
aAnnotations, aChildTransactions)
createItem: (aURI, aContainer, aIndex, aTitle, aKeyword,
aAnnotations, aChildTransactions) =>
new PlacesCreateBookmarkTransaction(aURI, aContainer, aIndex, aTitle,
aKeyword, aAnnotations,
aChildTransactions),
createSeparator: function(aContainer, aIndex)
createSeparator: (aContainer, aIndex) =>
new PlacesCreateSeparatorTransaction(aContainer, aIndex),
createLivemark: function(aFeedURI, aSiteURI, aName, aContainer, aIndex,
aAnnotations)
createLivemark: (aFeedURI, aSiteURI, aName, aContainer, aIndex,
aAnnotations) =>
new PlacesCreateLivemarkTransaction(aFeedURI, aSiteURI, aName, aContainer,
aIndex, aAnnotations),
moveItem: function(aItemId, aNewContainer, aNewIndex)
moveItem: (aItemId, aNewContainer, aNewIndex) =>
new PlacesMoveItemTransaction(aItemId, aNewContainer, aNewIndex),
removeItem: function(aItemId)
removeItem: (aItemId) =>
new PlacesRemoveItemTransaction(aItemId),
editItemTitle: function(aItemId, aNewTitle)
editItemTitle: (aItemId, aNewTitle) =>
new PlacesEditItemTitleTransaction(aItemId, aNewTitle),
editBookmarkURI: function(aItemId, aNewURI)
editBookmarkURI: (aItemId, aNewURI) =>
new PlacesEditBookmarkURITransaction(aItemId, aNewURI),
setItemAnnotation: function(aItemId, aAnnotationObject)
setItemAnnotation: (aItemId, aAnnotationObject) =>
new PlacesSetItemAnnotationTransaction(aItemId, aAnnotationObject),
setPageAnnotation: function(aURI, aAnnotationObject)
setPageAnnotation: (aURI, aAnnotationObject) =>
new PlacesSetPageAnnotationTransaction(aURI, aAnnotationObject),
editBookmarkKeyword: function(aItemId, aNewKeyword)
editBookmarkKeyword: (aItemId, aNewKeyword) =>
new PlacesEditBookmarkKeywordTransaction(aItemId, aNewKeyword),
editLivemarkSiteURI: function(aLivemarkId, aSiteURI)
editLivemarkSiteURI: (aLivemarkId, aSiteURI) =>
new PlacesEditLivemarkSiteURITransaction(aLivemarkId, aSiteURI),
editLivemarkFeedURI: function(aLivemarkId, aFeedURI)
editLivemarkFeedURI: (aLivemarkId, aFeedURI) =>
new PlacesEditLivemarkFeedURITransaction(aLivemarkId, aFeedURI),
editItemDateAdded: function(aItemId, aNewDateAdded)
editItemDateAdded: (aItemId, aNewDateAdded) =>
new PlacesEditItemDateAddedTransaction(aItemId, aNewDateAdded),
editItemLastModified: function(aItemId, aNewLastModified)
editItemLastModified: (aItemId, aNewLastModified) =>
new PlacesEditItemLastModifiedTransaction(aItemId, aNewLastModified),
sortFolderByName: function(aFolderId)
sortFolderByName: (aFolderId) =>
new PlacesSortFolderByNameTransaction(aFolderId),
tagURI: function(aURI, aTags)
tagURI: (aURI, aTags) =>
new PlacesTagURITransaction(aURI, aTags),
untagURI: function(aURI, aTags)
untagURI: (aURI, aTags) =>
new PlacesUntagURITransaction(aURI, aTags),
/**
@ -1542,49 +1544,53 @@ XPCOMUtils.defineLazyGetter(PlacesUIUtils, "ptm", function() {
////////////////////////////////////////////////////////////////////////////
//// nsITransactionManager forwarders.
beginBatch: function()
beginBatch: () =>
PlacesUtils.transactionManager.beginBatch(null),
endBatch: function()
endBatch: () =>
PlacesUtils.transactionManager.endBatch(false),
doTransaction: function(txn)
doTransaction: (txn) =>
PlacesUtils.transactionManager.doTransaction(txn),
undoTransaction: function()
undoTransaction: () =>
PlacesUtils.transactionManager.undoTransaction(),
redoTransaction: function()
redoTransaction: () =>
PlacesUtils.transactionManager.redoTransaction(),
get numberOfUndoItems()
PlacesUtils.transactionManager.numberOfUndoItems,
get numberOfRedoItems()
PlacesUtils.transactionManager.numberOfRedoItems,
get maxTransactionCount()
PlacesUtils.transactionManager.maxTransactionCount,
set maxTransactionCount(val)
PlacesUtils.transactionManager.maxTransactionCount = val,
get numberOfUndoItems() {
return PlacesUtils.transactionManager.numberOfUndoItems;
},
get numberOfRedoItems() {
return PlacesUtils.transactionManager.numberOfRedoItems;
},
get maxTransactionCount() {
return PlacesUtils.transactionManager.maxTransactionCount;
},
set maxTransactionCount(val) {
PlacesUtils.transactionManager.maxTransactionCount = val;
},
clear: function()
clear: () =>
PlacesUtils.transactionManager.clear(),
peekUndoStack: function()
peekUndoStack: () =>
PlacesUtils.transactionManager.peekUndoStack(),
peekRedoStack: function()
peekRedoStack: () =>
PlacesUtils.transactionManager.peekRedoStack(),
getUndoStack: function()
getUndoStack: () =>
PlacesUtils.transactionManager.getUndoStack(),
getRedoStack: function()
getRedoStack: () =>
PlacesUtils.transactionManager.getRedoStack(),
AddListener: function(aListener)
AddListener: (aListener) =>
PlacesUtils.transactionManager.AddListener(aListener),
RemoveListener: function(aListener)
RemoveListener: (aListener) =>
PlacesUtils.transactionManager.RemoveListener(aListener)
}
});

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

@ -20,6 +20,5 @@ function searchBookmarks(aSearchString) {
}
window.addEventListener("SidebarFocused",
function()
document.getElementById("search-box").focus(),
() => document.getElementById("search-box").focus(),
false);

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

@ -59,7 +59,9 @@ InsertionPoint.prototype = {
return this._index = val;
},
promiseGuid: function () PlacesUtils.promiseItemGuid(this.itemId),
promiseGuid: function () {
return PlacesUtils.promiseItemGuid(this.itemId);
},
get index() {
if (this.dropNearItemId > 0) {
@ -71,7 +73,9 @@ InsertionPoint.prototype = {
return this._index;
},
get isTag() typeof(this.tagName) == "string"
get isTag() {
return typeof(this.tagName) == "string";
}
};
/**
@ -1199,7 +1203,9 @@ PlacesController.prototype = {
},
_cutNodes: [],
get cutNodes() this._cutNodes,
get cutNodes() {
return this._cutNodes;
},
set cutNodes(aNodes) {
let self = this;
function updateCutNodes(aValue) {
@ -1268,7 +1274,7 @@ PlacesController.prototype = {
[ PlacesUtils.TYPE_X_MOZ_PLACE,
PlacesUtils.TYPE_X_MOZ_URL,
PlacesUtils.TYPE_UNICODE,
].forEach(function (type) xferable.addDataFlavor(type));
].forEach(type => xferable.addDataFlavor(type));
this.clipboard.getData(xferable, Ci.nsIClipboard.kGlobalClipboard);
@ -1388,8 +1394,9 @@ PlacesController.prototype = {
* @return true if there's a cached mozILivemarkInfo object for
* aNode, false otherwise.
*/
hasCachedLivemarkInfo: function PC_hasCachedLivemarkInfo(aNode)
this._cachedLivemarkInfoObjects.has(aNode),
hasCachedLivemarkInfo: function PC_hasCachedLivemarkInfo(aNode) {
return this._cachedLivemarkInfoObjects.has(aNode);
},
/**
* Returns the cached livemark info for a node, if set by cacheLivemarkInfo,
@ -1398,8 +1405,9 @@ PlacesController.prototype = {
* a places result node.
* @return the mozILivemarkInfo object for aNode, if set, null otherwise.
*/
getCachedLivemarkInfo: function PC_getCachedLivemarkInfo(aNode)
this._cachedLivemarkInfoObjects.get(aNode, null)
getCachedLivemarkInfo: function PC_getCachedLivemarkInfo(aNode) {
return this._cachedLivemarkInfoObjects.get(aNode, null);
}
};
/**

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

@ -19,7 +19,7 @@
Components.interfaces.nsINavHistoryQueryOptions.SORT_BY_DATE_DESCENDING;
ContentArea.setContentViewForQueryString(DOWNLOADS_QUERY,
function() new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false),
() => new DownloadsPlacesView(document.getElementById("downloadsRichListBox"), false),
{ showDetailsPane: false,
toolbarSet: "back-button, forward-button, organizeButton, clearDownloadsButton, libraryToolbarSpacer, searchFilter" });
]]></script>

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

@ -712,7 +712,7 @@ var gEditItemOverlay = {
this._folderMenuList.selectedItem = item;
// XXXmano HACK: setTimeout 100, otherwise focus goes back to the
// menulist right away
setTimeout(function(self) self.toggleFolderTreeVisibility(), 100, this);
setTimeout(() => this.toggleFolderTreeVisibility(), 100);
return;
}
@ -906,7 +906,7 @@ var gEditItemOverlay = {
let tags = this._element("tagsField").value;
return tags.trim()
.split(/\s*,\s*/) // Split on commas and remove spaces.
.filter(function (tag) tag.length > 0); // Kill empty tags.
.filter(tag => tag.length > 0); // Kill empty tags.
},
newFolder: Task.async(function* () {

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

@ -94,6 +94,5 @@ function searchHistory(aInput)
}
window.addEventListener("SidebarFocused",
function()
gSearchBox.focus(),
() => gSearchBox.focus(),
false);

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

@ -594,7 +594,7 @@ var PlacesOrganizer = {
infoBox.setAttribute("minimal", "true");
infoBox.removeAttribute("wasminimal");
infoBoxExpanderWrapper.hidden =
this._additionalInfoFields.every(function (id)
this._additionalInfoFields.every(id =>
document.getElementById(id).collapsed);
}
additionalInfoBroadcaster.hidden = infoBox.getAttribute("minimal") == "true";
@ -1308,7 +1308,9 @@ var ContentArea = {
options: aOptions || new Object() });
},
get currentView() PlacesUIUtils.getViewForNode(this._deck.selectedPanel),
get currentView() {
return PlacesUIUtils.getViewForNode(this._deck.selectedPanel);
},
set currentView(aNewView) {
let oldView = this.currentView;
if (oldView != aNewView) {
@ -1322,7 +1324,9 @@ var ContentArea = {
return aNewView;
},
get currentPlace() this.currentView.place,
get currentPlace() {
return this.currentView.place;
},
set currentPlace(aQueryString) {
let oldView = this.currentView;
let newView = this.getContentViewForQueryString(aQueryString);
@ -1387,12 +1391,16 @@ var ContentTree = {
this._view = document.getElementById("placeContent");
},
get view() this._view,
get view() {
return this._view;
},
get viewOptions() Object.seal({
showDetailsPane: true,
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
}),
get viewOptions() {
return Object.seal({
showDetailsPane: true,
toolbarSet: "back-button, forward-button, organizeButton, viewMenu, maintenanceButton, libraryToolbarSpacer, searchFilter"
});
},
openSelectedNode: function CT_openSelectedNode(aEvent) {
let view = this.view;

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

@ -21,7 +21,9 @@ function PlacesTreeView(aFlatList, aOnOpenFlatContainer, aController) {
}
PlacesTreeView.prototype = {
get wrappedJSObject() this,
get wrappedJSObject() {
return this;
},
__xulStore: null,
get _xulStore() {
@ -1067,7 +1069,9 @@ PlacesTreeView.prototype = {
}
},
get result() this._result,
get result() {
return this._result;
},
set result(val) {
if (this._result) {
this._result.removeObserver(this);
@ -1112,9 +1116,15 @@ PlacesTreeView.prototype = {
},
// nsITreeView
get rowCount() this._rows.length,
get selection() this._selection,
set selection(val) this._selection = val,
get rowCount() {
return this._rows.length;
},
get selection() {
return this._selection;
},
set selection(val) {
this._selection = val;
},
getRowProperties: function() { return ""; },
@ -1394,7 +1404,9 @@ PlacesTreeView.prototype = {
return false;
},
getLevel: function(aRow) this._getNodeForRow(aRow).indentLevel,
getLevel: function(aRow) {
return this._getNodeForRow(aRow).indentLevel;
},
getImageSrc: function PTV_getImageSrc(aRow, aColumn) {
// Only the title column has an image.

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

@ -149,7 +149,7 @@ function search(aFolderId, aSearchStr, aExpectedScopeButtonId) {
* things off. Add functions to the testCases array, and this will call them.
*/
function onLibraryAvailable() {
testCases.forEach(function (aTest) aTest());
testCases.forEach(aTest => aTest());
gLibrary.close();
gLibrary = null;

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

@ -10,7 +10,9 @@ var gOriginalMigrationVersion;
const BROWSER_URL = getBrowserURL();
var localStore = {
get xulStore() Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore),
get xulStore() {
return Cc["@mozilla.org/xul/xulstore;1"].getService(Ci.nsIXULStore);
},
getValue: function getValue(aProperty)
{

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

@ -15,10 +15,12 @@ function waitForBookmarkNotification(aNotification, aCallback, aProperty)
// nsINavBookmarkObserver
QueryInterface: XPCOMUtils.generateQI([Ci.nsINavBookmarkObserver]),
onBeginUpdateBatch: function onBeginUpdateBatch()
this.validate(arguments.callee.name, arguments),
onEndUpdateBatch: function onEndUpdateBatch()
this.validate(arguments.callee.name, arguments),
onBeginUpdateBatch: function onBeginUpdateBatch() {
return this.validate(arguments.callee.name, arguments);
},
onEndUpdateBatch: function onEndUpdateBatch() {
return this.validate(arguments.callee.name, arguments);
},
onItemAdded: function onItemAdded(aItemId, aParentId, aIndex, aItemType,
aURI, aTitle)
{
@ -28,24 +30,32 @@ function waitForBookmarkNotification(aNotification, aCallback, aProperty)
url: aURI ? aURI.spec : null,
title: aTitle });
},
onItemRemoved: function onItemRemoved()
this.validate(arguments.callee.name, arguments),
onItemRemoved: function onItemRemoved() {
return this.validate(arguments.callee.name, arguments);
},
onItemChanged: function onItemChanged(aItemId, aProperty, aIsAnno,
aNewValue, aLastModified, aItemType)
{
return this.validate(arguments.callee.name,
{ id: aItemId,
get index() PlacesUtils.bookmarks.getItemIndex(this.id),
get index() {
return PlacesUtils.bookmarks.getItemIndex(this.id);
},
type: aItemType,
property: aProperty,
get url() aItemType == PlacesUtils.bookmarks.TYPE_BOOKMARK ?
PlacesUtils.bookmarks.getBookmarkURI(this.id).spec :
null,
get title() PlacesUtils.bookmarks.getItemTitle(this.id),
get url() {
return aItemType == PlacesUtils.bookmarks.TYPE_BOOKMARK ?
PlacesUtils.bookmarks.getBookmarkURI(this.id).spec :
null;
},
get title() {
return PlacesUtils.bookmarks.getItemTitle(this.id);
},
});
},
onItemVisited: function onItemVisited()
this.validate(arguments.callee.name, arguments),
onItemVisited: function onItemVisited() {
return this.validate(arguments.callee.name, arguments);
},
onItemMoved: function onItemMoved(aItemId, aOldParentId, aOldIndex,
aNewParentId, aNewIndex, aItemType)
{

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

@ -16,7 +16,7 @@ XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode",
"resource://gre/modules/ReaderMode.jsm");
var Pocket = {
get site() Services.prefs.getCharPref("browser.pocket.site"),
get site() { return Services.prefs.getCharPref("browser.pocket.site"); },
get listURL() { return "https://" + Pocket.site + "/?src=ff_ext"; },
/**

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

@ -331,8 +331,12 @@ var PermissionDefaults = {
let value = (aValue != this.DENY);
Services.prefs.setBoolPref("dom.push.enabled", value);
},
get camera() this.UNKNOWN,
get microphone() this.UNKNOWN
get camera() {
return this.UNKNOWN;
},
get microphone() {
return this.UNKNOWN;
}
};
/**

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

@ -403,7 +403,7 @@ HandlerInfoWrapper.prototype = {
var disabledPluginTypes = this._getDisabledPluginTypes();
var type = this.type;
disabledPluginTypes = disabledPluginTypes.filter(function(v) v != type);
disabledPluginTypes = disabledPluginTypes.filter(v => v != type);
this._prefSvc.setCharPref(PREF_DISABLED_PLUGIN_TYPES,
disabledPluginTypes.join(","));
@ -1549,7 +1549,7 @@ var gApplicationsPane = {
case Ci.nsIHandlerInfo.useHelperApp:
if (preferredApp)
menu.selectedItem =
possibleAppMenuItems.filter(function(v) v.handlerApp.equals(preferredApp))[0];
possibleAppMenuItems.filter(v => v.handlerApp.equals(preferredApp))[0];
break;
case kActionUsePlugin:
menu.selectedItem = pluginMenuItem;

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

@ -298,7 +298,9 @@ var gMainPane = {
{
let homePage = document.getElementById("browser.startup.homepage");
let tabs = this._getTabsForHomePage();
function getTabURI(t) t.linkedBrowser.currentURI.spec;
function getTabURI(t) {
return t.linkedBrowser.currentURI.spec;
}
// FIXME Bug 244192: using dangerous "|" joiner!
if (tabs.length)

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

@ -179,8 +179,7 @@ var gPrivacyPane = {
initializeHistoryMode: function PPP_initializeHistoryMode()
{
let mode;
let getVal = function (aPref)
document.getElementById(aPref).value;
let getVal = aPref => document.getElementById(aPref).value;
if (this._checkDefaultValues(this.prefsForDefault)) {
if (getVal("browser.privatebrowsing.autostart"))

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

@ -318,7 +318,7 @@ function EngineStore() {
this._defaultEngines = Services.search.getDefaultEngines().map(this._cloneEngine, this);
// check if we need to disable the restore defaults button
var someHidden = this._defaultEngines.some(function (e) e.hidden);
var someHidden = this._defaultEngines.some(e => e.hidden);
gSearchPane.showRestoreDefaults(someHidden);
}
EngineStore.prototype = {

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

@ -406,13 +406,17 @@ var gSyncPane = {
displayNameLabel.textContent = data.displayName;
}
if (data.avatar) {
// Make sure the image is available before displaying it,
// as we don't want to overwrite the default profile image
// with a broken/unavailable image
let bgImage = "url(\"" + data.avatar + "\")";
let profileImageElement = document.getElementById("fxaProfileImage");
profileImageElement.style.listStyleImage = bgImage;
let img = new Image();
img.onload = () => {
let bgImage = "url('" + data.avatar + "')";
document.getElementById("fxaProfileImage").style.listStyleImage = bgImage;
img.onerror = () => {
// Clear the image if it has trouble loading. Since this callback is asynchronous
// we check to make sure the image is still the same before we clear it.
if (profileImageElement.style.listStyleImage === bgImage) {
profileImageElement.style.removeProperty("list-style-image");
}
};
img.src = data.avatar;
}

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

@ -25,9 +25,15 @@ function Tree(aId, aData)
}
Tree.prototype = {
get boxObject() this._tree.treeBoxObject,
get isEmpty() !this._data.length,
get hasSelection() this.selection.count > 0,
get boxObject() {
return this._tree.treeBoxObject;
},
get isEmpty() {
return !this._data.length;
},
get hasSelection() {
return this.selection.count > 0;
},
getSelectedItems: function() {
let result = [];
@ -43,19 +49,35 @@ Tree.prototype = {
},
// nsITreeView implementation
get rowCount() this._data.length,
getCellText: function (aRow, aColumn) this._data[aRow],
isSeparator: function(aIndex) false,
isSorted: function() false,
isContainer: function(aIndex) false,
get rowCount() {
return this._data.length;
},
getCellText: function (aRow, aColumn) {
return this._data[aRow];
},
isSeparator: function(aIndex) {
return false;
},
isSorted: function() {
return false;
},
isContainer: function(aIndex) {
return false;
},
setTree: function(aTree) {},
getImageSrc: function(aRow, aColumn) {},
getProgressMode: function(aRow, aColumn) {},
getCellValue: function(aRow, aColumn) {},
cycleHeader: function(column) {},
getRowProperties: function(row) "",
getColumnProperties: function(column) "",
getCellProperties: function(row, column) "",
getRowProperties: function(row) {
return "";
},
getColumnProperties: function(column) {
return "";
},
getCellProperties: function(row, column) {
return "";
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsITreeView])
};
@ -66,7 +88,9 @@ function Lang(aCode)
}
Lang.prototype = {
toString: function() this._label
toString: function() {
return this._label;
}
}
var gTranslationExceptions = {

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

@ -49,3 +49,4 @@ skip-if = e10s
skip-if = e10s
[browser_privatebrowsing_zoomrestore.js]
skip-if = e10s
[browser_privatebrowsing_newtab_from_popup.js]

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

@ -44,7 +44,7 @@ function setFile(downloadLastDir, aURI, aValue) {
function clearHistoryAndWait() {
clearHistory();
executeSoon(function() executeSoon(moveAlong));
executeSoon(() => executeSoon(moveAlong));
}
/*
@ -73,7 +73,7 @@ function runTest() {
registerCleanupFunction(function () {
Services.prefs.clearUserPref("browser.download.lastDir.savePerSite");
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
win.close();
pbWin.close();
});

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

@ -33,7 +33,7 @@ function test() {
// cleanup functions registration
registerCleanupFunction(function () {
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
MockFilePicker.cleanup();
});
prefs.setComplexValue("lastDir", Ci.nsIFile, tmpDir);

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

@ -28,13 +28,13 @@ function test() {
// cleanup function registration
registerCleanupFunction(function () {
Services.prefs.clearUserPref("browser.download.lastDir");
[dir1, dir2, dir3].forEach(function(dir) dir.remove(true));
[dir1, dir2, dir3].forEach(dir => dir.remove(true));
MockFilePicker.cleanup();
validateFileName = validateFileNameToRestore;
});
// Overwrite validateFileName to validate everything
validateFileName = function(foo) foo;
validateFileName = foo => foo;
let params = {
fileInfo: new FileInfo("test.txt", "test.txt", "test", "txt", "http://mozilla.org/test.txt"),

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

@ -0,0 +1,61 @@
/**
* Tests that a popup window in private browsing window opens
* new tab links in the original private browsing window as
* new tabs.
*
* This is a regression test for bug 1202634.
*/
// We're able to sidestep some quote-escaping issues when
// nesting data URI's by encoding the second data URI in
// base64.
const POPUP_BODY_BASE64 = btoa(`<a href="http://example.com/" target="_blank"
id="second">
Now click this
</a>`);
const POPUP_LINK = `data:text/html;charset=utf-8;base64,${POPUP_BODY_BASE64}`;
const WINDOW_BODY = `data:text/html,
<a href="%23" id="first"
onclick="window.open('${POPUP_LINK}', '_blank',
'width=630,height=500')">
First click this.
</a>`;
add_task(function* test_private_popup_window_opens_private_tabs() {
let privWin = yield BrowserTestUtils.openNewBrowserWindow({ private: true });
// Sanity check - this browser better be private.
ok(PrivateBrowsingUtils.isWindowPrivate(privWin),
"Could not open a private browsing window.");
// First, open a private browsing window, and load our
// testing page.
let privBrowser = privWin.gBrowser.selectedBrowser;
yield BrowserTestUtils.loadURI(privBrowser, WINDOW_BODY);
yield BrowserTestUtils.browserLoaded(privBrowser);
// Next, click on the link in the testing page, and ensure
// that a private popup window is opened.
let openedPromise = BrowserTestUtils.waitForNewWindow();
yield BrowserTestUtils.synthesizeMouseAtCenter("#first", {}, privBrowser);
let popupWin = yield openedPromise;
ok(PrivateBrowsingUtils.isWindowPrivate(popupWin),
"Popup window was not private.");
// Now click on the link in the popup, and ensure that a new
// tab is opened in the original private browsing window.
let newTabPromise = BrowserTestUtils.waitForNewTab(privWin.gBrowser);
let popupBrowser = popupWin.gBrowser.selectedBrowser;
yield BrowserTestUtils.browserLoaded(popupBrowser);
yield BrowserTestUtils.synthesizeMouseAtCenter("#second", {}, popupBrowser);
let newPrivTab = yield newTabPromise;
// Ensure that the newly created tab's browser is private.
ok(PrivateBrowsingUtils.isBrowserPrivate(newPrivTab.linkedBrowser),
"Newly opened tab should be private.");
// Clean up
yield BrowserTestUtils.removeTab(newPrivTab);
yield BrowserTestUtils.closeWindow(popupWin);
yield BrowserTestUtils.closeWindow(privWin);
});

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

@ -51,7 +51,7 @@ add_task(function* test() {
}]
};
PlacesUtils.asyncHistory.updatePlaces(place, {
handleError: function () ok(false, "Unexpected error in adding visit."),
handleError: () => ok(false, "Unexpected error in adding visit."),
handleResult: function () { },
handleCompletion: function () {}
});

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

@ -44,44 +44,44 @@ function test() {
return w;
}
function closeCachedWindows () {
windowCache.forEach(function(w) w.close());
windowCache.forEach(w => w.close());
}
// Part 1: NON PRIVATE WINDOW -> PRIVATE WINDOW
openWindow(window, {}, 1).
then(cacheWindow).
then(openSidebar).
then(function(win) openWindow(win, { private: true })).
then(win => openWindow(win, { private: true })).
then(cacheWindow).
then(function({ document }) {
let sidebarBox = document.getElementById("sidebar-box");
is(sidebarBox.hidden, true, 'Opening a private window from reg window does not open the sidebar');
}).
// Part 2: NON PRIVATE WINDOW -> NON PRIVATE WINDOW
then(function() openWindow(window)).
then(() => openWindow(window)).
then(cacheWindow).
then(openSidebar).
then(function(win) openWindow(win)).
then(win => openWindow(win)).
then(cacheWindow).
then(function({ document }) {
let sidebarBox = document.getElementById("sidebar-box");
is(sidebarBox.hidden, false, 'Opening a reg window from reg window does open the sidebar');
}).
// Part 3: PRIVATE WINDOW -> NON PRIVATE WINDOW
then(function() openWindow(window, { private: true })).
then(() => openWindow(window, { private: true })).
then(cacheWindow).
then(openSidebar).
then(function(win) openWindow(win)).
then(win => openWindow(win)).
then(cacheWindow).
then(function({ document }) {
let sidebarBox = document.getElementById("sidebar-box");
is(sidebarBox.hidden, true, 'Opening a reg window from a private window does not open the sidebar');
}).
// Part 4: PRIVATE WINDOW -> PRIVATE WINDOW
then(function() openWindow(window, { private: true })).
then(() => openWindow(window, { private: true })).
then(cacheWindow).
then(openSidebar).
then(function(win) openWindow(win, { private: true })).
then(win => openWindow(win, { private: true })).
then(cacheWindow).
then(function({ document }) {
let sidebarBox = document.getElementById("sidebar-box");

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

@ -11,7 +11,7 @@ function testOnWindow(options, callback) {
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
windowsToClose.push(win);
executeSoon(function() callback(win));
executeSoon(() => callback(win));
}, false);
}

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

@ -58,7 +58,7 @@ function test() {
// execute should only be called when need, like when you are opening
// web pages on the test. If calling executeSoon() is not necesary, then
// call whenNewWindowLoaded() instead of testOnWindow() on your test.
executeSoon(function() aCallback(aWin));
executeSoon(() => aCallback(aWin));
});
};

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

@ -57,7 +57,7 @@ function clearHistory() {
function _initTest() {
// Don't use about:home as the homepage for new windows
Services.prefs.setIntPref("browser.startup.page", 0);
registerCleanupFunction(function() Services.prefs.clearUserPref("browser.startup.page"));
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.startup.page"));
}
_initTest();

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

@ -5,7 +5,7 @@
function test() {
// Don't use about:home as the homepage for new windows
Services.prefs.setIntPref("browser.startup.page", 0);
registerCleanupFunction(function() Services.prefs.clearUserPref("browser.startup.page"));
registerCleanupFunction(() => Services.prefs.clearUserPref("browser.startup.page"));
waitForExplicitFinish();

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

@ -3312,8 +3312,8 @@ var SessionStoreInternal = {
*/
_isCmdLineEmpty: function ssi_isCmdLineEmpty(aWindow, aState) {
var pinnedOnly = aState.windows &&
aState.windows.every(function (win)
win.tabs.every(function (tab) tab.pinned));
aState.windows.every(win =>
win.tabs.every(tab => tab.pinned));
let hasFirstArgument = aWindow.arguments && aWindow.arguments[0];
if (!pinnedOnly) {

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

@ -54,7 +54,7 @@ function test() {
else if (typeof aValue == "number")
node.selectedIndex = aValue;
else
Array.forEach(node.options, function(aOpt, aIx)
Array.forEach(node.options, (aOpt, aIx) =>
(aOpt.selected = aValue.indexOf(aIx) > -1));
}
@ -69,7 +69,7 @@ function test() {
return aValue == node.value;
if (!node.multiple)
return aValue == node.selectedIndex;
return Array.every(node.options, function(aOpt, aIx)
return Array.every(node.options, (aOpt, aIx) =>
(aValue.indexOf(aIx) > -1) == aOpt.selected);
}
@ -117,7 +117,7 @@ function test() {
"getClosedTabCount has increased after closing a tab");
// verify tab: (A), in undo list
let tab_A_restored = test(function() ss.undoCloseTab(aWin, 0));
let tab_A_restored = test(() => ss.undoCloseTab(aWin, 0));
ok(tab_A_restored, "a tab is in undo list");
promiseTabRestored(tab_A_restored).then(() => {
is(testURL, tab_A_restored.linkedBrowser.currentURI.spec,

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

@ -17,28 +17,28 @@ function test() {
}
// all of the following calls with illegal arguments should throw NS_ERROR_ILLEGAL_VALUE
ok(test(function() ss.getWindowState({})),
ok(test(() => ss.getWindowState({})),
"Invalid window for getWindowState throws");
ok(test(function() ss.setWindowState({}, "", false)),
ok(test(() => ss.setWindowState({}, "", false)),
"Invalid window for setWindowState throws");
ok(test(function() ss.getTabState({})),
ok(test(() => ss.getTabState({})),
"Invalid tab for getTabState throws");
ok(test(function() ss.setTabState({}, "{}")),
ok(test(() => ss.setTabState({}, "{}")),
"Invalid tab state for setTabState throws");
ok(test(function() ss.setTabState({}, JSON.stringify({ entries: [] }))),
ok(test(() => ss.setTabState({}, JSON.stringify({ entries: [] }))),
"Invalid tab for setTabState throws");
ok(test(function() ss.duplicateTab({}, {})),
ok(test(() => ss.duplicateTab({}, {})),
"Invalid tab for duplicateTab throws");
ok(test(function() ss.duplicateTab({}, gBrowser.selectedTab)),
ok(test(() => ss.duplicateTab({}, gBrowser.selectedTab)),
"Invalid window for duplicateTab throws");
ok(test(function() ss.getClosedTabData({})),
ok(test(() => ss.getClosedTabData({})),
"Invalid window for getClosedTabData throws");
ok(test(function() ss.undoCloseTab({}, 0)),
ok(test(() => ss.undoCloseTab({}, 0)),
"Invalid window for undoCloseTab throws");
ok(test(function() ss.undoCloseTab(window, -1)),
ok(test(() => ss.undoCloseTab(window, -1)),
"Invalid index for undoCloseTab throws");
ok(test(function() ss.getWindowValue({}, "")),
ok(test(() => ss.getWindowValue({}, "")),
"Invalid window for getWindowValue throws");
ok(test(function() ss.setWindowValue({}, "", "")),
ok(test(() => ss.setWindowValue({}, "", "")),
"Invalid window for setWindowValue throws");
}

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

@ -18,19 +18,19 @@ add_task(function* () {
let value = "Unique value: " + Math.random();
// test adding
ok(test(function() ss.setWindowValue(window, key, value)), "set a window value");
ok(test(() => ss.setWindowValue(window, key, value)), "set a window value");
// test retrieving
is(ss.getWindowValue(window, key), value, "stored window value matches original");
// test deleting
ok(test(function() ss.deleteWindowValue(window, key)), "delete the window value");
ok(test(() => ss.deleteWindowValue(window, key)), "delete the window value");
// value should not exist post-delete
is(ss.getWindowValue(window, key), "", "window value was deleted");
// test deleting a non-existent value
ok(test(function() ss.deleteWindowValue(window, key)), "delete non-existent window value");
ok(test(() => ss.deleteWindowValue(window, key)), "delete non-existent window value");
/////////////////////////
// setTabValue, et al. //
@ -41,19 +41,19 @@ add_task(function* () {
tab.linkedBrowser.stop();
// test adding
ok(test(function() ss.setTabValue(tab, key, value)), "store a tab value");
ok(test(() => ss.setTabValue(tab, key, value)), "store a tab value");
// test retrieving
is(ss.getTabValue(tab, key), value, "stored tab value match original");
// test deleting
ok(test(function() ss.deleteTabValue(tab, key)), "delete the tab value");
ok(test(() => ss.deleteTabValue(tab, key)), "delete the tab value");
// value should not exist post-delete
is(ss.getTabValue(tab, key), "", "tab value was deleted");
// test deleting a non-existent value
ok(test(function() ss.deleteTabValue(tab, key)), "delete non-existent tab value");
ok(test(() => ss.deleteTabValue(tab, key)), "delete non-existent tab value");
// clean up
yield promiseRemoveTab(tab);
@ -85,7 +85,7 @@ add_task(function* () {
ok(newcount > count, "after closing a tab, getClosedTabCount has been incremented");
// undoCloseTab
tab = test(function() ss.undoCloseTab(window, 0));
tab = test(() => ss.undoCloseTab(window, 0));
ok(tab, "undoCloseTab doesn't throw")
yield promiseTabRestored(tab);

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

@ -436,7 +436,7 @@ function test() {
}
if (iteration < NOTIFICATIONS_EXPECTED - 1) {
executeSoon(function() testMacNotifications(nextFn, ++iteration));
executeSoon(() => testMacNotifications(nextFn, ++iteration));
}
else {
executeSoon(nextFn);

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

@ -17,11 +17,13 @@ function waitForClearHistory(aCallback) {
function test() {
waitForExplicitFinish();
// utility functions
function countClosedTabsByTitle(aClosedTabList, aTitle)
aClosedTabList.filter(function (aData) aData.title == aTitle).length;
function countClosedTabsByTitle(aClosedTabList, aTitle) {
return aClosedTabList.filter(aData => aData.title == aTitle).length;
}
function countOpenTabsByTitle(aOpenTabList, aTitle)
aOpenTabList.filter(function (aData) aData.entries.some(function (aEntry) aEntry.title == aTitle)).length
function countOpenTabsByTitle(aOpenTabList, aTitle) {
return aOpenTabList.filter(aData => aData.entries.some(aEntry => aEntry.title == aTitle)).length;
}
// backup old state
let oldState = ss.getBrowserState();

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

@ -16,8 +16,9 @@ function test() {
] }] };
let remember_count = 2;
function countByTitle(aClosedTabList, aTitle)
aClosedTabList.filter(function(aData) aData.title == aTitle).length;
function countByTitle(aClosedTabList, aTitle) {
return aClosedTabList.filter(aData => aData.title == aTitle).length;
}
function testForError(aFunction) {
try {
@ -46,11 +47,11 @@ function test() {
"Everything is set up.");
// all of the following calls with illegal arguments should throw NS_ERROR_ILLEGAL_VALUE
ok(testForError(function() ss.forgetClosedTab({}, 0)),
ok(testForError(() => ss.forgetClosedTab({}, 0)),
"Invalid window for forgetClosedTab throws");
ok(testForError(function() ss.forgetClosedTab(newWin, -1)),
ok(testForError(() => ss.forgetClosedTab(newWin, -1)),
"Invalid tab for forgetClosedTab throws");
ok(testForError(function() ss.forgetClosedTab(newWin, test_state.windows[0]._closedTabs.length + 1)),
ok(testForError(() => ss.forgetClosedTab(newWin, test_state.windows[0]._closedTabs.length + 1)),
"Invalid tab for forgetClosedTab throws");
// Remove third tab, then first tab

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

@ -47,8 +47,9 @@ function test() {
] }] };
let remember_count = 5;
function countByTitle(aClosedTabList, aTitle)
aClosedTabList.filter(function(aData) aData.title == aTitle).length;
function countByTitle(aClosedTabList, aTitle) {
return aClosedTabList.filter(aData => aData.title == aTitle).length;
}
// open a window and add the above closed tab list
let newWin = openDialog(location, "", "chrome,all,dialog=no");

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

@ -65,8 +65,9 @@ function test() {
};
let remember_count = 1;
function countByTitle(aClosedWindowList, aTitle)
aClosedWindowList.filter(function(aData) aData.title == aTitle).length;
function countByTitle(aClosedWindowList, aTitle) {
return aClosedWindowList.filter(aData => aData.title == aTitle).length;
}
function testForError(aFunction) {
try {
@ -95,9 +96,9 @@ function test() {
"Everything is set up.");
// all of the following calls with illegal arguments should throw NS_ERROR_ILLEGAL_VALUE
ok(testForError(function() ss.forgetClosedWindow(-1)),
ok(testForError(() => ss.forgetClosedWindow(-1)),
"Invalid window for forgetClosedWindow throws");
ok(testForError(function() ss.forgetClosedWindow(test_state._closedWindows.length + 1)),
ok(testForError(() => ss.forgetClosedWindow(test_state._closedWindows.length + 1)),
"Invalid window for forgetClosedWindow throws");
// Remove third window, then first window

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

@ -10,7 +10,7 @@ function test() {
waitForExplicitFinish();
newWindowWithState(state, function (win) {
registerCleanupFunction(function () win.close());
registerCleanupFunction(() => win.close());
is(win.gBrowser.tabs.length, 2, "two tabs were restored");
is(win.gBrowser.visibleTabs.length, 1, "one tab is visible");

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

@ -40,7 +40,7 @@ function checkOSX34Generator(num) {
expectedState[0].tabs.shift();
// size attributes are stripped out in _prepDataForDeferredRestore in nsSessionStore.
// This isn't the best approach, but neither is comparing JSON strings
WINDOW_ATTRIBUTES.forEach(function (attr) delete expectedState[0][attr]);
WINDOW_ATTRIBUTES.forEach(attr => delete expectedState[0][attr]);
is(aCurState, JSON.stringify(expectedState),
"test #" + num + ": closedWindowState is as expected");

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

@ -17,7 +17,7 @@ function test() {
waitForExplicitFinish();
newWindowWithState(state, function (win) {
registerCleanupFunction(function () win.close());
registerCleanupFunction(() => win.close());
is(gBrowser.tabs.length, 1, "The total number of tabs should be 1");
is(gBrowser.visibleTabs.length, 1, "The total number of visible tabs should be 1");

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

@ -101,7 +101,7 @@ function newWindowWithState(state, callback) {
let opts = "chrome,all,dialog=no,height=800,width=800";
let win = window.openDialog(getBrowserURL(), "_blank", opts);
registerCleanupFunction(function () win.close());
registerCleanupFunction(() => win.close());
whenWindowLoaded(win, function onWindowLoaded(aWin) {
TabsProgressListener.init(aWin);

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

@ -101,7 +101,9 @@ function checkAutocompleteResults(aExpected, aCallback) {
},
setSelectedIndex: function() {},
get searchCount() { return this.searches.length; },
getSearchAt: function(aIndex) this.searches[aIndex],
getSearchAt: function(aIndex) {
return this.searches[aIndex];
},
QueryInterface: XPCOMUtils.generateQI([
Ci.nsIAutoCompleteInput,
Ci.nsIAutoCompletePopup,

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

@ -27,6 +27,6 @@ function newWindow(callback) {
win.addEventListener("load", function onLoad() {
win.removeEventListener("load", onLoad, false);
executeSoon(function () callback(win));
executeSoon(() => callback(win));
}, false);
}

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

@ -14,7 +14,7 @@ function test() {
ok(tab.hidden, "the second tab is hidden");
let tabShown = false;
let tabShowCallback = function () tabShown = true;
let tabShowCallback = () => tabShown = true;
tab.addEventListener("TabShow", tabShowCallback, false);
let tabState = ss.getTabState(tab);
@ -32,10 +32,10 @@ function newWindowWithState(aState, aCallback) {
let opts = "chrome,all,dialog=no,height=800,width=800";
let win = window.openDialog(getBrowserURL(), "_blank", opts);
registerCleanupFunction(function () win.close());
registerCleanupFunction(() => win.close());
whenWindowLoaded(win, function onWindowLoaded(aWin) {
ss.setWindowState(aWin, JSON.stringify(aState), true);
executeSoon(function () aCallback(aWin));
executeSoon(() => aCallback(aWin));
});
}

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

@ -54,5 +54,5 @@ function whenChildCount(aEntry, aChildCount, aCallback) {
if (aEntry.childCount == aChildCount)
aCallback();
else
setTimeout(function () whenChildCount(aEntry, aChildCount, aCallback), 100);
setTimeout(() => whenChildCount(aEntry, aChildCount, aCallback), 100);
}

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

@ -57,5 +57,5 @@ function whenChildCount(aEntry, aChildCount, aCallback) {
if (aEntry.childCount == aChildCount)
aCallback();
else
setTimeout(function () whenChildCount(aEntry, aChildCount, aCallback), 100);
setTimeout(() => whenChildCount(aEntry, aChildCount, aCallback), 100);
}

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше