Bug 1331661 - Enable the 'quotes' rule for eslint and fix most of the errors with --fix. r=Gijs

MozReview-Commit-ID: 6tv0Z06CO4a

--HG--
extra : rebase_source : 014c0b04d8538dc5f15bc6dd4ed6bd220c55c5d4
This commit is contained in:
Jared Wein 2017-01-17 09:48:17 -06:00
parent bdb11914be
commit 43bac26d30
471 changed files with 3233 additions and 3229 deletions

View file

@ -270,7 +270,7 @@ var wrapper = {
}, },
handleRemoteCommand(evt) { handleRemoteCommand(evt) {
log('command: ' + evt.detail.command); log("command: " + evt.detail.command);
let data = evt.detail.data; let data = evt.detail.data;
switch (evt.detail.command) { switch (evt.detail.command) {
@ -420,9 +420,9 @@ function show(id, childId) {
let allTop = document.querySelectorAll("body > div, iframe"); let allTop = document.querySelectorAll("body > div, iframe");
for (let elt of allTop) { for (let elt of allTop) {
if (elt.getAttribute("id") == id) { if (elt.getAttribute("id") == id) {
elt.style.display = 'block'; elt.style.display = "block";
} else { } else {
elt.style.display = 'none'; elt.style.display = "none";
} }
} }
if (childId) { if (childId) {
@ -430,9 +430,9 @@ function show(id, childId) {
let allSecond = document.querySelectorAll("#" + id + " > div"); let allSecond = document.querySelectorAll("#" + id + " > div");
for (let elt of allSecond) { for (let elt of allSecond) {
if (elt.getAttribute("id") == childId) { if (elt.getAttribute("id") == childId) {
elt.style.display = 'block'; elt.style.display = "block";
} else { } else {
elt.style.display = 'none'; elt.style.display = "none";
} }
} }
} }
@ -500,17 +500,17 @@ function getDefaultProfilePath() {
document.addEventListener("DOMContentLoaded", function onload() { document.addEventListener("DOMContentLoaded", function onload() {
document.removeEventListener("DOMContentLoaded", onload, true); document.removeEventListener("DOMContentLoaded", onload, true);
init(); init();
var buttonGetStarted = document.getElementById('buttonGetStarted'); var buttonGetStarted = document.getElementById("buttonGetStarted");
buttonGetStarted.addEventListener('click', getStarted); buttonGetStarted.addEventListener("click", getStarted);
var buttonRetry = document.getElementById('buttonRetry'); var buttonRetry = document.getElementById("buttonRetry");
buttonRetry.addEventListener('click', retry); buttonRetry.addEventListener("click", retry);
var oldsync = document.getElementById('oldsync'); var oldsync = document.getElementById("oldsync");
oldsync.addEventListener('click', handleOldSync); oldsync.addEventListener("click", handleOldSync);
var buttonOpenPrefs = document.getElementById('buttonOpenPrefs') var buttonOpenPrefs = document.getElementById("buttonOpenPrefs")
buttonOpenPrefs.addEventListener('click', openPrefs); buttonOpenPrefs.addEventListener("click", openPrefs);
}, true); }, true);
function initObservers() { function initObservers() {

View file

@ -1697,7 +1697,7 @@ var BookmarkingUI = {
clearTimeout(this._notificationTimeout); clearTimeout(this._notificationTimeout);
} }
if (this.notifier.style.transform == '') { if (this.notifier.style.transform == "") {
// Get all the relevant nodes and computed style objects // Get all the relevant nodes and computed style objects
let dropmarker = document.getAnonymousElementByAttribute(this.button, "anonid", "dropmarker"); let dropmarker = document.getAnonymousElementByAttribute(this.button, "anonid", "dropmarker");
let dropmarkerIcon = document.getAnonymousElementByAttribute(dropmarker, "class", "dropmarker-icon"); let dropmarkerIcon = document.getAnonymousElementByAttribute(dropmarker, "class", "dropmarker-icon");
@ -1742,8 +1742,8 @@ var BookmarkingUI = {
this.dropmarkerNotifier.removeAttribute("notification"); this.dropmarkerNotifier.removeAttribute("notification");
this.button.removeAttribute("notification"); this.button.removeAttribute("notification");
this.dropmarkerNotifier.style.transform = ''; this.dropmarkerNotifier.style.transform = "";
this.notifier.style.transform = ''; this.notifier.style.transform = "";
}, 1000); }, 1000);
}, },

View file

@ -418,7 +418,7 @@ var gPluginHandler = {
appendNotification(message, "plugin-hidden", null, appendNotification(message, "plugin-hidden", null,
notificationBox.PRIORITY_INFO_HIGH, buttons); notificationBox.PRIORITY_INFO_HIGH, buttons);
if (haveInsecure) { if (haveInsecure) {
n.classList.add('pluginVulnerable'); n.classList.add("pluginVulnerable");
} }
} }

View file

@ -432,9 +432,9 @@ var gSyncUI = {
})(); })();
// It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago // It may be confusing for the user to see "Last Sync: Monday" when the last sync was a indeed a Monday but 3 weeks ago
if (date < sixDaysAgo) { if (date < sixDaysAgo) {
dateFormat = {month: 'long', day: 'numeric'}; dateFormat = {month: "long", day: "numeric"};
} else { } else {
dateFormat = {weekday: 'long', hour: 'numeric', minute: 'numeric'}; dateFormat = {weekday: "long", hour: "numeric", minute: "numeric"};
} }
let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat); let lastSyncDateString = date.toLocaleDateString(undefined, dateFormat);
return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1); return this._stringBundle.formatStringFromName("lastSync2.label", [lastSyncDateString], 1);

View file

@ -118,7 +118,7 @@ XPCOMUtils.defineLazyGetter(this, "BrowserToolboxProcess", function() {
}); });
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle('chrome://browser/locale/browser.properties'); return Services.strings.createBundle("chrome://browser/locale/browser.properties");
}); });
XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() { XPCOMUtils.defineLazyGetter(this, "gCustomizeMode", function() {
@ -753,7 +753,7 @@ function gKeywordURIFixup({ target: browser, data: fixupInfo }) {
// because we need to be sure this last dot is the *only* dot, too. // because we need to be sure this last dot is the *only* dot, too.
// More generally, this is used for the pref and should stay in sync with // More generally, this is used for the pref and should stay in sync with
// the code in nsDefaultURIFixup::KeywordURIFixup . // the code in nsDefaultURIFixup::KeywordURIFixup .
if (asciiHost.indexOf('.') == asciiHost.length - 1) { if (asciiHost.indexOf(".") == asciiHost.length - 1) {
asciiHost = asciiHost.slice(0, -1); asciiHost = asciiHost.slice(0, -1);
} }
@ -849,7 +849,7 @@ function _loadURIWithFlags(browser, uri, params) {
} }
let flags = params.flags || 0; let flags = params.flags || 0;
let referrer = params.referrerURI; let referrer = params.referrerURI;
let referrerPolicy = ('referrerPolicy' in params ? params.referrerPolicy : let referrerPolicy = ("referrerPolicy" in params ? params.referrerPolicy :
Ci.nsIHttpChannel.REFERRER_POLICY_UNSET); Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
let postData = params.postData; let postData = params.postData;
@ -1592,12 +1592,12 @@ if (AppConstants.platform == "macosx") {
// macBrowserOverlay // macBrowserOverlay
gBrowserInit.nonBrowserWindowStartup = function() { gBrowserInit.nonBrowserWindowStartup = function() {
// Disable inappropriate commands / submenus // Disable inappropriate commands / submenus
var disabledItems = ['Browser:SavePage', var disabledItems = ["Browser:SavePage",
'Browser:SendLink', 'cmd_pageSetup', 'cmd_print', 'cmd_find', 'cmd_findAgain', "Browser:SendLink", "cmd_pageSetup", "cmd_print", "cmd_find", "cmd_findAgain",
'viewToolbarsMenu', 'viewSidebarMenuMenu', 'Browser:Reload', "viewToolbarsMenu", "viewSidebarMenuMenu", "Browser:Reload",
'viewFullZoomMenu', 'pageStyleMenu', 'charsetMenu', 'View:PageSource', 'View:FullScreen', "viewFullZoomMenu", "pageStyleMenu", "charsetMenu", "View:PageSource", "View:FullScreen",
'viewHistorySidebar', 'Browser:AddBookmarkAs', 'Browser:BookmarkAllTabs', "viewHistorySidebar", "Browser:AddBookmarkAs", "Browser:BookmarkAllTabs",
'View:PageInfo']; "View:PageInfo"];
var element; var element;
for (let disabledItem of disabledItems) { for (let disabledItem of disabledItems) {
@ -1609,7 +1609,7 @@ if (AppConstants.platform == "macosx") {
// If no windows are active (i.e. we're the hidden window), disable the close, minimize // If no windows are active (i.e. we're the hidden window), disable the close, minimize
// and zoom menu commands as well // and zoom menu commands as well
if (window.location.href == "chrome://browser/content/hiddenWindow.xul") { if (window.location.href == "chrome://browser/content/hiddenWindow.xul") {
var hiddenWindowDisabledItems = ['cmd_close', 'minimizeWindow', 'zoomWindow']; var hiddenWindowDisabledItems = ["cmd_close", "minimizeWindow", "zoomWindow"];
for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) { for (let hiddenWindowDisabledItem of hiddenWindowDisabledItems) {
element = document.getElementById(hiddenWindowDisabledItem); element = document.getElementById(hiddenWindowDisabledItem);
if (element) if (element)
@ -1722,7 +1722,7 @@ function HandleAppCommandEvent(evt) {
gFindBar.onFindCommand(); gFindBar.onFindCommand();
break; break;
case "Help": case "Help":
openHelpLink('firefox-help'); openHelpLink("firefox-help");
break; break;
case "Open": case "Open":
BrowserOpenFileWindow(); BrowserOpenFileWindow();
@ -2931,8 +2931,8 @@ var BrowserOnClick = {
Components.utils.reportError("Couldn't get ssl_override pref: " + e); Components.utils.reportError("Couldn't get ssl_override pref: " + e);
} }
window.openDialog('chrome://pippki/content/exceptionDialog.xul', window.openDialog("chrome://pippki/content/exceptionDialog.xul",
'', 'chrome,centerscreen,modal', params); "", "chrome,centerscreen,modal", params);
// If the user added the exception cert, attempt to reload the page // If the user added the exception cert, attempt to reload the page
if (params.exceptionAdded) { if (params.exceptionAdded) {
@ -3000,13 +3000,13 @@ var BrowserOnClick = {
// use the right strings and links for each. // use the right strings and links for each.
let bucketName = ""; let bucketName = "";
let sendTelemetry = false; let sendTelemetry = false;
if (reason === 'malware') { if (reason === "malware") {
sendTelemetry = true; sendTelemetry = true;
bucketName = "WARNING_MALWARE_PAGE_"; bucketName = "WARNING_MALWARE_PAGE_";
} else if (reason === 'phishing') { } else if (reason === "phishing") {
sendTelemetry = true; sendTelemetry = true;
bucketName = "WARNING_PHISHING_PAGE_"; bucketName = "WARNING_PHISHING_PAGE_";
} else if (reason === 'unwanted') { } else if (reason === "unwanted") {
sendTelemetry = true; sendTelemetry = true;
bucketName = "WARNING_UNWANTED_PAGE_"; bucketName = "WARNING_UNWANTED_PAGE_";
} }
@ -3085,25 +3085,25 @@ var BrowserOnClick = {
}]; }];
let title; let title;
if (reason === 'malware') { if (reason === "malware") {
title = gNavigatorBundle.getString("safebrowsing.reportedAttackSite"); title = gNavigatorBundle.getString("safebrowsing.reportedAttackSite");
buttons[1] = { buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"), label: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"), accessKey: gNavigatorBundle.getString("safebrowsing.notAnAttackButton.accessKey"),
callback() { callback() {
openUILinkIn(gSafeBrowsing.getReportURL('MalwareMistake'), 'tab'); openUILinkIn(gSafeBrowsing.getReportURL("MalwareMistake"), "tab");
} }
}; };
} else if (reason === 'phishing') { } else if (reason === "phishing") {
title = gNavigatorBundle.getString("safebrowsing.deceptiveSite"); title = gNavigatorBundle.getString("safebrowsing.deceptiveSite");
buttons[1] = { buttons[1] = {
label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"), label: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.label"),
accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"), accessKey: gNavigatorBundle.getString("safebrowsing.notADeceptiveSiteButton.accessKey"),
callback() { callback() {
openUILinkIn(gSafeBrowsing.getReportURL('PhishMistake'), 'tab'); openUILinkIn(gSafeBrowsing.getReportURL("PhishMistake"), "tab");
} }
}; };
} else if (reason === 'unwanted') { } else if (reason === "unwanted") {
title = gNavigatorBundle.getString("safebrowsing.reportedUnwantedSite"); title = gNavigatorBundle.getString("safebrowsing.reportedUnwantedSite");
// There is no button for reporting errors since Google doesn't currently // There is no button for reporting errors since Google doesn't currently
// provide a URL endpoint for these reports. // provide a URL endpoint for these reports.
@ -3311,7 +3311,7 @@ function getDetailedCertErrorInfo(location, securityInfo) {
function getDERString(cert) { function getDERString(cert) {
var length = {}; var length = {};
var derArray = cert.getRawDER(length); var derArray = cert.getRawDER(length);
var derString = ''; var derString = "";
for (var i = 0; i < derArray.length; i++) { for (var i = 0; i < derArray.length; i++) {
derString += String.fromCharCode(derArray[i]); derString += String.fromCharCode(derArray[i]);
} }
@ -4047,7 +4047,7 @@ function OpenBrowserWindow(options) {
var handler = Components.classes["@mozilla.org/browser/clh;1"] var handler = Components.classes["@mozilla.org/browser/clh;1"]
.getService(Components.interfaces.nsIBrowserHandler); .getService(Components.interfaces.nsIBrowserHandler);
var defaultArgs = handler.defaultArgs; var defaultArgs = handler.defaultArgs;
var wintype = document.documentElement.getAttribute('windowtype'); var wintype = document.documentElement.getAttribute("windowtype");
var extraFeatures = ""; var extraFeatures = "";
if (options && options.private) { if (options && options.private) {
@ -4158,7 +4158,7 @@ function updateEditUIVisibility() {
*/ */
function openNewUserContextTab(event) { function openNewUserContextTab(event) {
openUILinkIn(BROWSER_NEW_TAB_URL, "tab", { openUILinkIn(BROWSER_NEW_TAB_URL, "tab", {
userContextId: parseInt(event.target.getAttribute('data-usercontextid')), userContextId: parseInt(event.target.getAttribute("data-usercontextid")),
}); });
} }
@ -4455,16 +4455,16 @@ var XULBrowserWindow = {
// Disable menu entries for images, enable otherwise // Disable menu entries for images, enable otherwise
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) { if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) {
this.isImage.removeAttribute('disabled'); this.isImage.removeAttribute("disabled");
} else { } else {
canViewSource = false; canViewSource = false;
this.isImage.setAttribute('disabled', 'true'); this.isImage.setAttribute("disabled", "true");
} }
if (canViewSource) { if (canViewSource) {
this.canViewSource.removeAttribute('disabled'); this.canViewSource.removeAttribute("disabled");
} else { } else {
this.canViewSource.setAttribute('disabled', 'true'); this.canViewSource.setAttribute("disabled", "true");
} }
} }
@ -4507,9 +4507,9 @@ var XULBrowserWindow = {
// Disable menu entries for images, enable otherwise // Disable menu entries for images, enable otherwise
if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType)) if (browser.documentContentType && BrowserUtils.mimeTypeIsTextBased(browser.documentContentType))
this.isImage.removeAttribute('disabled'); this.isImage.removeAttribute("disabled");
else else
this.isImage.setAttribute('disabled', 'true'); this.isImage.setAttribute("disabled", "true");
this.hideOverLinkImmediately = true; this.hideOverLinkImmediately = true;
this.setOverLink("", null); this.setOverLink("", null);
@ -5327,7 +5327,7 @@ var gHomeButton = {
homeButton = document.getElementById("home-button"); homeButton = document.getElementById("home-button");
if (homeButton) { if (homeButton) {
var homePage = this.getHomePage(); var homePage = this.getHomePage();
homePage = homePage.replace(/\|/g, ', '); homePage = homePage.replace(/\|/g, ", ");
if (["about:home", "about:newtab"].includes(homePage.toLowerCase())) if (["about:home", "about:newtab"].includes(homePage.toLowerCase()))
homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip")); homeButton.setAttribute("tooltiptext", homeButton.getAttribute("aboutHomeOverrideTooltip"));
else else

View file

@ -264,11 +264,11 @@ var AboutNetAndCertErrorListener = {
init(chromeGlobal) { init(chromeGlobal) {
addMessageListener("CertErrorDetails", this); addMessageListener("CertErrorDetails", this);
addMessageListener("Browser:CaptivePortalFreed", this); addMessageListener("Browser:CaptivePortalFreed", this);
chromeGlobal.addEventListener('AboutNetErrorLoad', this, false, true); chromeGlobal.addEventListener("AboutNetErrorLoad", this, false, true);
chromeGlobal.addEventListener('AboutNetErrorOpenCaptivePortal', this, false, true); chromeGlobal.addEventListener("AboutNetErrorOpenCaptivePortal", this, false, true);
chromeGlobal.addEventListener('AboutNetErrorSetAutomatic', this, false, true); chromeGlobal.addEventListener("AboutNetErrorSetAutomatic", this, false, true);
chromeGlobal.addEventListener('AboutNetErrorOverride', this, false, true); chromeGlobal.addEventListener("AboutNetErrorOverride", this, false, true);
chromeGlobal.addEventListener('AboutNetErrorResetPreferences', this, false, true); chromeGlobal.addEventListener("AboutNetErrorResetPreferences", this, false, true);
}, },
get isAboutNetError() { get isAboutNetError() {
@ -547,11 +547,11 @@ var ClickEventHandler = {
}, },
onAboutBlocked(targetElement, ownerDoc) { onAboutBlocked(targetElement, ownerDoc) {
var reason = 'phishing'; var reason = "phishing";
if (/e=malwareBlocked/.test(ownerDoc.documentURI)) { if (/e=malwareBlocked/.test(ownerDoc.documentURI)) {
reason = 'malware'; reason = "malware";
} else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) { } else if (/e=unwantedBlocked/.test(ownerDoc.documentURI)) {
reason = 'unwanted'; reason = "unwanted";
} }
sendAsyncMessage("Browser:SiteBlockedError", { sendAsyncMessage("Browser:SiteBlockedError", {
location: ownerDoc.location.href, location: ownerDoc.location.href,

View file

@ -623,7 +623,7 @@ ContentSearchUIController.prototype = {
let searchWithHeader = document.getElementById("contentSearchSearchWithHeader"); let searchWithHeader = document.getElementById("contentSearchSearchWithHeader");
if (this.input.value) { if (this.input.value) {
searchWithHeader.innerHTML = this._strings.searchForSomethingWith; searchWithHeader.innerHTML = this._strings.searchForSomethingWith;
searchWithHeader.querySelector('.contentSearchSearchWithHeaderSearchText').textContent = this.input.value; searchWithHeader.querySelector(".contentSearchSearchWithHeaderSearchText").textContent = this.input.value;
} else { } else {
searchWithHeader.textContent = this._strings.searchWithHeader; searchWithHeader.textContent = this._strings.searchWithHeader;
} }

View file

@ -152,8 +152,8 @@ const COPYCOL_META_CONTENT = 1;
const COPYCOL_IMAGE = COL_IMAGE_ADDRESS; const COPYCOL_IMAGE = COL_IMAGE_ADDRESS;
// one nsITreeView for each tree in the window // one nsITreeView for each tree in the window
var gMetaView = new pageInfoTreeView('metatree', COPYCOL_META_CONTENT); var gMetaView = new pageInfoTreeView("metatree", COPYCOL_META_CONTENT);
var gImageView = new pageInfoTreeView('imagetree', COPYCOL_IMAGE); var gImageView = new pageInfoTreeView("imagetree", COPYCOL_IMAGE);
gImageView.getCellProperties = function(row, col) { gImageView.getCellProperties = function(row, col) {
var data = gImageView.data[row]; var data = gImageView.data[row];
@ -1005,8 +1005,8 @@ function formatDate(datestr, unknown) {
const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"] const locale = Components.classes["@mozilla.org/chrome/chrome-registry;1"]
.getService(Components.interfaces.nsIXULChromeRegistry) .getService(Components.interfaces.nsIXULChromeRegistry)
.getSelectedLocale("global", true); .getSelectedLocale("global", true);
const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', const dtOptions = { year: "numeric", month: "long", day: "numeric",
hour: 'numeric', minute: 'numeric', second: 'numeric' }; hour: "numeric", minute: "numeric", second: "numeric" };
return date.toLocaleString(locale, dtOptions); return date.toLocaleString(locale, dtOptions);
} }
@ -1019,7 +1019,7 @@ function doCopy() {
if (elem && "treeBoxObject" in elem) { if (elem && "treeBoxObject" in elem) {
var view = elem.view; var view = elem.view;
var selection = view.selection; var selection = view.selection;
var text = [], tmp = ''; var text = [], tmp = "";
var min = {}, max = {}; var min = {}, max = {};
var count = selection.getRangeCount(); var count = selection.getRangeCount();

View file

@ -161,13 +161,13 @@ function onCheckboxClick(aPartId) {
} }
function onPluginRadioClick(aEvent) { function onPluginRadioClick(aEvent) {
onRadioClick(aEvent.originalTarget.getAttribute("id").split('#')[0]); onRadioClick(aEvent.originalTarget.getAttribute("id").split("#")[0]);
} }
function onRadioClick(aPartId) { function onRadioClick(aPartId) {
var radioGroup = document.getElementById(aPartId + "RadioGroup"); var radioGroup = document.getElementById(aPartId + "RadioGroup");
var id = radioGroup.selectedItem.id; var id = radioGroup.selectedItem.id;
var permission = id.split('#')[1]; var permission = id.split("#")[1];
SitePermissions.set(gPermURI, aPartId, permission); SitePermissions.set(gPermURI, aPartId, permission);
} }

View file

@ -105,7 +105,7 @@ addMessageListener("SecondScreen:tab-mirror", function(message) {
var AboutHomeListener = { var AboutHomeListener = {
init(chromeGlobal) { init(chromeGlobal) {
chromeGlobal.addEventListener('AboutHomeLoad', this, false, true); chromeGlobal.addEventListener("AboutHomeLoad", this, false, true);
}, },
get isAboutHome() { get isAboutHome() {

View file

@ -379,7 +379,7 @@ function getCertChain(securityInfoAsString) {
function getDERString(cert) { function getDERString(cert) {
var length = {}; var length = {};
var derArray = cert.getRawDER(length); var derArray = cert.getRawDER(length);
var derString = ''; var derString = "";
for (var i = 0; i < derArray.length; i++) { for (var i = 0; i < derArray.length; i++) {
derString += String.fromCharCode(derArray[i]); derString += String.fromCharCode(derArray[i]);
} }

View file

@ -3,9 +3,9 @@
Cu.import("resource://gre/modules/NetUtil.jsm"); Cu.import("resource://gre/modules/NetUtil.jsm");
function test() { function test() {
var file = new File([new Blob(['test'], {type: 'text/plain'})], "test-name"); var file = new File([new Blob(["test"], {type: "text/plain"})], "test-name");
var url = URL.createObjectURL(file); var url = URL.createObjectURL(file);
var channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true}); var channel = NetUtil.newChannel({uri: url, loadUsingSystemPrincipal: true});
is(channel.contentDispositionFilename, 'test-name', "filename matches"); is(channel.contentDispositionFilename, "test-name", "filename matches");
} }

View file

@ -6,17 +6,17 @@
var tests = [ var tests = [
// Common page. // Common page.
['http://example.com/browser/browser/base/content/test/general/dummy_page.html', ["http://example.com/browser/browser/base/content/test/general/dummy_page.html",
'Dummy test page'], "Dummy test page"],
// Data URI. // Data URI.
['data:text/html;charset=utf-8,<title>test%20data:%20url</title>', ["data:text/html;charset=utf-8,<title>test%20data:%20url</title>",
'test data: url'], "test data: url"],
// about:neterror // about:neterror
['data:application/vnd.mozilla.xul+xml,', ["data:application/vnd.mozilla.xul+xml,",
'data:application/vnd.mozilla.xul+xml,'], "data:application/vnd.mozilla.xul+xml,"],
// about:certerror // about:certerror
['https://untrusted.example.com/somepage.html', ["https://untrusted.example.com/somepage.html",
'https://untrusted.example.com/somepage.html'] "https://untrusted.example.com/somepage.html"]
]; ];
add_task(function* () { add_task(function* () {
@ -40,11 +40,11 @@ add_task(function* () {
// Simulate a network outage with offline mode. (Localhost is still // Simulate a network outage with offline mode. (Localhost is still
// accessible in offline mode, so disable the test proxy as well.) // accessible in offline mode, so disable the test proxy as well.)
BrowserOffline.toggleOfflineStatus(); BrowserOffline.toggleOfflineStatus();
let proxy = Services.prefs.getIntPref('network.proxy.type'); let proxy = Services.prefs.getIntPref("network.proxy.type");
Services.prefs.setIntPref('network.proxy.type', 0); Services.prefs.setIntPref("network.proxy.type", 0);
registerCleanupFunction(function() { registerCleanupFunction(function() {
BrowserOffline.toggleOfflineStatus(); BrowserOffline.toggleOfflineStatus();
Services.prefs.setIntPref('network.proxy.type', proxy); Services.prefs.setIntPref("network.proxy.type", proxy);
}); });
// LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache. // LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache.
@ -58,7 +58,7 @@ add_task(function* () {
// The offline mode test is only good if the page failed to load. // The offline mode test is only good if the page failed to load.
yield ContentTask.spawn(browser, null, function() { yield ContentTask.spawn(browser, null, function() {
is(content.document.documentURI.substring(0, 14), 'about:neterror', is(content.document.documentURI.substring(0, 14), "about:neterror",
"Offline mode successfully simulated network outage."); "Offline mode successfully simulated network outage.");
}); });
yield checkBookmark(uri, title); yield checkBookmark(uri, title);

View file

@ -37,7 +37,7 @@ add_task(function* () {
function* test1(gTestBrowser) { function* test1(gTestBrowser) {
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer'); var x = content.document.getElementsByTagName("iframe")[0].contentDocument.getElementById("mixedContentContainer");
is(x, null, "Mixed Content is NOT to be found in Test1"); is(x, null, "Mixed Content is NOT to be found in Test1");
// Disable Mixed Content Protection for the page (and reload) // Disable Mixed Content Protection for the page (and reload)
@ -47,7 +47,7 @@ function* test1(gTestBrowser) {
function* test2(gTestBrowser) { function* test2(gTestBrowser) {
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer'); var x = content.document.getElementsByTagName("iframe")[0].contentDocument.getElementById("mixedContentContainer");
isnot(x, null, "Mixed Content is to be found in Test2"); isnot(x, null, "Mixed Content is to be found in Test2");
// Re-enable Mixed Content Protection for the page (and reload) // Re-enable Mixed Content Protection for the page (and reload)
@ -57,6 +57,6 @@ function* test2(gTestBrowser) {
function* test3(gTestBrowser) { function* test3(gTestBrowser) {
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
var x = content.document.getElementsByTagName('iframe')[0].contentDocument.getElementById('mixedContentContainer'); var x = content.document.getElementsByTagName("iframe")[0].contentDocument.getElementById("mixedContentContainer");
is(x, null, "Mixed Content is NOT to be found in Test3"); is(x, null, "Mixed Content is NOT to be found in Test3");
} }

View file

@ -11,7 +11,7 @@
add_task(function* test_content_and_chrome_selection() { add_task(function* test_content_and_chrome_selection() {
let testPage = let testPage =
'data:text/html,' + "data:text/html," +
'<textarea id="textarea">Write something here</textarea>'; '<textarea id="textarea">Write something here</textarea>';
let DOMWindowUtils = EventUtils._getDOMWindowUtils(window); let DOMWindowUtils = EventUtils._getDOMWindowUtils(window);
let selectedText; let selectedText;
@ -40,10 +40,10 @@ add_task(function* test_content_and_chrome_selection() {
add_task(function* test_active_selection_switches_properly() { add_task(function* test_active_selection_switches_properly() {
let testPage1 = let testPage1 =
'data:text/html,' + "data:text/html," +
'<textarea id="textarea">Write something here</textarea>'; '<textarea id="textarea">Write something here</textarea>';
let testPage2 = let testPage2 =
'data:text/html,' + "data:text/html," +
'<textarea id="textarea">Nothing available</textarea>'; '<textarea id="textarea">Nothing available</textarea>';
let DOMWindowUtils = EventUtils._getDOMWindowUtils(window); let DOMWindowUtils = EventUtils._getDOMWindowUtils(window);
let selectedText; let selectedText;

View file

@ -54,7 +54,7 @@ function* cutCurrentSelection(elementQueryString, property, browser) {
// which is handled by TextEditor::PasteTransferable to paste into the editor. // which is handled by TextEditor::PasteTransferable to paste into the editor.
add_task(function* test_paste_transferable_plain_text() { add_task(function* test_paste_transferable_plain_text() {
let testPage = let testPage =
'data:text/html,' + "data:text/html," +
'<textarea id="textarea">Write something here</textarea>'; '<textarea id="textarea">Write something here</textarea>';
yield BrowserTestUtils.withNewTab(testPage, function* (browser) { yield BrowserTestUtils.withNewTab(testPage, function* (browser) {
@ -69,7 +69,7 @@ add_task(function* test_paste_transferable_plain_text() {
DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans); DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans);
yield ContentTask.spawn(browser, null, function* () { yield ContentTask.spawn(browser, null, function* () {
let textArea = content.document.querySelector('#textarea'); let textArea = content.document.querySelector("#textarea");
is(textArea.value, "Write something here", is(textArea.value, "Write something here",
"Send content command pasteTransferable successful"); "Send content command pasteTransferable successful");
}); });
@ -85,7 +85,7 @@ add_task(function* test_paste_transferable_plain_text() {
// Selection to select the contenteditable contents. // Selection to select the contenteditable contents.
add_task(function* test_paste_transferable_html() { add_task(function* test_paste_transferable_html() {
let testPage = let testPage =
'data:text/html,' + "data:text/html," +
'<div contenteditable="true"><b>Bold Text</b><i>italics</i></div>'; '<div contenteditable="true"><b>Bold Text</b><i>italics</i></div>';
yield BrowserTestUtils.withNewTab(testPage, function* (browser) { yield BrowserTestUtils.withNewTab(testPage, function* (browser) {
@ -104,7 +104,7 @@ add_task(function* test_paste_transferable_html() {
DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans); DOMWindowUtils.sendContentCommandEvent("pasteTransferable", trans);
yield ContentTask.spawn(browser, null, function* () { yield ContentTask.spawn(browser, null, function* () {
let textArea = content.document.querySelector('div'); let textArea = content.document.querySelector("div");
is(textArea.innerHTML, "<b>Bold Text</b><i>italics</i>", is(textArea.innerHTML, "<b>Bold Text</b><i>italics</i>",
"Send content command pasteTransferable successful"); "Send content command pasteTransferable successful");
}); });

View file

@ -10,12 +10,12 @@ var gTests = [
{ desc: "Urlbar strips newlines and surrounding whitespace", { desc: "Urlbar strips newlines and surrounding whitespace",
element: gURLBar, element: gURLBar,
expected: kTestString.replace(/\s*\n\s*/g, '') expected: kTestString.replace(/\s*\n\s*/g, "")
}, },
{ desc: "Searchbar replaces newlines with spaces", { desc: "Searchbar replaces newlines with spaces",
element: document.getElementById('searchbar'), element: document.getElementById("searchbar"),
expected: kTestString.replace(/\n/g, ' ') expected: kTestString.replace(/\n/g, " ")
}, },
]; ];

View file

@ -1,8 +1,8 @@
/* Tests for proper behaviour of "Show this frame" context menu options */ /* Tests for proper behaviour of "Show this frame" context menu options */
// Two frames, one with text content, the other an error page // Two frames, one with text content, the other an error page
var invalidPage = 'http://127.0.0.1:55555/'; var invalidPage = "http://127.0.0.1:55555/";
var validPage = 'http://example.com/'; var validPage = "http://example.com/";
var testPage = 'data:text/html,<frameset cols="400,400"><frame src="' + validPage + '"><frame src="' + invalidPage + '"></frameset>'; var testPage = 'data:text/html,<frameset cols="400,400"><frame src="' + validPage + '"><frame src="' + invalidPage + '"></frameset>';
// Store the tab and window created in tests 2 and 3 respectively // Store the tab and window created in tests 2 and 3 respectively

View file

@ -7,9 +7,9 @@
*/ */
// Default focus on a button and have it kill itself on blur. // Default focus on a button and have it kill itself on blur.
const URL = 'data:text/html;charset=utf-8,' + const URL = "data:text/html;charset=utf-8," +
'<body><button onblur="this.remove()">' + '<body><button onblur="this.remove()">' +
'<script>document.body.firstChild.focus()</script></body>'; "<script>document.body.firstChild.focus()</script></body>";
function getFocusedLocalName(browser) { function getFocusedLocalName(browser) {
return ContentTask.spawn(browser, null, function* () { return ContentTask.spawn(browser, null, function* () {

View file

@ -13,13 +13,13 @@ const { REQUIRE_SIGNING } = Cu.import("resource://gre/modules/addons/AddonConsta
const { Task } = Cu.import("resource://gre/modules/Task.jsm", {}); const { Task } = Cu.import("resource://gre/modules/Task.jsm", {});
var rootDir = getRootDirectory(gTestPath); var rootDir = getRootDirectory(gTestPath);
var rootPath = rootDir.split('/'); var rootPath = rootDir.split("/");
var chromeName = rootPath[0] + '//' + rootPath[2]; var chromeName = rootPath[0] + "//" + rootPath[2];
var croot = chromeName + "/content/browser/toolkit/mozapps/extensions/test/xpinstall/"; var croot = chromeName + "/content/browser/toolkit/mozapps/extensions/test/xpinstall/";
var jar = getJar(croot); var jar = getJar(croot);
if (jar) { if (jar) {
var tmpdir = extractJarToTmp(jar); var tmpdir = extractJarToTmp(jar);
croot = 'file://' + tmpdir.path + '/'; croot = "file://" + tmpdir.path + "/";
} }
const CHROMEROOT = croot; const CHROMEROOT = croot;

View file

@ -1,14 +1,14 @@
var gInvalidFormPopup = document.getElementById('invalid-form-popup'); var gInvalidFormPopup = document.getElementById("invalid-form-popup");
ok(gInvalidFormPopup, ok(gInvalidFormPopup,
"The browser should have a popup to show when a form is invalid"); "The browser should have a popup to show when a form is invalid");
function checkPopupShow() { function checkPopupShow() {
ok(gInvalidFormPopup.state == 'showing' || gInvalidFormPopup.state == 'open', ok(gInvalidFormPopup.state == "showing" || gInvalidFormPopup.state == "open",
"[Test " + testId + "] The invalid form popup should be shown"); "[Test " + testId + "] The invalid form popup should be shown");
} }
function checkPopupHide() { function checkPopupHide() {
ok(gInvalidFormPopup.state != 'showing' && gInvalidFormPopup.state != 'open', ok(gInvalidFormPopup.state != "showing" && gInvalidFormPopup.state != "open",
"[Test " + testId + "] The invalid form popup should not be shown"); "[Test " + testId + "] The invalid form popup should not be shown");
} }
@ -51,24 +51,24 @@ function* openNewTab(uri, background) {
function* clickChildElement(browser) { function* clickChildElement(browser) {
yield ContentTask.spawn(browser, {}, function* () { yield ContentTask.spawn(browser, {}, function* () {
content.document.getElementById('s').click(); content.document.getElementById("s").click();
}); });
} }
function* blurChildElement(browser) { function* blurChildElement(browser) {
yield ContentTask.spawn(browser, {}, function* () { yield ContentTask.spawn(browser, {}, function* () {
content.document.getElementById('i').blur(); content.document.getElementById("i").blur();
}); });
} }
function* checkChildFocus(browser, message) { function* checkChildFocus(browser, message) {
yield ContentTask.spawn(browser, [message, testId], function* (args) { yield ContentTask.spawn(browser, [message, testId], function* (args) {
let [msg, id] = args; let [msg, id] = args;
var focused = content.document.activeElement == content.document.getElementById('i'); var focused = content.document.activeElement == content.document.getElementById("i");
var validMsg = true; var validMsg = true;
if (msg) { if (msg) {
validMsg = (msg == content.document.getElementById('i').validationMessage); validMsg = (msg == content.document.getElementById("i").validationMessage);
} }
Assert.equal(focused, true, "Test " + id + " First invalid element should be focused"); Assert.equal(focused, true, "Test " + id + " First invalid element should be focused");
@ -285,7 +285,7 @@ add_task(function* () {
Services.obs.addObserver(gObserver, "invalidformsubmit", false); Services.obs.addObserver(gObserver, "invalidformsubmit", false);
executeSoon(function() { executeSoon(function() {
browser.contentDocument.getElementById('s').click(); browser.contentDocument.getElementById("s").click();
}); });
}); });
@ -330,8 +330,8 @@ add_task(function* () {
checkPopupShow(); checkPopupShow();
yield checkChildFocus(browser, gInvalidFormPopup.firstChild.textContent); yield checkChildFocus(browser, gInvalidFormPopup.firstChild.textContent);
let inputPromise = promiseWaitForEvent(gBrowser.contentDocument.getElementById('i'), "input"); let inputPromise = promiseWaitForEvent(gBrowser.contentDocument.getElementById("i"), "input");
EventUtils.synthesizeKey('f', {}); EventUtils.synthesizeKey("f", {});
yield inputPromise; yield inputPromise;
// Now, the element suffers from another error, the message should have // Now, the element suffers from another error, the message should have

View file

@ -4,7 +4,7 @@
add_task(function* () { add_task(function* () {
let uri = "<iframe src=\"data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input required id='i'><input id='s' type='submit'></form>\"</iframe>"; let uri = "<iframe src=\"data:text/html,<iframe name='t'></iframe><form target='t' action='data:text/html,'><input required id='i'><input id='s' type='submit'></form>\"</iframe>";
var gInvalidFormPopup = document.getElementById('invalid-form-popup'); var gInvalidFormPopup = document.getElementById("invalid-form-popup");
ok(gInvalidFormPopup, ok(gInvalidFormPopup,
"The browser should have a popup to show when a form is invalid"); "The browser should have a popup to show when a form is invalid");
@ -17,18 +17,18 @@ add_task(function* () {
let popupShownPromise = promiseWaitForEvent(gInvalidFormPopup, "popupshown"); let popupShownPromise = promiseWaitForEvent(gInvalidFormPopup, "popupshown");
yield ContentTask.spawn(browser, {}, function* () { yield ContentTask.spawn(browser, {}, function* () {
content.document.getElementsByTagName('iframe')[0] content.document.getElementsByTagName("iframe")[0]
.contentDocument.getElementById('s').click(); .contentDocument.getElementById("s").click();
}); });
yield popupShownPromise; yield popupShownPromise;
yield ContentTask.spawn(browser, {}, function* () { yield ContentTask.spawn(browser, {}, function* () {
let childdoc = content.document.getElementsByTagName('iframe')[0].contentDocument; let childdoc = content.document.getElementsByTagName("iframe")[0].contentDocument;
Assert.equal(childdoc.activeElement, childdoc.getElementById("i"), Assert.equal(childdoc.activeElement, childdoc.getElementById("i"),
"First invalid element should be focused"); "First invalid element should be focused");
}); });
ok(gInvalidFormPopup.state == 'showing' || gInvalidFormPopup.state == 'open', ok(gInvalidFormPopup.state == "showing" || gInvalidFormPopup.state == "open",
"The invalid form popup should be shown"); "The invalid form popup should be shown");
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();

View file

@ -11,10 +11,10 @@ function test() {
return new Promise(resolve => { return new Promise(resolve => {
info("Running content task"); info("Running content task");
let listener = e => { let listener = e => {
removeEventListener('AboutNetErrorLoad', listener, false, true); removeEventListener("AboutNetErrorLoad", listener, false, true);
resolve(); resolve();
}; };
addEventListener('AboutNetErrorLoad', listener, false, true); addEventListener("AboutNetErrorLoad", listener, false, true);
let iframe = content.document.querySelector("iframe"); let iframe = content.document.querySelector("iframe");
iframe.src = "https://expired.example.com/"; iframe.src = "https://expired.example.com/";
}); });
@ -24,7 +24,7 @@ function test() {
function testIframeCert(e) { function testIframeCert(e) {
// Confirm that the expert section is hidden // Confirm that the expert section is hidden
var doc = gBrowser.contentDocument.getElementsByTagName('iframe')[0].contentDocument; var doc = gBrowser.contentDocument.getElementsByTagName("iframe")[0].contentDocument;
var aP = doc.getElementById("badCertAdvancedPanel"); var aP = doc.getElementById("badCertAdvancedPanel");
ok(aP, "Advanced content should exist"); ok(aP, "Advanced content should exist");
is_element_hidden(aP, "Advanced content should not be visible by default") is_element_hidden(aP, "Advanced content should not be visible by default")

View file

@ -52,10 +52,10 @@ function MixedTest1A() {
gIdentityHandler.disableMixedContentProtection(); gIdentityHandler.disableMixedContentProtection();
} }
function MixedTest1B() { function MixedTest1B() {
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1"); waitForCondition(() => content.document.getElementById("p1").innerHTML == "hello", MixedTest1C, "Waited too long for mixed script to run in Test 1");
} }
function MixedTest1C() { function MixedTest1C() {
ok(content.document.getElementById('p1').innerHTML == "hello", "Mixed script didn't load in Test 1"); ok(content.document.getElementById("p1").innerHTML == "hello", "Mixed script didn't load in Test 1");
gTestBrowser.removeEventListener("load", MixedTest1B, true); gTestBrowser.removeEventListener("load", MixedTest1B, true);
MixedTest2(); MixedTest2();
} }
@ -89,14 +89,14 @@ function MixedTest3A() {
gIdentityHandler.disableMixedContentProtection(); gIdentityHandler.disableMixedContentProtection();
} }
function MixedTest3B() { function MixedTest3B() {
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3"); waitForCondition(() => content.document.getElementById("p1").innerHTML == "hello", MixedTest3C, "Waited too long for mixed script to run in Test 3");
} }
function MixedTest3C() { function MixedTest3C() {
waitForCondition(() => content.document.getElementById('p2').innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3"); waitForCondition(() => content.document.getElementById("p2").innerHTML == "bye", MixedTest3D, "Waited too long for mixed image to load in Test 3");
} }
function MixedTest3D() { function MixedTest3D() {
ok(content.document.getElementById('p1').innerHTML == "hello", "Mixed script didn't load in Test 3"); ok(content.document.getElementById("p1").innerHTML == "hello", "Mixed script didn't load in Test 3");
ok(content.document.getElementById('p2').innerHTML == "bye", "Mixed image didn't load in Test 3"); ok(content.document.getElementById("p2").innerHTML == "bye", "Mixed image didn't load in Test 3");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: true});
MixedTest4(); MixedTest4();
} }
@ -125,10 +125,10 @@ function MixedTest4C() {
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: false, activeBlocked: true, passiveLoaded: false});
waitForCondition(() => content.document.getElementById('p1').innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!"); waitForCondition(() => content.document.getElementById("p1").innerHTML == "", MixedTest4D, "Mixed script loaded in test 4 after location change!");
} }
function MixedTest4D() { function MixedTest4D() {
ok(content.document.getElementById('p1').innerHTML == "", "p1.innerHTML changed; mixed script loaded after location change in Test 4"); ok(content.document.getElementById("p1").innerHTML == "", "p1.innerHTML changed; mixed script loaded after location change in Test 4");
MixedTest5(); MixedTest5();
} }
@ -149,10 +149,10 @@ function MixedTest5A() {
gIdentityHandler.disableMixedContentProtection(); gIdentityHandler.disableMixedContentProtection();
} }
function MixedTest5B() { function MixedTest5B() {
waitForCondition(() => content.document.getElementById('p1').innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5"); waitForCondition(() => content.document.getElementById("p1").innerHTML == "hello", MixedTest5C, "Waited too long for mixed script to run in Test 5");
} }
function MixedTest5C() { function MixedTest5C() {
ok(content.document.getElementById('p1').innerHTML == "hello", "Mixed script didn't load in Test 5"); ok(content.document.getElementById("p1").innerHTML == "hello", "Mixed script didn't load in Test 5");
MixedTest6(); MixedTest6();
} }
@ -182,14 +182,14 @@ function MixedTest6C() {
gTestBrowser.removeEventListener("load", MixedTest6C, true); gTestBrowser.removeEventListener("load", MixedTest6C, true);
waitForCondition(function() { waitForCondition(function() {
try { try {
return content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello"; return content.document.getElementById("f1").contentDocument.getElementById("p1").innerHTML == "hello";
} catch (e) { } catch (e) {
return false; return false;
} }
}, MixedTest6D, "Waited too long for mixed script to run in Test 6"); }, MixedTest6D, "Waited too long for mixed script to run in Test 6");
} }
function MixedTest6D() { function MixedTest6D() {
ok(content.document.getElementById('f1').contentDocument.getElementById('p1').innerHTML == "hello", "Mixed script didn't load in Test 6"); ok(content.document.getElementById("f1").contentDocument.getElementById("p1").innerHTML == "hello", "Mixed script didn't load in Test 6");
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
MixedTestsCompleted(); MixedTestsCompleted();
} }

View file

@ -46,10 +46,10 @@ function continueTest() {
doc.defaultView.addEventListener("StyleSheetAdded", unexpectedContentEvent); doc.defaultView.addEventListener("StyleSheetAdded", unexpectedContentEvent);
doc.defaultView.addEventListener("StyleSheetRemoved", unexpectedContentEvent); doc.defaultView.addEventListener("StyleSheetRemoved", unexpectedContentEvent);
doc.defaultView.addEventListener("StyleSheetApplicableStateChanged", unexpectedContentEvent); doc.defaultView.addEventListener("StyleSheetApplicableStateChanged", unexpectedContentEvent);
let link = doc.createElement('link'); let link = doc.createElement("link");
link.setAttribute('rel', 'stylesheet'); link.setAttribute("rel", "stylesheet");
link.setAttribute('type', 'text/css'); link.setAttribute("type", "text/css");
link.setAttribute('href', gTestRoot + gStyleSheet); link.setAttribute("href", gTestRoot + gStyleSheet);
gLinkElement = link; gLinkElement = link;
gBrowser.addEventListener("StyleSheetAdded", dynamicStylesheetAdded, true); gBrowser.addEventListener("StyleSheetAdded", dynamicStylesheetAdded, true);

View file

@ -57,12 +57,12 @@ function test1A() {
function test1B() { function test1B() {
var expected = "Mixed Content Blocker disabled"; var expected = "Mixed Content Blocker disabled";
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test1C, "Error: Waited too long for mixed script to run in Test 1B"); test1C, "Error: Waited too long for mixed script to run in Test 1B");
} }
function test1C() { function test1C() {
var actual = content.document.getElementById('mctestdiv').innerHTML; var actual = content.document.getElementById("mctestdiv").innerHTML;
is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1C"); is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1C");
// The Script loaded after we disabled the page, now we are going to reload the // The Script loaded after we disabled the page, now we are going to reload the
@ -78,7 +78,7 @@ function test1D() {
// because our decision of disabling the mixed content blocker is persistent. // because our decision of disabling the mixed content blocker is persistent.
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
var actual = content.document.getElementById('mctestdiv').innerHTML; var actual = content.document.getElementById("mctestdiv").innerHTML;
is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1D"); is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 1D");
// move on to Test 2 // move on to Test 2
@ -106,12 +106,12 @@ function test2A() {
function test2B() { function test2B() {
var expected = "Mixed Content Blocker disabled"; var expected = "Mixed Content Blocker disabled";
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test2C, "Error: Waited too long for mixed script to run in Test 2B"); test2C, "Error: Waited too long for mixed script to run in Test 2B");
} }
function test2C() { function test2C() {
var actual = content.document.getElementById('mctestdiv').innerHTML; var actual = content.document.getElementById("mctestdiv").innerHTML;
is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 2C"); is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 2C");
// The Script loaded after we disabled the page, now we are going to reload the // The Script loaded after we disabled the page, now we are going to reload the
@ -128,7 +128,7 @@ function test2D() {
// because our decision of disabling the mixed content blocker is persistent. // because our decision of disabling the mixed content blocker is persistent.
assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false}); assertMixedContentBlockingState(gTestBrowser, {activeLoaded: true, activeBlocked: false, passiveLoaded: false});
var actual = content.document.getElementById('mctestdiv').innerHTML; var actual = content.document.getElementById("mctestdiv").innerHTML;
is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 2D"); is(actual, "Mixed Content Blocker disabled", "OK: Executed mixed script in Test 2D");
// move on to Test 3 // move on to Test 3

View file

@ -34,7 +34,7 @@ function* doTest(parentTabSpec, childTabSpec, testTaskFn, waitForMetaRefresh) {
yield promiseReloaded; yield promiseReloaded;
// Wait for the script in the page to update the contents of the test div. // Wait for the script in the page to update the contents of the test div.
let testDiv = content.document.getElementById('mctestdiv'); let testDiv = content.document.getElementById("mctestdiv");
yield promiseWaitForCondition( yield promiseWaitForCondition(
() => testDiv.innerHTML == "Mixed Content Blocker disabled"); () => testDiv.innerHTML == "Mixed Content Blocker disabled");
@ -120,7 +120,7 @@ add_task(function* test_same_origin() {
activeLoaded: true, activeBlocked: false, passiveLoaded: false, activeLoaded: true, activeBlocked: false, passiveLoaded: false,
}); });
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker disabled", "OK: Executed mixed script"); "Mixed Content Blocker disabled", "OK: Executed mixed script");
}); });
}); });
@ -141,7 +141,7 @@ add_task(function* test_different_origin() {
activeLoaded: false, activeBlocked: true, passiveLoaded: false, activeLoaded: false, activeBlocked: true, passiveLoaded: false,
}); });
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker enabled", "OK: Blocked mixed script"); "Mixed Content Blocker enabled", "OK: Blocked mixed script");
}); });
}); });
@ -162,7 +162,7 @@ add_task(function* test_same_origin_metarefresh_same_origin() {
activeLoaded: true, activeBlocked: false, passiveLoaded: false, activeLoaded: true, activeBlocked: false, passiveLoaded: false,
}); });
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker disabled", "OK: Executed mixed script"); "Mixed Content Blocker disabled", "OK: Executed mixed script");
}, true); }, true);
}); });
@ -182,7 +182,7 @@ add_task(function* test_same_origin_metarefresh_different_origin() {
activeLoaded: false, activeBlocked: true, passiveLoaded: false, activeLoaded: false, activeBlocked: true, passiveLoaded: false,
}); });
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker enabled", "OK: Blocked mixed script"); "Mixed Content Blocker enabled", "OK: Blocked mixed script");
}, true); }, true);
}); });
@ -202,7 +202,7 @@ add_task(function* test_same_origin_302redirect_same_origin() {
ok(!gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"), ok(!gIdentityHandler._identityBox.classList.contains("mixedActiveBlocked"),
"OK: Mixed Content is NOT being blocked"); "OK: Mixed Content is NOT being blocked");
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker disabled", "OK: Executed mixed script"); "Mixed Content Blocker disabled", "OK: Executed mixed script");
}); });
}); });
@ -222,7 +222,7 @@ add_task(function* test_same_origin_302redirect_different_origin() {
activeLoaded: false, activeBlocked: true, passiveLoaded: false, activeLoaded: false, activeBlocked: true, passiveLoaded: false,
}); });
is(content.document.getElementById('mctestdiv').innerHTML, is(content.document.getElementById("mctestdiv").innerHTML,
"Mixed Content Blocker enabled", "OK: Blocked mixed script"); "Mixed Content Blocker enabled", "OK: Blocked mixed script");
}); });
}); });

View file

@ -149,7 +149,7 @@ add_task(function*() {
if (clipboardData.getData("text/html") !== arg.htmlPrefix + if (clipboardData.getData("text/html") !== arg.htmlPrefix +
'<img id="img" tabindex="1" src="http://example.org/browser/browser/base/content/test/general/moz.png">' + '<img id="img" tabindex="1" src="http://example.org/browser/browser/base/content/test/general/moz.png">' +
arg.htmlPostfix) { arg.htmlPostfix) {
reject('Clipboard Data did not contain an image, was ' + clipboardData.getData("text/html")); reject("Clipboard Data did not contain an image, was " + clipboardData.getData("text/html"));
} }
resolve(); resolve();
}, true) }, true)
@ -166,7 +166,7 @@ add_task(function*() {
// The new content should now include an image. // The new content should now include an image.
Assert.equal(main.innerHTML, '<i>Italic</i> <img id="img" tabindex="1" ' + Assert.equal(main.innerHTML, '<i>Italic</i> <img id="img" tabindex="1" ' +
'src="http://example.org/browser/browser/base/content/test/general/moz.png">' + 'src="http://example.org/browser/browser/base/content/test/general/moz.png">' +
'Test <b>Bold</b> After<b></b>', "Paste after copy image"); "Test <b>Bold</b> After<b></b>", "Paste after copy image");
}); });
gBrowser.removeCurrentTab(); gBrowser.removeCurrentTab();

View file

@ -21,7 +21,7 @@ function setup() {
gPrefService.setBoolPref("browser.altClickSave", true); gPrefService.setBoolPref("browser.altClickSave", true);
let testPage = let testPage =
'data:text/html,' + "data:text/html," +
'<p><a id="commonlink" href="http://mochi.test/moz/">Common link</a></p>' + '<p><a id="commonlink" href="http://mochi.test/moz/">Common link</a></p>' +
'<p><math id="mathxlink" xmlns="http://www.w3.org/1998/Math/MathML" xlink:type="simple" xlink:href="http://mochi.test/moz/"><mtext>MathML XLink</mtext></math></p>' + '<p><math id="mathxlink" xmlns="http://www.w3.org/1998/Math/MathML" xlink:type="simple" xlink:href="http://mochi.test/moz/"><mtext>MathML XLink</mtext></math></p>' +
'<p><svg id="svgxlink" xmlns="http://www.w3.org/2000/svg" width="100px" height="50px" version="1.1"><a xlink:type="simple" xlink:href="http://mochi.test/moz/"><text transform="translate(10, 25)">SVG XLink</text></a></svg></p>'; '<p><svg id="svgxlink" xmlns="http://www.w3.org/2000/svg" width="100px" height="50px" version="1.1"><a xlink:type="simple" xlink:href="http://mochi.test/moz/"><text transform="translate(10, 25)">SVG XLink</text></a></svg></p>';

View file

@ -49,7 +49,7 @@ function test() {
waitForExplicitFinish(); waitForExplicitFinish();
SpecialPowers.pushPrefEnv( SpecialPowers.pushPrefEnv(
{ 'set': [["security.mixed_content.block_active_content", true]] }, { "set": [["security.mixed_content.block_active_content", true]] },
function() { runTests(); } function() { runTests(); }
); );
} }

View file

@ -44,7 +44,7 @@ function runIconDiscoveryTest() {
else else
ok(!hasSrc, testCase.text); ok(!hasSrc, testCase.text);
head.removeChild(head.getElementsByTagName('link')[0]); head.removeChild(head.getElementsByTagName("link")[0]);
iconDiscoveryTests.shift(); iconDiscoveryTests.shift();
iconDiscovery(); // Run the next test. iconDiscovery(); // Run the next test.
} }

View file

@ -147,7 +147,7 @@ add_task(function* () {
let sidebar = document.getElementById("sidebar"); let sidebar = document.getElementById("sidebar");
let loadPromise = BrowserTestUtils.waitForEvent(sidebar, "load", true); let loadPromise = BrowserTestUtils.waitForEvent(sidebar, "load", true);
SidebarUI.toggle('viewBookmarksSidebar'); SidebarUI.toggle("viewBookmarksSidebar");
yield loadPromise; yield loadPromise;
@ -169,7 +169,7 @@ add_task(function* () {
yield* expectFocusOnF6(true, "main-window", gURLBar.inputField, yield* expectFocusOnF6(true, "main-window", gURLBar.inputField,
false, "back focus with sidebar urlbar"); false, "back focus with sidebar urlbar");
SidebarUI.toggle('viewBookmarksSidebar'); SidebarUI.toggle("viewBookmarksSidebar");
}); });
// Navigate when the downloads panel is open // Navigate when the downloads panel is open

View file

@ -140,7 +140,7 @@ var gTests = [
// It should have passed in the expected non-matching state value. // It should have passed in the expected non-matching state value.
let queryString = gBrowser.currentURI.spec.split("?")[1]; let queryString = gBrowser.currentURI.spec.split("?")[1];
Assert.ok(queryString.indexOf('state=different-state') >= 0); Assert.ok(queryString.indexOf("state=different-state") >= 0);
tabOpened = true; tabOpened = true;
}); });
@ -177,8 +177,8 @@ var gTests = [
Assert.ok("Tab successfully opened"); Assert.ok("Tab successfully opened");
// It should have asked for keys. // It should have asked for keys.
let queryString = gBrowser.currentURI.spec.split('?')[1]; let queryString = gBrowser.currentURI.spec.split("?")[1];
Assert.ok(queryString.indexOf('keys=true') >= 0); Assert.ok(queryString.indexOf("keys=true") >= 0);
tabOpened = true; tabOpened = true;
}); });
@ -219,8 +219,8 @@ var gTests = [
Assert.ok("Tab successfully opened"); Assert.ok("Tab successfully opened");
// It should not have asked for keys. // It should not have asked for keys.
let queryString = gBrowser.currentURI.spec.split('?')[1]; let queryString = gBrowser.currentURI.spec.split("?")[1];
Assert.ok(queryString.indexOf('keys=true') == -1); Assert.ok(queryString.indexOf("keys=true") == -1);
tabOpened = true; tabOpened = true;
}); });
@ -260,8 +260,8 @@ var gTests = [
Assert.ok("Tab successfully opened"); Assert.ok("Tab successfully opened");
// It should have asked for keys. // It should have asked for keys.
let queryString = gBrowser.currentURI.spec.split('?')[1]; let queryString = gBrowser.currentURI.spec.split("?")[1];
Assert.ok(queryString.indexOf('keys=true') >= 0); Assert.ok(queryString.indexOf("keys=true") >= 0);
tabOpened = true; tabOpened = true;
}); });

View file

@ -50,12 +50,12 @@ var gTests = [
let promiseLogin = new Promise((resolve, reject) => { let promiseLogin = new Promise((resolve, reject) => {
let login = (accountData) => { let login = (accountData) => {
Assert.equal(typeof accountData.authAt, 'number'); Assert.equal(typeof accountData.authAt, "number");
Assert.equal(accountData.email, 'testuser@testuser.com'); Assert.equal(accountData.email, "testuser@testuser.com");
Assert.equal(accountData.keyFetchToken, 'key_fetch_token'); Assert.equal(accountData.keyFetchToken, "key_fetch_token");
Assert.equal(accountData.sessionToken, 'session_token'); Assert.equal(accountData.sessionToken, "session_token");
Assert.equal(accountData.uid, 'uid'); Assert.equal(accountData.uid, "uid");
Assert.equal(accountData.unwrapBKey, 'unwrap_b_key'); Assert.equal(accountData.unwrapBKey, "unwrap_b_key");
Assert.equal(accountData.verified, true); Assert.equal(accountData.verified, true);
client.tearDown(); client.tearDown();
@ -90,9 +90,9 @@ var gTests = [
// responses sent to content are echoed back over the // responses sent to content are echoed back over the
// `fxaccounts_webchannel_response_echo` channel. Ensure the // `fxaccounts_webchannel_response_echo` channel. Ensure the
// fxaccounts:can_link_account message is responded to. // fxaccounts:can_link_account message is responded to.
let echoWebChannel = new WebChannel('fxaccounts_webchannel_response_echo', webChannelOrigin); let echoWebChannel = new WebChannel("fxaccounts_webchannel_response_echo", webChannelOrigin);
echoWebChannel.listen((webChannelId, message, target) => { echoWebChannel.listen((webChannelId, message, target) => {
Assert.equal(message.command, 'fxaccounts:can_link_account'); Assert.equal(message.command, "fxaccounts:can_link_account");
Assert.equal(message.messageId, 2); Assert.equal(message.messageId, 2);
Assert.equal(message.data.ok, true); Assert.equal(message.data.ok, true);
@ -107,7 +107,7 @@ var gTests = [
channel_id: TEST_CHANNEL_ID, channel_id: TEST_CHANNEL_ID,
helpers: { helpers: {
shouldAllowRelink(acctName) { shouldAllowRelink(acctName) {
return acctName === 'testuser@testuser.com'; return acctName === "testuser@testuser.com";
} }
} }
}); });
@ -126,7 +126,7 @@ var gTests = [
*run() { *run() {
let promiseLogout = new Promise((resolve, reject) => { let promiseLogout = new Promise((resolve, reject) => {
let logout = (uid) => { let logout = (uid) => {
Assert.equal(uid, 'uid'); Assert.equal(uid, "uid");
client.tearDown(); client.tearDown();
resolve(); resolve();
@ -154,7 +154,7 @@ var gTests = [
*run() { *run() {
let promiseDelete = new Promise((resolve, reject) => { let promiseDelete = new Promise((resolve, reject) => {
let logout = (uid) => { let logout = (uid) => {
Assert.equal(uid, 'uid'); Assert.equal(uid, "uid");
client.tearDown(); client.tearDown();
resolve(); resolve();

View file

@ -17,7 +17,7 @@ const TEST_ROOT = "http://example.com/browser/browser/base/content/test/general/
// The stub functions. // The stub functions.
let stubs = { let stubs = {
updateAppMenuItem() { updateAppMenuItem() {
return unstubs['updateAppMenuItem'].call(gFxAccounts).then(() => { return unstubs["updateAppMenuItem"].call(gFxAccounts).then(() => {
Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateAppMenuItem", null); Services.obs.notifyObservers(null, "test:browser_fxaccounts:updateAppMenuItem", null);
}); });
}, },

View file

@ -112,7 +112,7 @@ function checkUIForTest1() {
var expected = "script blocked"; var expected = "script blocked";
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test2, "Error: Waited too long for status in Test 1!", test2, "Error: Waited too long for status in Test 1!",
"OK: Expected result in innerHTML for Test1!"); "OK: Expected result in innerHTML for Test1!");
} }
@ -132,7 +132,7 @@ function checkUIForTest2() {
var expected = "script executed"; var expected = "script executed";
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test3, "Error: Waited too long for status in Test 2!", test3, "Error: Waited too long for status in Test 2!",
"OK: Expected result in innerHTML for Test2!"); "OK: Expected result in innerHTML for Test2!");
} }
@ -150,7 +150,7 @@ function checkLoadEventForTest3() {
var expected = "image blocked" var expected = "image blocked"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test4, "Error: Waited too long for status in Test 3!", test4, "Error: Waited too long for status in Test 3!",
"OK: Expected result in innerHTML for Test3!"); "OK: Expected result in innerHTML for Test3!");
} }
@ -168,7 +168,7 @@ function checkLoadEventForTest4() {
var expected = "image loaded" var expected = "image loaded"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test5, "Error: Waited too long for status in Test 4!", test5, "Error: Waited too long for status in Test 4!",
"OK: Expected result in innerHTML for Test4!"); "OK: Expected result in innerHTML for Test4!");
} }
@ -191,7 +191,7 @@ function checkLoadEventForTest5() {
var expected = "image loaded" var expected = "image loaded"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test6, "Error: Waited too long for status in Test 5!", test6, "Error: Waited too long for status in Test 5!",
"OK: Expected result in innerHTML for Test5!"); "OK: Expected result in innerHTML for Test5!");
// Go back online // Go back online
@ -216,7 +216,7 @@ function checkLoadEventForTest6() {
var expected = "image blocked" var expected = "image blocked"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test7, "Error: Waited too long for status in Test 6!", test7, "Error: Waited too long for status in Test 6!",
"OK: Expected result in innerHTML for Test6!"); "OK: Expected result in innerHTML for Test6!");
// Go back online // Go back online
@ -236,7 +236,7 @@ function checkLoadEventForTest7() {
var expected = "image loaded" var expected = "image loaded"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test8, "Error: Waited too long for status in Test 7!", test8, "Error: Waited too long for status in Test 7!",
"OK: Expected result in innerHTML for Test7!"); "OK: Expected result in innerHTML for Test7!");
} }
@ -259,7 +259,7 @@ function checkLoadEventForTest8() {
var expected = "image loaded" var expected = "image loaded"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
test9, "Error: Waited too long for status in Test 8!", test9, "Error: Waited too long for status in Test 8!",
"OK: Expected result in innerHTML for Test8!"); "OK: Expected result in innerHTML for Test8!");
// Go back online // Go back online
@ -284,7 +284,7 @@ function checkLoadEventForTest9() {
var expected = "image blocked" var expected = "image blocked"
waitForCondition( waitForCondition(
() => content.document.getElementById('mctestdiv').innerHTML == expected, () => content.document.getElementById("mctestdiv").innerHTML == expected,
cleanUpAfterTests, "Error: Waited too long for status in Test 9!", cleanUpAfterTests, "Error: Waited too long for status in Test 9!",
"OK: Expected result in innerHTML for Test9!"); "OK: Expected result in innerHTML for Test9!");
// Go back online // Go back online

View file

@ -69,7 +69,7 @@ function test1A() {
var expected = "Verifying MCB does not trigger warning/error for an http page "; var expected = "Verifying MCB does not trigger warning/error for an http page ";
expected += "with https css that includes http image"; expected += "with https css that includes http image";
waitForCondition( waitForCondition(
() => content.document.getElementById('testDiv').innerHTML == expected, () => content.document.getElementById("testDiv").innerHTML == expected,
test1B, "Error: Waited too long for status in Test 1!", test1B, "Error: Waited too long for status in Test 1!",
"OK: Expected result in innerHTML!"); "OK: Expected result in innerHTML!");
} }
@ -89,7 +89,7 @@ function test2A() {
var expected = "Verifying MCB does not trigger warning/error for an http page "; var expected = "Verifying MCB does not trigger warning/error for an http page ";
expected += "with https css that includes http font"; expected += "with https css that includes http font";
waitForCondition( waitForCondition(
() => content.document.getElementById('testDiv').innerHTML == expected, () => content.document.getElementById("testDiv").innerHTML == expected,
test2B, "Error: Waited too long for status in Test 2!", test2B, "Error: Waited too long for status in Test 2!",
"OK: Expected result in innerHTML!"); "OK: Expected result in innerHTML!");
} }
@ -109,7 +109,7 @@ function test3() {
var expected = "Verifying MCB does not trigger warning/error for an http page " var expected = "Verifying MCB does not trigger warning/error for an http page "
expected += "with https css that imports another http css which includes http font"; expected += "with https css that imports another http css which includes http font";
waitForCondition( waitForCondition(
() => content.document.getElementById('testDiv').innerHTML == expected, () => content.document.getElementById("testDiv").innerHTML == expected,
cleanUpAfterTests, "Error: Waited too long for status in Test 3!", cleanUpAfterTests, "Error: Waited too long for status in Test 3!",
"OK: Expected result in innerHTML!"); "OK: Expected result in innerHTML!");
} }

View file

@ -62,7 +62,7 @@ function test() {
}); });
gotCached.then(function() { gotCached.then(function() {
// We got cached - now we should have provoked the quota warning. // We got cached - now we should have provoked the quota warning.
let notification = PopupNotifications.getNotification('offline-app-usage'); let notification = PopupNotifications.getNotification("offline-app-usage");
ok(notification, "have offline-app-usage notification"); ok(notification, "have offline-app-usage notification");
// select the default action - this should cause the preferences // select the default action - this should cause the preferences
// tab to open - which we track via an "Initialized" event. // tab to open - which we track via an "Initialized" event.

View file

@ -54,7 +54,7 @@ add_task(function*() {
// after the parent has been updated by yielding until the child // after the parent has been updated by yielding until the child
// has finished running a ContentTask for us. // has finished running a ContentTask for us.
yield ContentTask.spawn(browser, {}, function*() { yield ContentTask.spawn(browser, {}, function*() {
dump('\nJust wasting some time.\n'); dump("\nJust wasting some time.\n");
}); });
gPageStyleMenu.fillPopup(menupopup); gPageStyleMenu.fillPopup(menupopup);

View file

@ -139,7 +139,7 @@ function getBaseUriForChromeUri(chromeUri) {
function parseManifest(manifestUri) { function parseManifest(manifestUri) {
return fetchFile(manifestUri.spec).then(data => { return fetchFile(manifestUri.spec).then(data => {
for (let line of data.split('\n')) { for (let line of data.split("\n")) {
let [type, ...argv] = line.split(/\s+/); let [type, ...argv] = line.split(/\s+/);
let component; let component;
if (type == "content" || type == "skin") { if (type == "content" || type == "skin") {
@ -261,7 +261,7 @@ add_task(function* checkAllTheCSS() {
let windowless = Services.appShell.createWindowlessBrowser(); let windowless = Services.appShell.createWindowlessBrowser();
let iframe = windowless.document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe"); let iframe = windowless.document.createElementNS("http://www.w3.org/1999/xhtml", "html:iframe");
windowless.document.documentElement.appendChild(iframe); windowless.document.documentElement.appendChild(iframe);
let iframeLoaded = once(iframe, 'load'); let iframeLoaded = once(iframe, "load");
iframe.contentWindow.location = testFile; iframe.contentWindow.location = testFile;
yield iframeLoaded; yield iframeLoaded;
let doc = iframe.contentWindow.document; let doc = iframe.contentWindow.document;
@ -364,7 +364,7 @@ add_task(function* checkAllTheCSS() {
// Clean up to avoid leaks: // Clean up to avoid leaks:
iframe.remove(); iframe.remove();
doc.head.innerHTML = ''; doc.head.innerHTML = "";
doc = null; doc = null;
iframe = null; iframe = null;
windowless.close(); windowless.close();

View file

@ -64,7 +64,7 @@ add_task(function*() {
updateChannel = Cu.import("resource://gre/modules/UpdateUtils.jsm", {}).UpdateUtils.UpdateChannel; updateChannel = Cu.import("resource://gre/modules/UpdateUtils.jsm", {}).UpdateUtils.UpdateChannel;
} catch (ex) {} } catch (ex) {}
if (!updateChannel) { if (!updateChannel) {
Assert.ok(!('updateChannel' in got.message.application), Assert.ok(!("updateChannel" in got.message.application),
"should not have update channel where not available."); "should not have update channel where not available.");
} else { } else {
Assert.equal(got.message.application.updateChannel, updateChannel, Assert.equal(got.message.application.updateChannel, updateChannel,

View file

@ -6,7 +6,7 @@ const {TabStateFlusher} = Cu.import("resource:///modules/sessionstore/TabStateFl
const DUMMY = "http://example.com/browser/browser/base/content/test/general/dummy_page.html"; const DUMMY = "http://example.com/browser/browser/base/content/test/general/dummy_page.html";
function getMinidumpDirectory() { function getMinidumpDirectory() {
let dir = Services.dirsvc.get('ProfD', Ci.nsIFile); let dir = Services.dirsvc.get("ProfD", Ci.nsIFile);
dir.append("minidumps"); dir.append("minidumps");
return dir; return dir;
} }
@ -15,9 +15,9 @@ function getMinidumpDirectory() {
// the testrunner thinks things are peachy. // the testrunner thinks things are peachy.
var CrashObserver = { var CrashObserver = {
observe(subject, topic, data) { observe(subject, topic, data) {
is(topic, 'ipc:content-shutdown', 'Received correct observer topic.'); is(topic, "ipc:content-shutdown", "Received correct observer topic.");
ok(subject instanceof Ci.nsIPropertyBag2, ok(subject instanceof Ci.nsIPropertyBag2,
'Subject implements nsIPropertyBag2.'); "Subject implements nsIPropertyBag2.");
// we might see this called as the process terminates due to previous tests. // we might see this called as the process terminates due to previous tests.
// We are only looking for "abnormal" exits... // We are only looking for "abnormal" exits...
if (!subject.hasKey("abnormal")) { if (!subject.hasKey("abnormal")) {
@ -26,26 +26,26 @@ var CrashObserver = {
} }
let dumpID; let dumpID;
if ('nsICrashReporter' in Ci) { if ("nsICrashReporter" in Ci) {
dumpID = subject.getPropertyAsAString('dumpID'); dumpID = subject.getPropertyAsAString("dumpID");
ok(dumpID, "dumpID is present and not an empty string"); ok(dumpID, "dumpID is present and not an empty string");
} }
if (dumpID) { if (dumpID) {
let minidumpDirectory = getMinidumpDirectory(); let minidumpDirectory = getMinidumpDirectory();
let file = minidumpDirectory.clone(); let file = minidumpDirectory.clone();
file.append(dumpID + '.dmp'); file.append(dumpID + ".dmp");
file.remove(true); file.remove(true);
file = minidumpDirectory.clone(); file = minidumpDirectory.clone();
file.append(dumpID + '.extra'); file.append(dumpID + ".extra");
file.remove(true); file.remove(true);
} }
} }
} }
Services.obs.addObserver(CrashObserver, 'ipc:content-shutdown', false); Services.obs.addObserver(CrashObserver, "ipc:content-shutdown", false);
registerCleanupFunction(() => { registerCleanupFunction(() => {
Services.obs.removeObserver(CrashObserver, 'ipc:content-shutdown'); Services.obs.removeObserver(CrashObserver, "ipc:content-shutdown");
}); });
function frameScript() { function frameScript() {

View file

@ -62,7 +62,7 @@ function triggerSave(aWindow, aCallback) {
function onUCTDialog(dialog) { function onUCTDialog(dialog) {
function doLoad() { function doLoad() {
content.document.querySelector('iframe').remove(); content.document.querySelector("iframe").remove();
} }
testBrowser.messageManager.loadFrameScript("data:,(" + doLoad.toString() + ")()", false); testBrowser.messageManager.loadFrameScript("data:,(" + doLoad.toString() + ")()", false);
executeSoon(continueDownloading); executeSoon(continueDownloading);

View file

@ -182,14 +182,14 @@ add_task(function* testButtonActivitiesInNavBar() {
add_task(function* testFormatLastSyncDateNow() { add_task(function* testFormatLastSyncDateNow() {
let now = new Date(); let now = new Date();
let nowString = gSyncUI.formatLastSyncDate(now); let nowString = gSyncUI.formatLastSyncDate(now);
Assert.equal(nowString, "Last sync: " + now.toLocaleDateString(undefined, {weekday: 'long', hour: 'numeric', minute: 'numeric'})); Assert.equal(nowString, "Last sync: " + now.toLocaleDateString(undefined, {weekday: "long", hour: "numeric", minute: "numeric"}));
}); });
add_task(function* testFormatLastSyncDateMonthAgo() { add_task(function* testFormatLastSyncDateMonthAgo() {
let monthAgo = new Date(); let monthAgo = new Date();
monthAgo.setMonth(monthAgo.getMonth() - 1); monthAgo.setMonth(monthAgo.getMonth() - 1);
let monthAgoString = gSyncUI.formatLastSyncDate(monthAgo); let monthAgoString = gSyncUI.formatLastSyncDate(monthAgo);
Assert.equal(monthAgoString, "Last sync: " + monthAgo.toLocaleDateString(undefined, {month: 'long', day: 'numeric'})); Assert.equal(monthAgoString, "Last sync: " + monthAgo.toLocaleDateString(undefined, {month: "long", day: "numeric"}));
}); });
add_task(function* testButtonActivitiesInPanel() { add_task(function* testButtonActivitiesInPanel() {

View file

@ -330,7 +330,7 @@ add_task(function*() {
window.removeEventListener("pageshow", navigationOccured, true); window.removeEventListener("pageshow", navigationOccured, true);
resolve(); resolve();
}, true); }, true);
document.getElementById('Browser:Back').doCommand(); document.getElementById("Browser:Back").doCommand();
}); });
is(window.document.activeElement, gURLBar.inputField, "urlbar still focused after navigating back"); is(window.document.activeElement, gURLBar.inputField, "urlbar still focused after navigating back");

View file

@ -18,7 +18,7 @@ function waitForSecurityChange(numChanges = 1) {
} }
add_task(function* test_fetch() { add_task(function* test_fetch() {
yield SpecialPowers.pushPrefEnv({ set: [['privacy.trackingprotection.enabled', true]] }); yield SpecialPowers.pushPrefEnv({ set: [["privacy.trackingprotection.enabled", true]] });
yield BrowserTestUtils.withNewTab({ gBrowser, url: URL }, function* (newTabBrowser) { yield BrowserTestUtils.withNewTab({ gBrowser, url: URL }, function* (newTabBrowser) {
let securityChange = waitForSecurityChange(); let securityChange = waitForSecurityChange();

View file

@ -52,9 +52,9 @@ addMessageListener("test:check-visibilities", function(message) {
let elt = content.document.getElementById(id); let elt = content.document.getElementById(id);
if (elt) { if (elt) {
let displayStyle = content.window.getComputedStyle(elt).display; let displayStyle = content.window.getComputedStyle(elt).display;
if (displayStyle == 'none') { if (displayStyle == "none") {
result[id] = false; result[id] = false;
} else if (displayStyle == 'block') { } else if (displayStyle == "block") {
result[id] = true; result[id] = true;
} else { } else {
result[id] = "strange: " + displayStyle; // tests should fail! result[id] = "strange: " + displayStyle; // tests should fail!

View file

@ -1 +1 @@
document.getElementById('p1').innerHTML = "hello"; document.getElementById("p1").innerHTML = "hello";

View file

@ -104,7 +104,7 @@ function closeToolbarCustomizationUI(aCallback, aBrowserWin) {
} }
function waitForCondition(condition, nextTest, errorMsg, retryTimes) { function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
retryTimes = typeof retryTimes !== 'undefined' ? retryTimes : 30; retryTimes = typeof retryTimes !== "undefined" ? retryTimes : 30;
var tries = 0; var tries = 0;
var interval = setInterval(function() { var interval = setInterval(function() {
if (tries >= retryTimes) { if (tries >= retryTimes) {

View file

@ -7,7 +7,7 @@ const kBlocklistServiceUUID = "{66354bc9-7ed1-4692-ae1d-8da97d6b205e}";
const kBlocklistServiceContractID = "@mozilla.org/extensions/blocklist;1"; const kBlocklistServiceContractID = "@mozilla.org/extensions/blocklist;1";
const kBlocklistServiceFactory = Cm.getClassObject(Cc[kBlocklistServiceContractID], Ci.nsIFactory); const kBlocklistServiceFactory = Cm.getClassObject(Cc[kBlocklistServiceContractID], Ci.nsIFactory);
Cu.import('resource://gre/modules/XPCOMUtils.jsm'); Cu.import("resource://gre/modules/XPCOMUtils.jsm");
/* /*
* A lightweight blocklist proxy for the testing purposes. * A lightweight blocklist proxy for the testing purposes.

View file

@ -38,14 +38,14 @@ add_task(function* () {
yield ContentTask.spawn(gTestBrowser, {}, function* () { yield ContentTask.spawn(gTestBrowser, {}, function* () {
let doc = content.document; let doc = content.document;
let p = doc.createElement('embed'); let p = doc.createElement("embed");
p.setAttribute('id', 'test'); p.setAttribute("id", "test");
p.setAttribute('type', 'application/x-test'); p.setAttribute("type", "application/x-test");
p.style.left = "0"; p.style.left = "0";
p.style.bottom = "200px"; p.style.bottom = "200px";
doc.getElementById('container').appendChild(p); doc.getElementById("container").appendChild(p);
}); });
// Work around for delayed PluginBindingAttached // Work around for delayed PluginBindingAttached
@ -67,14 +67,14 @@ add_task(function* () {
yield ContentTask.spawn(gTestBrowser, {}, function* () { yield ContentTask.spawn(gTestBrowser, {}, function* () {
let doc = content.document; let doc = content.document;
let p = doc.createElement('embed'); let p = doc.createElement("embed");
p.setAttribute('id', 'test'); p.setAttribute("id", "test");
p.setAttribute('type', 'application/x-test'); p.setAttribute("type", "application/x-test");
p.style.left = "0"; p.style.left = "0";
p.style.bottom = "-410px"; p.style.bottom = "-410px";
doc.getElementById('container').appendChild(p); doc.getElementById("container").appendChild(p);
}); });
// Work around for delayed PluginBindingAttached // Work around for delayed PluginBindingAttached
@ -96,14 +96,14 @@ add_task(function* () {
yield ContentTask.spawn(gTestBrowser, {}, function* () { yield ContentTask.spawn(gTestBrowser, {}, function* () {
let doc = content.document; let doc = content.document;
let p = doc.createElement('embed'); let p = doc.createElement("embed");
p.setAttribute('id', 'test'); p.setAttribute("id", "test");
p.setAttribute('type', 'application/x-test'); p.setAttribute("type", "application/x-test");
p.style.left = "-600px"; p.style.left = "-600px";
p.style.bottom = "0"; p.style.bottom = "0";
doc.getElementById('container').appendChild(p); doc.getElementById("container").appendChild(p);
}); });
// Work around for delayed PluginBindingAttached // Work around for delayed PluginBindingAttached

View file

@ -61,5 +61,5 @@ add_task(function* () {
pluginInfo = yield promiseForPluginInfo("plugin"); pluginInfo = yield promiseForPluginInfo("plugin");
ok(pluginInfo.activated, "plugin should be activated"); ok(pluginInfo.activated, "plugin should be activated");
is(gWrapperClickCount, 0, 'wrapper should not have received any clicks'); is(gWrapperClickCount, 0, "wrapper should not have received any clicks");
}); });

View file

@ -224,7 +224,7 @@ function clearAllPluginPermissions() {
let perms = Services.perms.enumerator; let perms = Services.perms.enumerator;
while (perms.hasMoreElements()) { while (perms.hasMoreElements()) {
let perm = perms.getNext(); let perm = perms.getNext();
if (perm.type.startsWith('plugin')) { if (perm.type.startsWith("plugin")) {
info("removing permission:" + perm.principal.origin + " " + perm.type + "\n"); info("removing permission:" + perm.principal.origin + " " + perm.type + "\n");
Services.perms.removePermission(perm); Services.perms.removePermission(perm);
} }
@ -388,9 +388,9 @@ function promiseForNotificationShown(notification) {
function promiseUpdatePluginBindings(browser) { function promiseUpdatePluginBindings(browser) {
return ContentTask.spawn(browser, {}, function* () { return ContentTask.spawn(browser, {}, function* () {
let doc = content.document; let doc = content.document;
let elems = doc.getElementsByTagName('embed'); let elems = doc.getElementsByTagName("embed");
if (!elems || elems.length < 1) { if (!elems || elems.length < 1) {
elems = doc.getElementsByTagName('object'); elems = doc.getElementsByTagName("object");
} }
if (elems && elems.length > 0) { if (elems && elems.length > 0) {
elems[0].clientTop; elems[0].clientTop;

View file

@ -164,7 +164,7 @@ var tests = [
["checkedState", "uncheckedState"].forEach(function(state) { ["checkedState", "uncheckedState"].forEach(function(state) {
[true, false].forEach(function(checked) { [true, false].forEach(function(checked) {
tests.push( tests.push(
{ id: `checkbox_disableMainAction_${state}_${checked ? 'checked' : 'unchecked'}`, { id: `checkbox_disableMainAction_${state}_${checked ? "checked" : "unchecked"}`,
run() { run() {
this.notifyObj = new BasicNotification(this.id); this.notifyObj = new BasicNotification(this.id);
this.notifyObj.options.checkbox = { this.notifyObj.options.checkbox = {

View file

@ -13,7 +13,7 @@ const REFERRER_POLICYSERVER_URL =
const REFERRER_POLICYSERVER_URL_ATTRIBUTE = const REFERRER_POLICYSERVER_URL_ATTRIBUTE =
"test1.example.com" + REFERRER_URL_BASE + "file_referrer_policyserver_attr.sjs"; "test1.example.com" + REFERRER_URL_BASE + "file_referrer_policyserver_attr.sjs";
SpecialPowers.pushPrefEnv({"set": [['network.http.enablePerElementReferrer', true]]}); SpecialPowers.pushPrefEnv({"set": [["network.http.enablePerElementReferrer", true]]});
var gTestWindow = null; var gTestWindow = null;
var rounds = 0; var rounds = 0;

View file

@ -10,8 +10,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "AboutHomeUtils",
"resource:///modules/AboutHome.jsm"); "resource:///modules/AboutHome.jsm");
var snippet = var snippet =
' <script>' + " <script>" +
' var manifest = {' + " var manifest = {" +
' "name": "Demo Social Service",' + ' "name": "Demo Social Service",' +
' "origin": "https://example.com",' + ' "origin": "https://example.com",' +
' "iconURL": "chrome://branding/content/icon16.png",' + ' "iconURL": "chrome://branding/content/icon16.png",' +
@ -19,21 +19,21 @@ var snippet =
' "icon64URL": "chrome://branding/content/icon64.png",' + ' "icon64URL": "chrome://branding/content/icon64.png",' +
' "shareURL": "https://example.com/browser/browser/base/content/test/social/social_share.html",' + ' "shareURL": "https://example.com/browser/browser/base/content/test/social/social_share.html",' +
' "postActivationURL": "https://example.com/browser/browser/base/content/test/social/social_postActivation.html",' + ' "postActivationURL": "https://example.com/browser/browser/base/content/test/social/social_postActivation.html",' +
' };' + " };" +
' function activateProvider(node) {' + " function activateProvider(node) {" +
' node.setAttribute("data-service", JSON.stringify(manifest));' + ' node.setAttribute("data-service", JSON.stringify(manifest));' +
' var event = new CustomEvent("ActivateSocialFeature");' + ' var event = new CustomEvent("ActivateSocialFeature");' +
' node.dispatchEvent(event);' + " node.dispatchEvent(event);" +
' }' + " }" +
' </script>' + " </script>" +
' <div id="activationSnippet" onclick="activateProvider(this)">' + ' <div id="activationSnippet" onclick="activateProvider(this)">' +
' <img src="chrome://branding/content/icon32.png"></img>' + ' <img src="chrome://branding/content/icon32.png"></img>' +
' </div>'; " </div>";
// enable one-click activation // enable one-click activation
var snippet2 = var snippet2 =
' <script>' + " <script>" +
' var manifest = {' + " var manifest = {" +
' "name": "Demo Social Service",' + ' "name": "Demo Social Service",' +
' "origin": "https://example.com",' + ' "origin": "https://example.com",' +
' "iconURL": "chrome://branding/content/icon16.png",' + ' "iconURL": "chrome://branding/content/icon16.png",' +
@ -42,16 +42,16 @@ var snippet2 =
' "shareURL": "https://example.com/browser/browser/base/content/test/social/social_share.html",' + ' "shareURL": "https://example.com/browser/browser/base/content/test/social/social_share.html",' +
' "postActivationURL": "https://example.com/browser/browser/base/content/test/social/social_postActivation.html",' + ' "postActivationURL": "https://example.com/browser/browser/base/content/test/social/social_postActivation.html",' +
' "oneclick": true' + ' "oneclick": true' +
' };' + " };" +
' function activateProvider(node) {' + " function activateProvider(node) {" +
' node.setAttribute("data-service", JSON.stringify(manifest));' + ' node.setAttribute("data-service", JSON.stringify(manifest));' +
' var event = new CustomEvent("ActivateSocialFeature");' + ' var event = new CustomEvent("ActivateSocialFeature");' +
' node.dispatchEvent(event);' + " node.dispatchEvent(event);" +
' }' + " }" +
' </script>' + " </script>" +
' <div id="activationSnippet" onclick="activateProvider(this)">' + ' <div id="activationSnippet" onclick="activateProvider(this)">' +
' <img src="chrome://branding/content/icon32.png"></img>' + ' <img src="chrome://branding/content/icon32.png"></img>' +
' </div>'; " </div>";
var gTests = [ var gTests = [

View file

@ -37,7 +37,7 @@ function test() {
/* if text is entered into field, onbeforeunload will cause a modal dialog /* if text is entered into field, onbeforeunload will cause a modal dialog
unless dialogs have been disabled for the iframe. */ unless dialogs have been disabled for the iframe. */
content.onbeforeunload = function(e) { content.onbeforeunload = function(e) {
return 'FAIL.'; return "FAIL.";
}; };
}.toString() + ")();"; }.toString() + ")();";
let mm = getGroupMessageManager("social"); let mm = getGroupMessageManager("social");

View file

@ -241,7 +241,7 @@ var tests = {
// Create a new tab and load about:addons // Create a new tab and load about:addons
let addonsTab = gBrowser.addTab(); let addonsTab = gBrowser.addTab();
gBrowser.selectedTab = addonsTab; gBrowser.selectedTab = addonsTab;
BrowserOpenAddonsMgr('addons://list/service'); BrowserOpenAddonsMgr("addons://list/service");
gBrowser.selectedBrowser.addEventListener("load", function tabLoad() { gBrowser.selectedBrowser.addEventListener("load", function tabLoad() {
gBrowser.selectedBrowser.removeEventListener("load", tabLoad, true); gBrowser.selectedBrowser.removeEventListener("load", tabLoad, true);
is(addonsTab.linkedBrowser.currentURI.spec, "about:addons", "about:addons should load into blank tab."); is(addonsTab.linkedBrowser.currentURI.spec, "about:addons", "about:addons should load into blank tab.");

View file

@ -64,7 +64,7 @@ function runSocialTestWithProvider(manifest, callback, finishcallback) {
function* finishCleanUp() { function* finishCleanUp() {
for (let i = 0; i < manifests.length; i++) { for (let i = 0; i < manifests.length; i++) {
let m = manifests[i]; let m = manifests[i];
for (let what of ['iconURL', 'shareURL']) { for (let what of ["iconURL", "shareURL"]) {
if (m[what]) { if (m[what]) {
yield promiseSocialUrlNotRemembered(m[what]); yield promiseSocialUrlNotRemembered(m[what]);
} }
@ -212,7 +212,7 @@ function setManifestPref(name, manifest) {
function getManifestPrefname(aManifest) { function getManifestPrefname(aManifest) {
// is same as the generated name in SocialServiceInternal.getManifestPrefname // is same as the generated name in SocialServiceInternal.getManifestPrefname
let originUri = Services.io.newURI(aManifest.origin); let originUri = Services.io.newURI(aManifest.origin);
return "social.manifest." + originUri.hostPort.replace('.', '-'); return "social.manifest." + originUri.hostPort.replace(".", "-");
} }
function ensureFrameLoaded(frame, uri) { function ensureFrameLoaded(frame, uri) {
@ -233,13 +233,13 @@ function ensureFrameLoaded(frame, uri) {
// Support for going on and offline. // Support for going on and offline.
// (via browser/base/content/test/browser_bookmark_titles.js) // (via browser/base/content/test/browser_bookmark_titles.js)
var origProxyType = Services.prefs.getIntPref('network.proxy.type'); var origProxyType = Services.prefs.getIntPref("network.proxy.type");
function toggleOfflineStatus(goOfflineState) { function toggleOfflineStatus(goOfflineState) {
// Bug 968887 fix. when going on/offline, wait for notification before continuing // Bug 968887 fix. when going on/offline, wait for notification before continuing
return new Promise(resolve => { return new Promise(resolve => {
if (!goOfflineState) { if (!goOfflineState) {
Services.prefs.setIntPref('network.proxy.type', origProxyType); Services.prefs.setIntPref("network.proxy.type", origProxyType);
} }
if (goOfflineState != Services.io.offline) { if (goOfflineState != Services.io.offline) {
info("initial offline state " + Services.io.offline); info("initial offline state " + Services.io.offline);
@ -255,7 +255,7 @@ function toggleOfflineStatus(goOfflineState) {
resolve(); resolve();
} }
if (goOfflineState) { if (goOfflineState) {
Services.prefs.setIntPref('network.proxy.type', 0); Services.prefs.setIntPref("network.proxy.type", 0);
// LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache. // LOAD_FLAGS_BYPASS_CACHE isn't good enough. So clear the cache.
Services.cache2.clear(); Services.cache2.clear();
} }

View file

@ -30,15 +30,15 @@ add_task(function* () {
function* cycleTabs() { function* cycleTabs() {
yield BrowserTestUtils.switchTab(gBrowser, fullURLTab); yield BrowserTestUtils.switchTab(gBrowser, fullURLTab);
is(gURLBar.textValue, testURL, 'gURLBar.textValue should be testURL after switching back to fullURLTab'); is(gURLBar.textValue, testURL, "gURLBar.textValue should be testURL after switching back to fullURLTab");
yield BrowserTestUtils.switchTab(gBrowser, partialURLTab); yield BrowserTestUtils.switchTab(gBrowser, partialURLTab);
is(gURLBar.textValue, testPartialURL, 'gURLBar.textValue should be testPartialURL after switching back to partialURLTab'); is(gURLBar.textValue, testPartialURL, "gURLBar.textValue should be testPartialURL after switching back to partialURLTab");
yield BrowserTestUtils.switchTab(gBrowser, deletedURLTab); yield BrowserTestUtils.switchTab(gBrowser, deletedURLTab);
is(gURLBar.textValue, '', 'gURLBar.textValue should be "" after switching back to deletedURLTab'); is(gURLBar.textValue, "", 'gURLBar.textValue should be "" after switching back to deletedURLTab');
yield BrowserTestUtils.switchTab(gBrowser, fullURLTab); yield BrowserTestUtils.switchTab(gBrowser, fullURLTab);
is(gURLBar.textValue, testURL, 'gURLBar.textValue should be testURL after switching back to fullURLTab'); is(gURLBar.textValue, testURL, "gURLBar.textValue should be testURL after switching back to fullURLTab");
} }
function urlbarBackspace() { function urlbarBackspace() {
@ -55,7 +55,7 @@ add_task(function* () {
function* prepareDeletedURLTab() { function* prepareDeletedURLTab() {
yield BrowserTestUtils.switchTab(gBrowser, deletedURLTab); yield BrowserTestUtils.switchTab(gBrowser, deletedURLTab);
is(gURLBar.textValue, testURL, 'gURLBar.textValue should be testURL after initial switch to deletedURLTab'); is(gURLBar.textValue, testURL, "gURLBar.textValue should be testURL after initial switch to deletedURLTab");
// simulate the user removing the whole url from the location bar // simulate the user removing the whole url from the location bar
gPrefService.setBoolPref("browser.urlbar.clickSelectsAll", true); gPrefService.setBoolPref("browser.urlbar.clickSelectsAll", true);
@ -69,12 +69,12 @@ add_task(function* () {
function* prepareFullURLTab() { function* prepareFullURLTab() {
yield BrowserTestUtils.switchTab(gBrowser, fullURLTab); yield BrowserTestUtils.switchTab(gBrowser, fullURLTab);
is(gURLBar.textValue, testURL, 'gURLBar.textValue should be testURL after initial switch to fullURLTab'); is(gURLBar.textValue, testURL, "gURLBar.textValue should be testURL after initial switch to fullURLTab");
} }
function* preparePartialURLTab() { function* preparePartialURLTab() {
yield BrowserTestUtils.switchTab(gBrowser, partialURLTab); yield BrowserTestUtils.switchTab(gBrowser, partialURLTab);
is(gURLBar.textValue, testURL, 'gURLBar.textValue should be testURL after initial switch to partialURLTab'); is(gURLBar.textValue, testURL, "gURLBar.textValue should be testURL after initial switch to partialURLTab");
// simulate the user removing part of the url from the location bar // simulate the user removing part of the url from the location bar
gPrefService.setBoolPref("browser.urlbar.clickSelectsAll", false); gPrefService.setBoolPref("browser.urlbar.clickSelectsAll", false);

View file

@ -34,7 +34,7 @@ function paste(input, cb) {
} }
function testNext() { function testNext() {
gURLBar.value = ''; gURLBar.value = "";
if (!pairs.length) { if (!pairs.length) {
finish(); finish();
return; return;

View file

@ -8,10 +8,10 @@
add_task(function* injectJSON() { add_task(function* injectJSON() {
let inputStrs = [ let inputStrs = [
'http://example.com/ ", "url": "bar', 'http://example.com/ ", "url": "bar',
'http://example.com/\\', "http://example.com/\\",
'http://example.com/"', 'http://example.com/"',
'http://example.com/","url":"evil.com', 'http://example.com/","url":"evil.com',
'http://mozilla.org/\\u0020', "http://mozilla.org/\\u0020",
'http://www.mozilla.org/","url":1e6,"some-key":"foo', 'http://www.mozilla.org/","url":1e6,"some-key":"foo',
'http://www.mozilla.org/","url":null,"some-key":"foo', 'http://www.mozilla.org/","url":null,"some-key":"foo',
'http://www.mozilla.org/","url":["foo","bar"],"some-key":"foo', 'http://www.mozilla.org/","url":["foo","bar"],"some-key":"foo',

View file

@ -18,7 +18,7 @@ add_task(function*() {
is(gURLBar.value, URI, "The URL bar should match the URI"); is(gURLBar.value, URI, "The URL bar should match the URI");
let browserLoaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser); let browserLoaded = BrowserTestUtils.browserLoaded(tab.linkedBrowser);
ContentTask.spawn(tab.linkedBrowser, null, function() { ContentTask.spawn(tab.linkedBrowser, null, function() {
content.document.querySelector('a').click(); content.document.querySelector("a").click();
}); });
yield browserLoaded; yield browserLoaded;
ok(gURLBar.value.startsWith("javascript"), "The URL bar should have the JS URI"); ok(gURLBar.value.startsWith("javascript"), "The URL bar should have the JS URI");

View file

@ -8,7 +8,7 @@ const PREF_PERMISSION_FAKE = "media.navigator.permission.fake";
const CONTENT_SCRIPT_HELPER = getRootDirectory(gTestPath) + "get_user_media_content_script.js"; const CONTENT_SCRIPT_HELPER = getRootDirectory(gTestPath) + "get_user_media_content_script.js";
function waitForCondition(condition, nextTest, errorMsg, retryTimes) { function waitForCondition(condition, nextTest, errorMsg, retryTimes) {
retryTimes = typeof retryTimes !== 'undefined' ? retryTimes : 30; retryTimes = typeof retryTimes !== "undefined" ? retryTimes : 30;
var tries = 0; var tries = 0;
var interval = setInterval(function() { var interval = setInterval(function() {
if (tries >= retryTimes) { if (tries >= retryTimes) {

View file

@ -205,7 +205,7 @@ function openLinkIn(url, where, params) {
var aPostData = params.postData; var aPostData = params.postData;
var aCharset = params.charset; var aCharset = params.charset;
var aReferrerURI = params.referrerURI; var aReferrerURI = params.referrerURI;
var aReferrerPolicy = ('referrerPolicy' in params ? var aReferrerPolicy = ("referrerPolicy" in params ?
params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET); params.referrerPolicy : Ci.nsIHttpChannel.REFERRER_POLICY_UNSET);
var aRelatedToCurrent = params.relatedToCurrent; var aRelatedToCurrent = params.relatedToCurrent;
var aAllowMixedContent = params.allowMixedContent; var aAllowMixedContent = params.allowMixedContent;

View file

@ -27,10 +27,10 @@ var panelProgressListener = {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START && if (aStateFlags & Ci.nsIWebProgressListener.STATE_START &&
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) { aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
window.parent.document.getElementById('sidebar-throbber').setAttribute("loading", "true"); window.parent.document.getElementById("sidebar-throbber").setAttribute("loading", "true");
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP && } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) { aStateFlags & Ci.nsIWebProgressListener.STATE_IS_NETWORK) {
window.parent.document.getElementById('sidebar-throbber').removeAttribute("loading"); window.parent.document.getElementById("sidebar-throbber").removeAttribute("loading");
} }
} }
, ,

View file

@ -14,7 +14,7 @@ add_task(function* setup() {
add_task(function* test() { add_task(function* test() {
info("Creating a tab with UCI = 1..."); info("Creating a tab with UCI = 1...");
let tab1 = gBrowser.addTab(BASE_URI, {userContextId: 1}); let tab1 = gBrowser.addTab(BASE_URI, {userContextId: 1});
is(tab1.getAttribute('usercontextid'), 1, "New tab has UCI equal 1"); is(tab1.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
let browser1 = gBrowser.getBrowserForTab(tab1); let browser1 = gBrowser.getBrowserForTab(tab1);
yield BrowserTestUtils.browserLoaded(browser1); yield BrowserTestUtils.browserLoaded(browser1);
@ -30,7 +30,7 @@ add_task(function* test() {
info("Creating a tab with UCI = 2..."); info("Creating a tab with UCI = 2...");
let tab2 = gBrowser.addTab(BASE_URI, {userContextId: 2}); let tab2 = gBrowser.addTab(BASE_URI, {userContextId: 2});
is(tab2.getAttribute('usercontextid'), 2, "New tab has UCI equal 2"); is(tab2.getAttribute("usercontextid"), 2, "New tab has UCI equal 2");
let browser2 = gBrowser.getBrowserForTab(tab2); let browser2 = gBrowser.getBrowserForTab(tab2);
yield BrowserTestUtils.browserLoaded(browser2); yield BrowserTestUtils.browserLoaded(browser2);
@ -49,7 +49,7 @@ add_task(function* test() {
info("Creating a tab with UCI = 1..."); info("Creating a tab with UCI = 1...");
let tab3 = gBrowser.addTab(BASE_URI, {userContextId: 1}); let tab3 = gBrowser.addTab(BASE_URI, {userContextId: 1});
is(tab3.getAttribute('usercontextid'), 1, "New tab has UCI equal 1"); is(tab3.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
let browser3 = gBrowser.getBrowserForTab(tab3); let browser3 = gBrowser.getBrowserForTab(tab3);
yield BrowserTestUtils.browserLoaded(browser3); yield BrowserTestUtils.browserLoaded(browser3);

View file

@ -7,11 +7,11 @@ const TEST_HOST = "example.com";
const TEST_URL = "http://" + TEST_HOST + "/browser/browser/components/contextualidentity/test/browser/"; const TEST_URL = "http://" + TEST_HOST + "/browser/browser/components/contextualidentity/test/browser/";
const TESTKEY = { const TESTKEY = {
initDataType: 'keyids', initDataType: "keyids",
initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"], "type":"persistent-license"}', initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"], "type":"persistent-license"}',
kid: "LwVHf8JLtPrv2GUXFW2v_A", kid: "LwVHf8JLtPrv2GUXFW2v_A",
key: "97b9ddc459c8d5ff23c1f2754c95abe8", key: "97b9ddc459c8d5ff23c1f2754c95abe8",
sessionType: 'persistent-license', sessionType: "persistent-license",
}; };
const USER_ID_DEFAULT = 0; const USER_ID_DEFAULT = 0;
@ -60,7 +60,7 @@ function ByteArrayToHex(array) {
function generateKeyObject(aKid, aKey) { function generateKeyObject(aKid, aKey) {
let keyObj = { let keyObj = {
kty: 'oct', kty: "oct",
kid: aKid, kid: aKid,
k: HexToBase64(aKey), k: HexToBase64(aKey),
}; };
@ -101,12 +101,12 @@ add_task(function* test() {
// Update the media key for the default container. // Update the media key for the default container.
let result = yield ContentTask.spawn(defaultContainer.browser, keyInfo, function* (aKeyInfo) { let result = yield ContentTask.spawn(defaultContainer.browser, keyInfo, function* (aKeyInfo) {
let access = yield content.navigator.requestMediaKeySystemAccess('org.w3.clearkey', let access = yield content.navigator.requestMediaKeySystemAccess("org.w3.clearkey",
[{ [{
initDataTypes: [aKeyInfo.initDataType], initDataTypes: [aKeyInfo.initDataType],
videoCapabilities: [{contentType: 'video/webm'}], videoCapabilities: [{contentType: "video/webm"}],
sessionTypes: ['persistent-license'], sessionTypes: ["persistent-license"],
persistentState: 'required', persistentState: "required",
}]); }]);
let mediaKeys = yield access.createMediaKeys(); let mediaKeys = yield access.createMediaKeys();
let session = mediaKeys.createSession(aKeyInfo.sessionType); let session = mediaKeys.createSession(aKeyInfo.sessionType);
@ -154,12 +154,12 @@ add_task(function* test() {
let personalContainer = yield openTabInUserContext(TEST_URL + "empty_file.html", USER_ID_PERSONAL); let personalContainer = yield openTabInUserContext(TEST_URL + "empty_file.html", USER_ID_PERSONAL);
yield ContentTask.spawn(personalContainer.browser, keyInfo, function* (aKeyInfo) { yield ContentTask.spawn(personalContainer.browser, keyInfo, function* (aKeyInfo) {
let access = yield content.navigator.requestMediaKeySystemAccess('org.w3.clearkey', let access = yield content.navigator.requestMediaKeySystemAccess("org.w3.clearkey",
[{ [{
initDataTypes: [aKeyInfo.initDataType], initDataTypes: [aKeyInfo.initDataType],
videoCapabilities: [{contentType: 'video/webm'}], videoCapabilities: [{contentType: "video/webm"}],
sessionTypes: ['persistent-license'], sessionTypes: ["persistent-license"],
persistentState: 'required', persistentState: "required",
}]); }]);
let mediaKeys = yield access.createMediaKeys(); let mediaKeys = yield access.createMediaKeys();
let session = mediaKeys.createSession(aKeyInfo.sessionType); let session = mediaKeys.createSession(aKeyInfo.sessionType);

View file

@ -84,8 +84,8 @@ add_task(function* setup() {
// Create a http server for the image cache test. // Create a http server for the image cache test.
if (!gHttpServer) { if (!gHttpServer) {
gHttpServer = new HttpServer(); gHttpServer = new HttpServer();
gHttpServer.registerPathHandler('/', loadIndexHandler); gHttpServer.registerPathHandler("/", loadIndexHandler);
gHttpServer.registerPathHandler('/favicon.png', loadFaviconHandler); gHttpServer.registerPathHandler("/favicon.png", loadFaviconHandler);
gHttpServer.start(-1); gHttpServer.start(-1);
} }
}); });

View file

@ -13,11 +13,11 @@ const USER_CONTEXTS = [
]; ];
const TEST_EME_KEY = { const TEST_EME_KEY = {
initDataType: 'keyids', initDataType: "keyids",
initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"], "type":"persistent-license"}', initData: '{"kids":["LwVHf8JLtPrv2GUXFW2v_A"], "type":"persistent-license"}',
kid: "LwVHf8JLtPrv2GUXFW2v_A", kid: "LwVHf8JLtPrv2GUXFW2v_A",
key: "97b9ddc459c8d5ff23c1f2754c95abe8", key: "97b9ddc459c8d5ff23c1f2754c95abe8",
sessionType: 'persistent-license', sessionType: "persistent-license",
}; };
// //
@ -67,7 +67,7 @@ function ByteArrayToHex(array) {
function generateKeyObject(aKid, aKey) { function generateKeyObject(aKid, aKey) {
let keyObj = { let keyObj = {
kty: 'oct', kty: "oct",
kid: aKid, kid: aKid,
k: HexToBase64(aKey), k: HexToBase64(aKey),
}; };
@ -95,12 +95,12 @@ function* setupEMEKey(browser) {
// Setup the EME key. // Setup the EME key.
let result = yield ContentTask.spawn(browser, keyInfo, function* (aKeyInfo) { let result = yield ContentTask.spawn(browser, keyInfo, function* (aKeyInfo) {
let access = yield content.navigator.requestMediaKeySystemAccess('org.w3.clearkey', let access = yield content.navigator.requestMediaKeySystemAccess("org.w3.clearkey",
[{ [{
initDataTypes: [aKeyInfo.initDataType], initDataTypes: [aKeyInfo.initDataType],
videoCapabilities: [{contentType: 'video/webm'}], videoCapabilities: [{contentType: "video/webm"}],
sessionTypes: ['persistent-license'], sessionTypes: ["persistent-license"],
persistentState: 'required', persistentState: "required",
}]); }]);
let mediaKeys = yield access.createMediaKeys(); let mediaKeys = yield access.createMediaKeys();
let session = mediaKeys.createSession(aKeyInfo.sessionType); let session = mediaKeys.createSession(aKeyInfo.sessionType);
@ -150,12 +150,12 @@ function* checkEMEKey(browser, emeSessionId) {
keyInfo.sessionId = emeSessionId; keyInfo.sessionId = emeSessionId;
yield ContentTask.spawn(browser, keyInfo, function* (aKeyInfo) { yield ContentTask.spawn(browser, keyInfo, function* (aKeyInfo) {
let access = yield content.navigator.requestMediaKeySystemAccess('org.w3.clearkey', let access = yield content.navigator.requestMediaKeySystemAccess("org.w3.clearkey",
[{ [{
initDataTypes: [aKeyInfo.initDataType], initDataTypes: [aKeyInfo.initDataType],
videoCapabilities: [{contentType: 'video/webm'}], videoCapabilities: [{contentType: "video/webm"}],
sessionTypes: ['persistent-license'], sessionTypes: ["persistent-license"],
persistentState: 'required', persistentState: "required",
}]); }]);
let mediaKeys = yield access.createMediaKeys(); let mediaKeys = yield access.createMediaKeys();
let session = mediaKeys.createSession(aKeyInfo.sessionType); let session = mediaKeys.createSession(aKeyInfo.sessionType);

View file

@ -203,7 +203,7 @@ function* test_image_cache_cleared() {
for (let userContextId of Object.keys(USER_CONTEXTS)) { for (let userContextId of Object.keys(USER_CONTEXTS)) {
// Open our tab in the given user context to cache image. // Open our tab in the given user context to cache image.
tabs[userContextId] = yield* openTabInUserContext('http://localhost:' + gHttpServer.identity.primaryPort + '/loadImage.html', tabs[userContextId] = yield* openTabInUserContext("http://localhost:" + gHttpServer.identity.primaryPort + "/loadImage.html",
userContextId); userContextId);
yield BrowserTestUtils.removeTab(tabs[userContextId].tab); yield BrowserTestUtils.removeTab(tabs[userContextId].tab);
} }
@ -222,7 +222,7 @@ function* test_image_cache_cleared() {
// Load again. // Load again.
for (let userContextId of Object.keys(USER_CONTEXTS)) { for (let userContextId of Object.keys(USER_CONTEXTS)) {
// Open our tab in the given user context to cache image. // Open our tab in the given user context to cache image.
tabs[userContextId] = yield* openTabInUserContext('http://localhost:' + gHttpServer.identity.primaryPort + '/loadImage.html', tabs[userContextId] = yield* openTabInUserContext("http://localhost:" + gHttpServer.identity.primaryPort + "/loadImage.html",
userContextId); userContextId);
yield BrowserTestUtils.removeTab(tabs[userContextId].tab); yield BrowserTestUtils.removeTab(tabs[userContextId].tab);
} }
@ -322,8 +322,8 @@ add_task(function* setup() {
// Create a http server for the image cache test. // Create a http server for the image cache test.
if (!gHttpServer) { if (!gHttpServer) {
gHttpServer = new HttpServer(); gHttpServer = new HttpServer();
gHttpServer.registerPathHandler('/image.png', imageHandler); gHttpServer.registerPathHandler("/image.png", imageHandler);
gHttpServer.registerPathHandler('/loadImage.html', loadImagePageHandler); gHttpServer.registerPathHandler("/loadImage.html", loadImagePageHandler);
gHttpServer.start(-1); gHttpServer.start(-1);
} }
}); });

View file

@ -6,13 +6,13 @@ const NUM_USER_CONTEXTS = 3;
let gHits = 0; let gHits = 0;
let server = new HttpServer(); let server = new HttpServer();
server.registerPathHandler('/image.png', imageHandler); server.registerPathHandler("/image.png", imageHandler);
server.registerPathHandler('/file.html', fileHandler); server.registerPathHandler("/file.html", fileHandler);
server.start(-1); server.start(-1);
let BASE_URI = 'http://localhost:' + server.identity.primaryPort; let BASE_URI = "http://localhost:" + server.identity.primaryPort;
let IMAGE_URI = BASE_URI + '/image.png'; let IMAGE_URI = BASE_URI + "/image.png";
let FILE_URI = BASE_URI + '/file.html'; let FILE_URI = BASE_URI + "/file.html";
function imageHandler(metadata, response) { function imageHandler(metadata, response) {
gHits++; gHits++;

View file

@ -17,7 +17,7 @@ add_task(function* () {
yield ContentTask.spawn(browser, URI, yield ContentTask.spawn(browser, URI,
function(uri) { function(uri) {
let anchor = content.document.createElement("a"); let anchor = content.document.createElement("a");
anchor.setAttribute('id', 'clickMe'); anchor.setAttribute("id", "clickMe");
anchor.setAttribute("href", uri); anchor.setAttribute("href", uri);
anchor.appendChild(content.document.createTextNode("click me!")); anchor.appendChild(content.document.createTextNode("click me!"));
content.document.body.appendChild(anchor); content.document.body.appendChild(anchor);

View file

@ -9,7 +9,7 @@ add_task(function* test_menu_with_timeout() {
["privacy.userContext.longPressBehavior", 2] ["privacy.userContext.longPressBehavior", 2]
]}); ]});
let newTab = document.getElementById('tabbrowser-tabs'); let newTab = document.getElementById("tabbrowser-tabs");
let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button"); let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button");
ok(newTabButton, "New tab button exists"); ok(newTabButton, "New tab button exists");
ok(!newTabButton.hidden, "New tab button is visible"); ok(!newTabButton.hidden, "New tab button is visible");
@ -30,7 +30,7 @@ add_task(function* test_menu_with_timeout() {
let tab = yield waitForTabPromise; let tab = yield waitForTabPromise;
is(tab.getAttribute('usercontextid'), i, `New tab has UCI equal ${i}`); is(tab.getAttribute("usercontextid"), i, `New tab has UCI equal ${i}`);
yield BrowserTestUtils.removeTab(tab); yield BrowserTestUtils.removeTab(tab);
} }
}); });
@ -41,7 +41,7 @@ add_task(function* test_menu_without_timeout() {
["privacy.userContext.longPressBehavior", 1] ["privacy.userContext.longPressBehavior", 1]
]}); ]});
let newTab = document.getElementById('tabbrowser-tabs'); let newTab = document.getElementById("tabbrowser-tabs");
let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button"); let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button");
ok(newTabButton, "New tab button exists"); ok(newTabButton, "New tab button exists");
ok(!newTabButton.hidden, "New tab button is visible"); ok(!newTabButton.hidden, "New tab button is visible");
@ -62,7 +62,7 @@ add_task(function* test_menu_without_timeout() {
let tab = yield waitForTabPromise; let tab = yield waitForTabPromise;
is(tab.getAttribute('usercontextid'), i, `New tab has UCI equal ${i}`); is(tab.getAttribute("usercontextid"), i, `New tab has UCI equal ${i}`);
yield BrowserTestUtils.removeTab(tab); yield BrowserTestUtils.removeTab(tab);
} }
}); });
@ -73,7 +73,7 @@ add_task(function* test_no_menu() {
["privacy.userContext.longPressBehavior", 0] ["privacy.userContext.longPressBehavior", 0]
]}); ]});
let newTab = document.getElementById('tabbrowser-tabs'); let newTab = document.getElementById("tabbrowser-tabs");
let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button"); let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button");
ok(newTabButton, "New tab button exists"); ok(newTabButton, "New tab button exists");
ok(!newTabButton.hidden, "New tab button is visible"); ok(!newTabButton.hidden, "New tab button is visible");

View file

@ -9,22 +9,22 @@ add_task(function* () {
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
let relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true}); let relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true});
is(relatedTab.getAttribute('usercontextid'), 1, "Related tab (relatedToCurrent) inherits current tab's usercontextid"); is(relatedTab.getAttribute("usercontextid"), 1, "Related tab (relatedToCurrent) inherits current tab's usercontextid");
yield BrowserTestUtils.removeTab(relatedTab); yield BrowserTestUtils.removeTab(relatedTab);
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true, userContextId: 2}); relatedTab = gBrowser.addTab("about:blank", {relatedToCurrent: true, userContextId: 2});
is(relatedTab.getAttribute('usercontextid'), 2, "Related tab (relatedToCurrent) with overridden usercontextid"); is(relatedTab.getAttribute("usercontextid"), 2, "Related tab (relatedToCurrent) with overridden usercontextid");
yield BrowserTestUtils.removeTab(relatedTab); yield BrowserTestUtils.removeTab(relatedTab);
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI}); relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI});
is(relatedTab.getAttribute('usercontextid'), 1, "Related tab (referrer) inherits current tab's usercontextid"); is(relatedTab.getAttribute("usercontextid"), 1, "Related tab (referrer) inherits current tab's usercontextid");
yield BrowserTestUtils.removeTab(relatedTab); yield BrowserTestUtils.removeTab(relatedTab);
gBrowser.selectedTab = tab; gBrowser.selectedTab = tab;
relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI, userContextId: 2}); relatedTab = gBrowser.addTab("about:blank", {referrerURI: gBrowser.currentURI, userContextId: 2});
is(relatedTab.getAttribute('usercontextid'), 2, "Related tab (referrer) with overridden usercontextid"); is(relatedTab.getAttribute("usercontextid"), 2, "Related tab (referrer) with overridden usercontextid");
yield BrowserTestUtils.removeTab(relatedTab); yield BrowserTestUtils.removeTab(relatedTab);
yield BrowserTestUtils.removeTab(tab); yield BrowserTestUtils.removeTab(tab);

View file

@ -21,41 +21,41 @@ add_task(function* setup() {
add_task(function* test() { add_task(function* test() {
info("Creating first tab..."); info("Creating first tab...");
let tab1 = gBrowser.addTab(BASE_URI + '?old', {userContextId: 1}); let tab1 = gBrowser.addTab(BASE_URI + "?old", {userContextId: 1});
let browser1 = gBrowser.getBrowserForTab(tab1); let browser1 = gBrowser.getBrowserForTab(tab1);
yield BrowserTestUtils.browserLoaded(browser1); yield BrowserTestUtils.browserLoaded(browser1);
yield ContentTask.spawn(browser1, null, function(opts) { yield ContentTask.spawn(browser1, null, function(opts) {
content.window.name = 'tab-1'; content.window.name = "tab-1";
}); });
info("Creating second tab..."); info("Creating second tab...");
let tab2 = gBrowser.addTab(BASE_URI + '?old', {userContextId: 2}); let tab2 = gBrowser.addTab(BASE_URI + "?old", {userContextId: 2});
let browser2 = gBrowser.getBrowserForTab(tab2); let browser2 = gBrowser.getBrowserForTab(tab2);
yield BrowserTestUtils.browserLoaded(browser2); yield BrowserTestUtils.browserLoaded(browser2);
yield ContentTask.spawn(browser2, null, function(opts) { yield ContentTask.spawn(browser2, null, function(opts) {
content.window.name = 'tab-2'; content.window.name = "tab-2";
}); });
// Let's try to open a window from tab1 with a name 'tab-2'. // Let's try to open a window from tab1 with a name 'tab-2'.
info("Opening a window from the first tab..."); info("Opening a window from the first tab...");
yield ContentTask.spawn(browser1, { url: BASE_URI + '?new' }, function* (opts) { yield ContentTask.spawn(browser1, { url: BASE_URI + "?new" }, function* (opts) {
yield (new content.window.wrappedJSObject.Promise(resolve => { yield (new content.window.wrappedJSObject.Promise(resolve => {
let w = content.window.wrappedJSObject.open(opts.url, 'tab-2'); let w = content.window.wrappedJSObject.open(opts.url, "tab-2");
w.onload = function() { resolve(); } w.onload = function() { resolve(); }
})); }));
}); });
is(browser1.contentTitle, '?old', "Tab1 title must be 'old'"); is(browser1.contentTitle, "?old", "Tab1 title must be 'old'");
is(browser1.contentPrincipal.userContextId, 1, "Tab1 UCI must be 1"); is(browser1.contentPrincipal.userContextId, 1, "Tab1 UCI must be 1");
is(browser2.contentTitle, '?old', "Tab2 title must be 'old'"); is(browser2.contentTitle, "?old", "Tab2 title must be 'old'");
is(browser2.contentPrincipal.userContextId, 2, "Tab2 UCI must be 2"); is(browser2.contentPrincipal.userContextId, 2, "Tab2 UCI must be 2");
let found = false; let found = false;
for (let i = 0; i < gBrowser.tabContainer.childNodes.length; ++i) { for (let i = 0; i < gBrowser.tabContainer.childNodes.length; ++i) {
let tab = gBrowser.tabContainer.childNodes[i]; let tab = gBrowser.tabContainer.childNodes[i];
let browser = gBrowser.getBrowserForTab(tab); let browser = gBrowser.getBrowserForTab(tab);
if (browser.contentTitle == '?new') { if (browser.contentTitle == "?new") {
is(browser.contentPrincipal.userContextId, 1, "Tab3 UCI must be 1"); is(browser.contentPrincipal.userContextId, 1, "Tab3 UCI must be 1");
isnot(browser, browser1, "Tab3 is not browser 1"); isnot(browser, browser1, "Tab3 is not browser 1");
isnot(browser, browser2, "Tab3 is not browser 2"); isnot(browser, browser2, "Tab3 is not browser 2");

View file

@ -17,7 +17,7 @@ add_task(function* setup() {
add_task(function* test() { add_task(function* test() {
info("Creating a tab with UCI = 1..."); info("Creating a tab with UCI = 1...");
let tab = gBrowser.addTab(BASE_URI, {userContextId: 1}); let tab = gBrowser.addTab(BASE_URI, {userContextId: 1});
is(tab.getAttribute('usercontextid'), 1, "New tab has UCI equal 1"); is(tab.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
let browser = gBrowser.getBrowserForTab(tab); let browser = gBrowser.getBrowserForTab(tab);
yield BrowserTestUtils.browserLoaded(browser); yield BrowserTestUtils.browserLoaded(browser);
@ -31,7 +31,7 @@ add_task(function* test() {
let newTab = newWin.gBrowser.selectedTab; let newTab = newWin.gBrowser.selectedTab;
yield BrowserTestUtils.browserLoaded(newTab.linkedBrowser); yield BrowserTestUtils.browserLoaded(newTab.linkedBrowser);
is(newTab.getAttribute('usercontextid'), 1, "New tab has UCI equal 1"); is(newTab.getAttribute("usercontextid"), 1, "New tab has UCI equal 1");
info("Closing the new window and tab..."); info("Closing the new window and tab...");
yield BrowserTestUtils.closeWindow(newWin); yield BrowserTestUtils.closeWindow(newWin);

View file

@ -618,7 +618,7 @@ var CustomizableUIInternal = {
} }
let props = {type: CustomizableUI.TYPE_TOOLBAR, legacy: true}; let props = {type: CustomizableUI.TYPE_TOOLBAR, legacy: true};
let defaultsetAttribute = aToolbar.getAttribute("defaultset") || ""; let defaultsetAttribute = aToolbar.getAttribute("defaultset") || "";
props.defaultPlacements = defaultsetAttribute.split(',').filter(s => s); props.defaultPlacements = defaultsetAttribute.split(",").filter(s => s);
this.registerArea(area, props); this.registerArea(area, props);
areaProperties = gAreas.get(area); areaProperties = gAreas.get(area);
} }
@ -981,7 +981,7 @@ var CustomizableUIInternal = {
this.notifyListeners("onWidgetAfterDOMChange", widgetNode, null, container, true); this.notifyListeners("onWidgetAfterDOMChange", widgetNode, null, container, true);
if (isToolbar) { if (isToolbar) {
areaNode.setAttribute("currentset", gPlacements.get(aArea).join(',')); areaNode.setAttribute("currentset", gPlacements.get(aArea).join(","));
} }
let windowCache = gSingleWrapperCache.get(window); let windowCache = gSingleWrapperCache.get(window);
@ -1153,7 +1153,7 @@ var CustomizableUIInternal = {
this.insertWidgetBefore(widgetNode, nextNode, insertionContainer, areaId); this.insertWidgetBefore(widgetNode, nextNode, insertionContainer, areaId);
if (gAreas.get(areaId).get("type") == CustomizableUI.TYPE_TOOLBAR) { if (gAreas.get(areaId).get("type") == CustomizableUI.TYPE_TOOLBAR) {
aAreaNode.setAttribute("currentset", gPlacements.get(areaId).join(',')); aAreaNode.setAttribute("currentset", gPlacements.get(areaId).join(","));
} }
}, },
@ -2732,7 +2732,7 @@ var CustomizableUIInternal = {
// widgets (if any) - use that instead: // widgets (if any) - use that instead:
if (props.get("type") == CustomizableUI.TYPE_TOOLBAR) { if (props.get("type") == CustomizableUI.TYPE_TOOLBAR) {
let currentSet = container.currentSet; let currentSet = container.currentSet;
currentPlacements = currentSet ? currentSet.split(',') : []; currentPlacements = currentSet ? currentSet.split(",") : [];
currentPlacements = currentPlacements.filter(removableOrDefault); currentPlacements = currentPlacements.filter(removableOrDefault);
} else { } else {
// Clone the array so we don't modify the actual placements... // Clone the array so we don't modify the actual placements...
@ -4120,7 +4120,7 @@ OverflowableToolbar.prototype = {
let doc = this._panel.ownerDocument; let doc = this._panel.ownerDocument;
this._panel.hidden = false; this._panel.hidden = false;
let contextMenu = doc.getElementById(this._panel.getAttribute("context")); let contextMenu = doc.getElementById(this._panel.getAttribute("context"));
gELS.addSystemEventListener(contextMenu, 'command', this, true); gELS.addSystemEventListener(contextMenu, "command", this, true);
let anchor = doc.getAnonymousElementByAttribute(this._chevron, "class", "toolbarbutton-icon"); let anchor = doc.getAnonymousElementByAttribute(this._chevron, "class", "toolbarbutton-icon");
this._panel.openPopup(anchor || this._chevron); this._panel.openPopup(anchor || this._chevron);
this._chevron.open = true; this._chevron.open = true;
@ -4150,7 +4150,7 @@ OverflowableToolbar.prototype = {
this._panel.removeEventListener("dragend", this); this._panel.removeEventListener("dragend", this);
let doc = aEvent.target.ownerDocument; let doc = aEvent.target.ownerDocument;
let contextMenu = doc.getElementById(this._panel.getAttribute("context")); let contextMenu = doc.getElementById(this._panel.getAttribute("context"));
gELS.removeSystemEventListener(contextMenu, 'command', this, true); gELS.removeSystemEventListener(contextMenu, "command", this, true);
}, },
onOverflow(aEvent) { onOverflow(aEvent) {

View file

@ -1329,7 +1329,7 @@ CustomizeMode.prototype = {
openAddonsManagerThemes(aEvent) { openAddonsManagerThemes(aEvent) {
aEvent.target.parentNode.parentNode.hidePopup(); aEvent.target.parentNode.parentNode.hidePopup();
this.window.BrowserOpenAddonsMgr('addons://list/theme'); this.window.BrowserOpenAddonsMgr("addons://list/theme");
}, },
getMoreThemes(aEvent) { getMoreThemes(aEvent) {
@ -2030,7 +2030,7 @@ CustomizeMode.prototype = {
if (makeSpaceImmediately) { if (makeSpaceImmediately) {
aItem.setAttribute("notransition", "true"); aItem.setAttribute("notransition", "true");
} }
aItem.style[prop] = width + 'px'; aItem.style[prop] = width + "px";
aItem.style.removeProperty(otherProp); aItem.style.removeProperty(otherProp);
if (makeSpaceImmediately) { if (makeSpaceImmediately) {
// Force a layout flush: // Force a layout flush:

View file

@ -55,7 +55,7 @@ function test() {
CustomizableUIInternal._placeNewDefaultWidgetsInArea(CustomizableUI.AREA_NAVBAR); CustomizableUIInternal._placeNewDefaultWidgetsInArea(CustomizableUI.AREA_NAVBAR);
let indexInSavedPlacements = savedPlacements.indexOf(testWidgetNew.id); let indexInSavedPlacements = savedPlacements.indexOf(testWidgetNew.id);
info("Saved placements: " + savedPlacements.join(', ')); info("Saved placements: " + savedPlacements.join(", "));
isnot(indexInSavedPlacements, -1, "Widget should have been inserted"); isnot(indexInSavedPlacements, -1, "Widget should have been inserted");
is(indexInSavedPlacements, savedPlacements.indexOf("bookmarks-menu-button") + 1, is(indexInSavedPlacements, savedPlacements.indexOf("bookmarks-menu-button") + 1,
"Widget should be in the right place."); "Widget should be in the right place.");

View file

@ -55,7 +55,7 @@ function isLast(containerId, defaultPlacements, id) {
function getLastVisibleNodeInToolbar(containerId, win = window) { function getLastVisibleNodeInToolbar(containerId, win = window) {
let container = win.document.getElementById(containerId).customizationTarget; let container = win.document.getElementById(containerId).customizationTarget;
let rv = container.lastChild; let rv = container.lastChild;
while (rv && (rv.getAttribute('hidden') == 'true' || (rv.firstChild && rv.firstChild.getAttribute('hidden') == 'true'))) { while (rv && (rv.getAttribute("hidden") == "true" || (rv.firstChild && rv.firstChild.getAttribute("hidden") == "true"))) {
rv = rv.previousSibling; rv = rv.previousSibling;
} }
return rv; return rv;
@ -65,7 +65,7 @@ function isLastVisibleInToolbar(containerId, defaultPlacements, id) {
let newPlacements; let newPlacements;
for (let i = defaultPlacements.length - 1; i >= 0; i--) { for (let i = defaultPlacements.length - 1; i >= 0; i--) {
let el = document.getElementById(defaultPlacements[i]); let el = document.getElementById(defaultPlacements[i]);
if (el && el.getAttribute('hidden') != 'true') { if (el && el.getAttribute("hidden") != "true") {
newPlacements = [...defaultPlacements]; newPlacements = [...defaultPlacements];
newPlacements.splice(i + 1, 0, id); newPlacements.splice(i + 1, 0, id);
break; break;

View file

@ -10,7 +10,7 @@ const kTestWidget2 = "test-customize-mode-create-destroy2";
// Creating and destroying a widget should correctly wrap/unwrap stuff // Creating and destroying a widget should correctly wrap/unwrap stuff
add_task(function* testWrapUnwrap() { add_task(function* testWrapUnwrap() {
yield startCustomizing(); yield startCustomizing();
CustomizableUI.createWidget({id: kTestWidget1, label: 'Pretty label', tooltiptext: 'Pretty tooltip'}); CustomizableUI.createWidget({id: kTestWidget1, label: "Pretty label", tooltiptext: "Pretty tooltip"});
let elem = document.getElementById(kTestWidget1); let elem = document.getElementById(kTestWidget1);
let wrapper = document.getElementById("wrapper-" + kTestWidget1); let wrapper = document.getElementById("wrapper-" + kTestWidget1);
ok(elem, "There should be an item"); ok(elem, "There should be an item");
@ -32,7 +32,7 @@ add_task(function* testPanelPlaceholders() {
// change when the default placements change. // change when the default placements change.
let expectedPlaceholders = 1 + (isInDevEdition() ? 1 : 0); let expectedPlaceholders = 1 + (isInDevEdition() ? 1 : 0);
is(panel.querySelectorAll(".panel-customization-placeholder").length, expectedPlaceholders, "The number of placeholders should be correct."); is(panel.querySelectorAll(".panel-customization-placeholder").length, expectedPlaceholders, "The number of placeholders should be correct.");
CustomizableUI.createWidget({id: kTestWidget2, label: 'Pretty label', tooltiptext: 'Pretty tooltip', defaultArea: CustomizableUI.AREA_PANEL}); CustomizableUI.createWidget({id: kTestWidget2, label: "Pretty label", tooltiptext: "Pretty tooltip", defaultArea: CustomizableUI.AREA_PANEL});
let elem = document.getElementById(kTestWidget2); let elem = document.getElementById(kTestWidget2);
let wrapper = document.getElementById("wrapper-" + kTestWidget2); let wrapper = document.getElementById("wrapper-" + kTestWidget2);
ok(elem, "There should be an item"); ok(elem, "There should be an item");

View file

@ -6,11 +6,11 @@
// Should be able to add broken view widget // Should be able to add broken view widget
add_task(function testAddbrokenViewWidget() { add_task(function testAddbrokenViewWidget() {
const kWidgetId = 'test-877006-broken-widget'; const kWidgetId = "test-877006-broken-widget";
let widgetSpec = { let widgetSpec = {
id: kWidgetId, id: kWidgetId,
type: 'view', type: "view",
viewId: 'idontexist', viewId: "idontexist",
/* Empty handler so we try to attach it maybe? */ /* Empty handler so we try to attach it maybe? */
onViewShowing() { onViewShowing() {
} }

View file

@ -22,14 +22,14 @@ add_task(function() {
} }
} }
let currentSet = navbar.currentSet; let currentSet = navbar.currentSet;
is(currentSet.split(',').length, nodeIds.length, "Should be just as many nodes as there are."); is(currentSet.split(",").length, nodeIds.length, "Should be just as many nodes as there are.");
is(currentSet, nodeIds.join(','), "Current set and node IDs should match."); is(currentSet, nodeIds.join(","), "Current set and node IDs should match.");
}); });
// Insert, then remove items // Insert, then remove items
add_task(function() { add_task(function() {
let currentSet = navbar.currentSet; let currentSet = navbar.currentSet;
let newCurrentSet = currentSet.replace('home-button', 'feed-button,sync-button,home-button'); let newCurrentSet = currentSet.replace("home-button", "feed-button,sync-button,home-button");
navbar.currentSet = newCurrentSet; navbar.currentSet = newCurrentSet;
is(newCurrentSet, navbar.currentSet, "Current set should match expected current set."); is(newCurrentSet, navbar.currentSet, "Current set should match expected current set.");
let feedBtn = document.getElementById("feed-button"); let feedBtn = document.getElementById("feed-button");
@ -54,7 +54,7 @@ add_task(function() {
// Simultaneous insert/remove: // Simultaneous insert/remove:
add_task(function() { add_task(function() {
let currentSet = navbar.currentSet; let currentSet = navbar.currentSet;
let newCurrentSet = currentSet.replace('home-button', 'feed-button'); let newCurrentSet = currentSet.replace("home-button", "feed-button");
navbar.currentSet = newCurrentSet; navbar.currentSet = newCurrentSet;
is(newCurrentSet, navbar.currentSet, "Current set should match expected current set."); is(newCurrentSet, navbar.currentSet, "Current set should match expected current set.");
let feedBtn = document.getElementById("feed-button"); let feedBtn = document.getElementById("feed-button");

View file

@ -15,7 +15,7 @@ add_task(function*() {
for (let i = 0; i < kTestWidgetCount; i++) { for (let i = 0; i < kTestWidgetCount; i++) {
let id = kTestWidgetPfx + i; let id = kTestWidgetPfx + i;
widgetIds.push(id); widgetIds.push(id);
let spec = {id, type: 'button', removable: true, label: "unregisterArea test", tooltiptext: "" + i}; let spec = {id, type: "button", removable: true, label: "unregisterArea test", tooltiptext: "" + i};
CustomizableUI.createWidget(spec); CustomizableUI.createWidget(spec);
} }
for (let i = kTestWidgetCount; i < kTestWidgetCount * 2; i++) { for (let i = kTestWidgetCount; i < kTestWidgetCount * 2; i++) {

View file

@ -32,7 +32,7 @@ add_task(function*() {
w = CustomizableUI.getWidget(kTestWidget); w = CustomizableUI.getWidget(kTestWidget);
checkAreaType(w); checkAreaType(w);
let spec = {id: kUnregisterAreaTestWidget, type: 'button', removable: true, let spec = {id: kUnregisterAreaTestWidget, type: "button", removable: true,
label: "areaType test", tooltiptext: "areaType test"}; label: "areaType test", tooltiptext: "areaType test"};
CustomizableUI.createWidget(spec); CustomizableUI.createWidget(spec);
toolbarNode = createToolbarWithPlacements(kToolbarName, [kUnregisterAreaTestWidget]); toolbarNode = createToolbarWithPlacements(kToolbarName, [kUnregisterAreaTestWidget]);

View file

@ -11,7 +11,7 @@ add_task(function*() {
let navbar = document.getElementById("nav-bar"); let navbar = document.getElementById("nav-bar");
let separatorSelector = "toolbarseparator[id^=customizableui-special-separator]"; let separatorSelector = "toolbarseparator[id^=customizableui-special-separator]";
ok(!navbar.querySelector(separatorSelector), "Shouldn't be a separator in the navbar"); ok(!navbar.querySelector(separatorSelector), "Shouldn't be a separator in the navbar");
CustomizableUI.addWidgetToArea('separator', 'nav-bar'); CustomizableUI.addWidgetToArea("separator", "nav-bar");
yield startCustomizing(); yield startCustomizing();
let separator = navbar.querySelector(separatorSelector); let separator = navbar.querySelector(separatorSelector);
ok(separator, "There should be a separator in the navbar now."); ok(separator, "There should be a separator in the navbar now.");

View file

@ -15,7 +15,7 @@ add_task(function*() {
let panelHiddenPromise = promisePanelHidden(window); let panelHiddenPromise = promisePanelHidden(window);
PanelUI.hide(); PanelUI.hide();
yield panelHiddenPromise; yield panelHiddenPromise;
CustomizableUI.addWidgetToArea("characterencoding-button", 'nav-bar'); CustomizableUI.addWidgetToArea("characterencoding-button", "nav-bar");
let button = document.getElementById("characterencoding-button"); let button = document.getElementById("characterencoding-button");
ok(!button.hasAttribute("disabled"), "Button shouldn't be disabled"); ok(!button.hasAttribute("disabled"), "Button shouldn't be disabled");
}); });

View file

@ -13,7 +13,7 @@ add_task(function*() {
// create mocked addon button on the navigation bar // create mocked addon button on the navigation bar
let widgetSpec = { let widgetSpec = {
id: kButton, id: kButton,
type: 'button', type: "button",
onClick() { onClick() {
gBrowser.selectedTab = gBrowser.addTab("about:addons"); gBrowser.selectedTab = gBrowser.addTab("about:addons");
} }

View file

@ -10,20 +10,20 @@ var addonbar = document.getElementById(addonbarID);
// Check that currentset is correctly updated after a reset: // Check that currentset is correctly updated after a reset:
add_task(function*() { add_task(function*() {
let placements = CustomizableUI.getWidgetIdsInArea(addonbarID); let placements = CustomizableUI.getWidgetIdsInArea(addonbarID);
is(placements.join(','), addonbar.getAttribute("currentset"), "Addon-bar currentset should match default placements"); is(placements.join(","), addonbar.getAttribute("currentset"), "Addon-bar currentset should match default placements");
ok(CustomizableUI.inDefaultState, "Should be in default state"); ok(CustomizableUI.inDefaultState, "Should be in default state");
info("Adding a spring to add-on bar shim"); info("Adding a spring to add-on bar shim");
CustomizableUI.addWidgetToArea("spring", addonbarID, 1); CustomizableUI.addWidgetToArea("spring", addonbarID, 1);
ok(addonbar.getElementsByTagName("toolbarspring").length, "There should be a spring in the toolbar"); ok(addonbar.getElementsByTagName("toolbarspring").length, "There should be a spring in the toolbar");
ok(!CustomizableUI.inDefaultState, "Should no longer be in default state"); ok(!CustomizableUI.inDefaultState, "Should no longer be in default state");
placements = CustomizableUI.getWidgetIdsInArea(addonbarID); placements = CustomizableUI.getWidgetIdsInArea(addonbarID);
is(placements.join(','), addonbar.getAttribute("currentset"), "Addon-bar currentset should match placements after spring addition"); is(placements.join(","), addonbar.getAttribute("currentset"), "Addon-bar currentset should match placements after spring addition");
yield startCustomizing(); yield startCustomizing();
yield gCustomizeMode.reset(); yield gCustomizeMode.reset();
ok(CustomizableUI.inDefaultState, "Should be in default state after reset"); ok(CustomizableUI.inDefaultState, "Should be in default state after reset");
placements = CustomizableUI.getWidgetIdsInArea(addonbarID); placements = CustomizableUI.getWidgetIdsInArea(addonbarID);
is(placements.join(','), addonbar.getAttribute("currentset"), "Addon-bar currentset should match default placements after reset"); is(placements.join(","), addonbar.getAttribute("currentset"), "Addon-bar currentset should match default placements after reset");
ok(!addonbar.getElementsByTagName("toolbarspring").length, "There should be no spring in the toolbar"); ok(!addonbar.getElementsByTagName("toolbarspring").length, "There should be no spring in the toolbar");
yield endCustomizing(); yield endCustomizing();
}); });

View file

@ -3,7 +3,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict"; "use strict";
const kWidgetId = 'test-981418-widget-onbeforecreated'; const kWidgetId = "test-981418-widget-onbeforecreated";
// Should be able to add broken view widget // Should be able to add broken view widget
add_task(function* testAddOnBeforeCreatedWidget() { add_task(function* testAddOnBeforeCreatedWidget() {
@ -11,14 +11,14 @@ add_task(function* testAddOnBeforeCreatedWidget() {
let onBeforeCreatedCalled = false; let onBeforeCreatedCalled = false;
let widgetSpec = { let widgetSpec = {
id: kWidgetId, id: kWidgetId,
type: 'view', type: "view",
viewId: kWidgetId + 'idontexistyet', viewId: kWidgetId + "idontexistyet",
onBeforeCreated(doc) { onBeforeCreated(doc) {
let view = doc.createElement("panelview"); let view = doc.createElement("panelview");
view.id = kWidgetId + 'idontexistyet'; view.id = kWidgetId + "idontexistyet";
let label = doc.createElement("label"); let label = doc.createElement("label");
label.setAttribute("value", "Hello world"); label.setAttribute("value", "Hello world");
label.className = 'panel-subview-header'; label.className = "panel-subview-header";
view.appendChild(label); view.appendChild(label);
document.getElementById("PanelUI-multiView").appendChild(view); document.getElementById("PanelUI-multiView").appendChild(view);
onBeforeCreatedCalled = true; onBeforeCreatedCalled = true;

View file

@ -546,13 +546,13 @@ GenericProtocolHandler.prototype = {
}; };
function FeedProtocolHandler() { function FeedProtocolHandler() {
this._init('feed'); this._init("feed");
} }
FeedProtocolHandler.prototype = new GenericProtocolHandler(); FeedProtocolHandler.prototype = new GenericProtocolHandler();
FeedProtocolHandler.prototype.classID = Components.ID("{4f91ef2e-57ba-472e-ab7a-b4999e42d6c0}"); FeedProtocolHandler.prototype.classID = Components.ID("{4f91ef2e-57ba-472e-ab7a-b4999e42d6c0}");
function PodCastProtocolHandler() { function PodCastProtocolHandler() {
this._init('pcast'); this._init("pcast");
} }
PodCastProtocolHandler.prototype = new GenericProtocolHandler(); PodCastProtocolHandler.prototype = new GenericProtocolHandler();
PodCastProtocolHandler.prototype.classID = Components.ID("{1c31ed79-accd-4b94-b517-06e0c81999d5}"); PodCastProtocolHandler.prototype.classID = Components.ID("{1c31ed79-accd-4b94-b517-06e0c81999d5}");

View file

@ -180,7 +180,7 @@ FeedWriter.prototype = {
element.removeChild(element.firstChild); element.removeChild(element.firstChild);
element.appendChild(textNode); element.appendChild(textNode);
if (text.base) { if (text.base) {
element.setAttributeNS(XML_NS, 'base', text.base.spec); element.setAttributeNS(XML_NS, "base", text.base.spec);
} }
}, },
@ -232,15 +232,15 @@ FeedWriter.prototype = {
_setCheckboxCheckedState(aCheckbox, aValue) { _setCheckboxCheckedState(aCheckbox, aValue) {
// see checkbox.xml, xbl bindings are not applied within the sandbox! TODO // see checkbox.xml, xbl bindings are not applied within the sandbox! TODO
let change = (aValue != (aCheckbox.getAttribute('checked') == 'true')); let change = (aValue != (aCheckbox.getAttribute("checked") == "true"));
if (aValue) if (aValue)
aCheckbox.setAttribute('checked', 'true'); aCheckbox.setAttribute("checked", "true");
else else
aCheckbox.removeAttribute('checked'); aCheckbox.removeAttribute("checked");
if (change) { if (change) {
let event = this._document.createEvent('Events'); let event = this._document.createEvent("Events");
event.initEvent('CheckboxStateChange', true, true); event.initEvent("CheckboxStateChange", true, true);
aCheckbox.dispatchEvent(event); aCheckbox.dispatchEvent(event);
} }
}, },
@ -268,8 +268,8 @@ FeedWriter.prototype = {
const locale = Cc["@mozilla.org/chrome/chrome-registry;1"] const locale = Cc["@mozilla.org/chrome/chrome-registry;1"]
.getService(Ci.nsIXULChromeRegistry) .getService(Ci.nsIXULChromeRegistry)
.getSelectedLocale("global", true); .getSelectedLocale("global", true);
const dtOptions = { year: 'numeric', month: 'long', day: 'numeric', const dtOptions = { year: "numeric", month: "long", day: "numeric",
hour: 'numeric', minute: 'numeric' }; hour: "numeric", minute: "numeric" };
this.__dateFormatter = new Intl.DateTimeFormat(locale, dtOptions); this.__dateFormatter = new Intl.DateTimeFormat(locale, dtOptions);
} }
return this.__dateFormatter; return this.__dateFormatter;
@ -351,8 +351,8 @@ FeedWriter.prototype = {
// Fix the margin on the main title, so that the image doesn't run over // Fix the margin on the main title, so that the image doesn't run over
// the underline // the underline
feedTitleLink.setAttribute('title', titleText); feedTitleLink.setAttribute("title", titleText);
feedTitleText.style.marginRight = titleImageWidth + 'px'; feedTitleText.style.marginRight = titleImageWidth + "px";
this._safeSetURIAttribute(feedTitleLink, "href", this._safeSetURIAttribute(feedTitleLink, "href",
parts.getPropertyAsAString("link")); parts.getPropertyAsAString("link"));
@ -747,15 +747,15 @@ FeedWriter.prototype = {
let header = this._document.getElementById("feedHeader"); let header = this._document.getElementById("feedHeader");
switch (feedType) { switch (feedType) {
case Ci.nsIFeed.TYPE_VIDEO: case Ci.nsIFeed.TYPE_VIDEO:
header.className = 'videoPodcastBackground'; header.className = "videoPodcastBackground";
break; break;
case Ci.nsIFeed.TYPE_AUDIO: case Ci.nsIFeed.TYPE_AUDIO:
header.className = 'audioPodcastBackground'; header.className = "audioPodcastBackground";
break; break;
default: default:
header.className = 'feedBackground'; header.className = "feedBackground";
} }
let liveBookmarksMenuItem = this._document.getElementById("liveBookmarksMenuItem"); let liveBookmarksMenuItem = this._document.getElementById("liveBookmarksMenuItem");
@ -863,7 +863,7 @@ FeedWriter.prototype = {
feedinfo1.textContent = feedinfo1Str; feedinfo1.textContent = feedinfo1Str;
feedinfo2.textContent = feedinfo2Str; feedinfo2.textContent = feedinfo2Str;
header.setAttribute('firstrun', 'true'); header.setAttribute("firstrun", "true");
this._mm.sendAsyncMessage("FeedWriter:ShownFirstRun"); this._mm.sendAsyncMessage("FeedWriter:ShownFirstRun");
} }

View file

@ -103,11 +103,11 @@ if (AppConstants.MOZ_CRASHREPORTER) {
} }
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() { XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
return Services.strings.createBundle('chrome://branding/locale/brand.properties'); return Services.strings.createBundle("chrome://branding/locale/brand.properties");
}); });
XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() { XPCOMUtils.defineLazyGetter(this, "gBrowserBundle", function() {
return Services.strings.createBundle('chrome://browser/locale/browser.properties'); return Services.strings.createBundle("chrome://browser/locale/browser.properties");
}); });
// Seconds of idle before trying to create a bookmarks backup. // Seconds of idle before trying to create a bookmarks backup.
@ -509,7 +509,7 @@ BrowserGlue.prototype = {
let brandShortName = brandBundle.getString("brandShortName"); let brandShortName = brandBundle.getString("brandShortName");
let message = win.gNavigatorBundle.getFormattedString("addonwatch.slow", [addon.name, brandShortName]); let message = win.gNavigatorBundle.getFormattedString("addonwatch.slow", [addon.name, brandShortName]);
let notificationBox = win.document.getElementById("global-notificationbox"); let notificationBox = win.document.getElementById("global-notificationbox");
let notificationId = 'addon-slow:' + addonId; let notificationId = "addon-slow:" + addonId;
let notification = notificationBox.getNotificationWithValue(notificationId); let notification = notificationBox.getNotificationWithValue(notificationId);
// Monitor the response of users // Monitor the response of users

View file

@ -152,10 +152,10 @@ function* doTest(aBrowser) {
let URLSuffix = "?r=" + arg.randomSuffix; let URLSuffix = "?r=" + arg.randomSuffix;
// Create the audio and video elements. // Create the audio and video elements.
let audio = content.document.createElement('audio'); let audio = content.document.createElement("audio");
let video = content.document.createElement('video'); let video = content.document.createElement("video");
let audioSource = content.document.createElement('source'); let audioSource = content.document.createElement("source");
let audioTrack = content.document.createElement('track'); let audioTrack = content.document.createElement("track");
// Append the audio and track element into the body, and wait until they're finished. // Append the audio and track element into the body, and wait until they're finished.
yield new Promise(resolve => { yield new Promise(resolve => {

View file

@ -2,11 +2,11 @@ let Cu = Components.utils;
let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {}); let {HttpServer} = Cu.import("resource://testing-common/httpd.js", {});
let server = new HttpServer(); let server = new HttpServer();
server.registerPathHandler('/file.html', fileHandler); server.registerPathHandler("/file.html", fileHandler);
server.start(-1); server.start(-1);
let BASE_URI = 'http://localhost:' + server.identity.primaryPort; let BASE_URI = "http://localhost:" + server.identity.primaryPort;
let FILE_URI = BASE_URI + '/file.html'; let FILE_URI = BASE_URI + "/file.html";
let credentialQueue = []; let credentialQueue = [];

View file

@ -13,8 +13,8 @@ const NUM_CACHED_LOADS = 1;
let gHits = 0; let gHits = 0;
let server = new HttpServer(); let server = new HttpServer();
server.registerPathHandler('/image.png', imageHandler); server.registerPathHandler("/image.png", imageHandler);
server.registerPathHandler('/file.html', fileHandler); server.registerPathHandler("/file.html", fileHandler);
server.start(-1); server.start(-1);
registerCleanupFunction(() => { registerCleanupFunction(() => {
@ -23,12 +23,12 @@ registerCleanupFunction(() => {
}); });
}); });
let BASE_URI = 'http://localhost:' + server.identity.primaryPort; let BASE_URI = "http://localhost:" + server.identity.primaryPort;
let IMAGE_URI = BASE_URI + '/image.png'; let IMAGE_URI = BASE_URI + "/image.png";
let FILE_URI = BASE_URI + '/file.html'; let FILE_URI = BASE_URI + "/file.html";
function imageHandler(metadata, response) { function imageHandler(metadata, response) {
info('XXX: loading image from server'); info("XXX: loading image from server");
gHits++; gHits++;
response.setHeader("Cache-Control", "max-age=10000", false); response.setHeader("Cache-Control", "max-age=10000", false);
response.setStatusLine(metadata.httpVersion, 200, "OK"); response.setStatusLine(metadata.httpVersion, 200, "OK");
@ -46,15 +46,15 @@ function fileHandler(metadata, response) {
function doBefore() { function doBefore() {
// reset hit counter // reset hit counter
info('XXX resetting gHits'); info("XXX resetting gHits");
gHits = 0; gHits = 0;
info('XXX clearing image cache'); info("XXX clearing image cache");
let imageCache = Cc["@mozilla.org/image/tools;1"] let imageCache = Cc["@mozilla.org/image/tools;1"]
.getService(Ci.imgITools) .getService(Ci.imgITools)
.getImgCacheForDocument(null); .getImgCacheForDocument(null);
imageCache.clearCache(true); imageCache.clearCache(true);
imageCache.clearCache(false); imageCache.clearCache(false);
info('XXX clearning network cache'); info("XXX clearning network cache");
let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"] let networkCache = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService); .getService(Ci.nsICacheStorageService);
networkCache.clear(); networkCache.clear();

View file

@ -2,7 +2,7 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
'use strict'; "use strict";
const TEST_URL_PATH = "/browser/browser/components/originattributes/test/browser/"; const TEST_URL_PATH = "/browser/browser/components/originattributes/test/browser/";
@ -73,7 +73,7 @@ function* openTabInFirstParty(aURL, aFirstPartyDomain,
aFrameSetting = DEFAULT_FRAME_SETTING) { aFrameSetting = DEFAULT_FRAME_SETTING) {
// If the first party domain ends with '/', we remove it. // If the first party domain ends with '/', we remove it.
if (aFirstPartyDomain.endsWith('/')) { if (aFirstPartyDomain.endsWith("/")) {
aFirstPartyDomain = aFirstPartyDomain.slice(0, -1); aFirstPartyDomain = aFirstPartyDomain.slice(0, -1);
} }
@ -117,11 +117,11 @@ function* openTabInFirstParty(aURL, aFirstPartyDomain,
if (type === typeFrame) { if (type === typeFrame) {
// Add a frameset which carries the frame element. // Add a frameset which carries the frame element.
let frameSet = document.createElement('frameset'); let frameSet = document.createElement("frameset");
frameSet.cols = "50%,50%"; frameSet.cols = "50%,50%";
let frame = document.createElement('frame'); let frame = document.createElement("frame");
let dummyFrame = document.createElement('frame'); let dummyFrame = document.createElement("frame");
frameSet.appendChild(frame); frameSet.appendChild(frame);
frameSet.appendChild(dummyFrame); frameSet.appendChild(dummyFrame);
@ -131,7 +131,7 @@ function* openTabInFirstParty(aURL, aFirstPartyDomain,
frameElement = frame; frameElement = frame;
} else if (type === typeIFrame) { } else if (type === typeIFrame) {
// Add an iframe. // Add an iframe.
let iframe = document.createElement('iframe'); let iframe = document.createElement("iframe");
document.body.appendChild(iframe); document.body.appendChild(iframe);
frameElement = iframe; frameElement = iframe;

View file

@ -57,7 +57,7 @@
* been performed by the dialog. * been performed by the dialog.
*/ */
Components.utils.import('resource://gre/modules/XPCOMUtils.jsm'); Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils", XPCOMUtils.defineLazyModuleGetter(this, "PrivateBrowsingUtils",
"resource://gre/modules/PrivateBrowsingUtils.jsm"); "resource://gre/modules/PrivateBrowsingUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "Task", XPCOMUtils.defineLazyModuleGetter(this, "Task",

View file

@ -9,7 +9,7 @@ function init() {
} }
function searchBookmarks(aSearchString) { function searchBookmarks(aSearchString) {
var tree = document.getElementById('bookmarks-view'); var tree = document.getElementById("bookmarks-view");
if (!aSearchString) if (!aSearchString)
tree.place = tree.place; tree.place = tree.place;
else else

Some files were not shown because too many files have changed in this diff Show more