diff --git a/.eslintignore b/.eslintignore
index e02d302d64f5..61f457a45974 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -116,17 +116,9 @@ devtools/client/storage/test/*.html
!devtools/client/storage/test/storage-search.html
!devtools/client/storage/test/storage-unsecured-iframe.html
!devtools/client/storage/test/storage-unsecured-iframe-usercontextid.html
-devtools/client/webaudioeditor/**
-devtools/client/webconsole/old/net/**
-!devtools/client/webconsole/test/mochitest/**
-devtools/client/webconsole/old/test/**
-devtools/client/webconsole/old/webconsole.js
-devtools/client/webide/**
-!devtools/client/webide/components/webideCli.js
devtools/server/tests/browser/storage-*.html
!devtools/server/tests/browser/storage-unsecured-iframe.html
devtools/server/tests/browser/stylesheets-nested-iframes.html
-devtools/server/tests/unit/xpcshell_debugging_script.js
devtools/client/shared/webpack/shims/test/test_clipboard.html
devtools/shared/qrcode/tests/mochitest/test_decode.html
devtools/shared/tests/mochitest/*.html
@@ -137,6 +129,10 @@ devtools/client/commandline/**
# Soon to be removed, the new/ directory is explicitly excluded below due to
# also being an imported repository.
devtools/client/debugger/**
+# Soon to be removed
+devtools/client/webconsole/old/net/**
+devtools/client/webconsole/old/test/**
+devtools/client/webconsole/old/webconsole.js
# Ignore devtools imported repositories
devtools/client/debugger/new/**
@@ -144,6 +140,7 @@ devtools/client/shared/components/reps/**
# Ignore devtools preferences files
devtools/client/preferences/**
+devtools/client/webide/preferences/**
devtools/shared/preferences/**
devtools/startup/preferences/devtools-startup.js
@@ -180,6 +177,9 @@ devtools/server/tests/unit/babel_and_browserify_script_with_source_map.js
devtools/server/tests/unit/setBreakpoint*
devtools/server/tests/unit/sourcemapped.js
+# devtools specific format test file
+devtools/server/tests/unit/xpcshell_debugging_script.js
+
# dom/ exclusions
dom/abort/**
dom/animation/**
@@ -343,7 +343,6 @@ services/sync/services-sync.js
servo/**
# Remote protocol exclusions
-testing/marionette/test_*.js
testing/marionette/atom.js
testing/marionette/legacyaction.js
testing/marionette/client
diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js
index c2965079169d..72d21131d484 100644
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -499,8 +499,7 @@ const gStoragePressureObserver = {
_lastNotificationTime: -1,
observe(subject, topic, data) {
- if (topic != "QuotaManager::StoragePressure" ||
- !Services.prefs.getBoolPref("browser.storageManager.enabled")) {
+ if (topic != "QuotaManager::StoragePressure") {
return;
}
diff --git a/browser/base/content/test/general/browser_storagePressure_notification.js b/browser/base/content/test/general/browser_storagePressure_notification.js
index 4f1d37f484e3..ee0d15d7a51c 100644
--- a/browser/base/content/test/general/browser_storagePressure_notification.js
+++ b/browser/base/content/test/general/browser_storagePressure_notification.js
@@ -23,7 +23,6 @@ function openAboutPrefPromise() {
// Test only displaying notification once within the given interval
add_task(async function() {
const TEST_NOTIFICATION_INTERVAL_MS = 2000;
- await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.pressureNotification.minIntervalMS", TEST_NOTIFICATION_INTERVAL_MS]]});
// Commenting this to see if we really need it
// await SpecialPowers.pushPrefEnv({set: [["privacy.reduceTimerPrecision", false]]});
@@ -47,7 +46,6 @@ add_task(async function() {
// Test guiding user to the about:preferences when usage exceeds the given threshold
add_task(async function() {
- await SpecialPowers.pushPrefEnv({ set: [["browser.storageManager.enabled", true]] });
await SpecialPowers.pushPrefEnv({ set: [["browser.storageManager.pressureNotification.minIntervalMS", 0]] });
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, "https://example.com");
@@ -74,7 +72,6 @@ add_task(async function() {
// Test not displaying the 2nd notification if one is already being displayed
add_task(async function() {
const TEST_NOTIFICATION_INTERVAL_MS = 0;
- await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
await SpecialPowers.pushPrefEnv({set: [["browser.storageManager.pressureNotification.minIntervalMS", TEST_NOTIFICATION_INTERVAL_MS]]});
await notifyStoragePressure();
diff --git a/browser/components/customizableui/CustomizableWidgets.jsm b/browser/components/customizableui/CustomizableWidgets.jsm
index 38c7f94b0bf8..ba0733dada2c 100644
--- a/browser/components/customizableui/CustomizableWidgets.jsm
+++ b/browser/components/customizableui/CustomizableWidgets.jsm
@@ -744,7 +744,9 @@ if (Services.prefs.getBoolPref("identity.fxaccounts.enabled")) {
// We need to use "click" instead of "command" here so openUILink
// respects different buttons (eg, to open in a new tab).
item.addEventListener("click", e => {
- doc.defaultView.openWebLinkIn(tabInfo.url, e);
+ doc.defaultView.openUILink(tabInfo.url, e, {
+ triggeringPrincipal: Services.scriptSecurityManager.createNullPrincipal({})
+ });
if (doc.defaultView.whereToOpenLink(e) != "current") {
e.preventDefault();
e.stopPropagation();
diff --git a/browser/components/customizableui/test/browser_synced_tabs_menu.js b/browser/components/customizableui/test/browser_synced_tabs_menu.js
index b0b2a100cfbc..c211ab7db265 100644
--- a/browser/components/customizableui/test/browser_synced_tabs_menu.js
+++ b/browser/components/customizableui/test/browser_synced_tabs_menu.js
@@ -19,6 +19,8 @@ const DECKINDEX_TABSDISABLED = 1;
const DECKINDEX_FETCHING = 2;
const DECKINDEX_NOCLIENTS = 3;
+const SAMPLE_TAB_URL = "https://example.com/";
+
var initialLocation = gBrowser.currentURI.spec;
var newTab = null;
@@ -335,7 +337,7 @@ add_task(async function() {
// on the second to last page we should have 22 items shown
// (because we have to show at least NEXT_PAGE_MIN_TABS=5 tabs on the last page)
for (let i = 1; i <= 77; i++) {
- allTabsDesktop.push({ title: "Tab #" + i });
+ allTabsDesktop.push({ title: "Tab #" + i, url: SAMPLE_TAB_URL });
}
return allTabsDesktop;
}(),
@@ -343,6 +345,7 @@ add_task(async function() {
]);
};
+
gSync.updateAllUI({ status: UIState.STATUS_SIGNED_IN, lastSync: new Date(),
email: "foo@bar.com" });
@@ -370,6 +373,7 @@ add_task(async function() {
node = node.nextSibling;
is(node.getAttribute("itemtype"), "tab", "node is a tab");
is(node.getAttribute("label"), "Tab #" + (i + 1), "the tab is the correct one");
+ is(node.getAttribute("targetURI"), SAMPLE_TAB_URL, "url is the correct one");
}
let showMoreButton;
if (showMoreLabel) {
@@ -383,6 +387,14 @@ add_task(async function() {
return showMoreButton;
}
+ async function checkCanOpenURL() {
+ let tabList = document.getElementById("PanelUI-remotetabs-tabslist");
+ let node = tabList.firstChild.nextSibling;
+ let promiseTabOpened = BrowserTestUtils.waitForLocationChange(gBrowser, SAMPLE_TAB_URL);
+ node.click();
+ await promiseTabOpened;
+ }
+
let showMoreButton;
function clickShowMoreButton() {
let promise = promiseObserverNotified("synced-tabs-menu:test:tabs-updated");
@@ -400,6 +412,6 @@ add_task(async function() {
await clickShowMoreButton();
checkTabsPage(77, null);
-
- await hideOverflow();
+ /* calling this will close the overflow menu */
+ await checkCanOpenURL();
});
diff --git a/browser/components/extensions/ExtensionPopups.jsm b/browser/components/extensions/ExtensionPopups.jsm
index 572f596c90ba..3140d9ee4f59 100644
--- a/browser/components/extensions/ExtensionPopups.jsm
+++ b/browser/components/extensions/ExtensionPopups.jsm
@@ -368,7 +368,7 @@ class BasePopup {
this.panel.style.setProperty("--arrowpanel-background", background);
if (background == "#fff") {
// Set a usable default color that work with the default background-color.
- this.panel.style.setProperty("--arrowpanel-border-color", "hsla(210,4%,10%,.05)");
+ this.panel.style.setProperty("--arrowpanel-border-color", "hsla(210,4%,10%,.15)");
}
this.background = background;
}
diff --git a/browser/components/nsBrowserGlue.js b/browser/components/nsBrowserGlue.js
index c08990d53649..e8656cbf7ca6 100644
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2767,9 +2767,7 @@ const ContentPermissionIntegration = {
return new PermissionUI.DesktopNotificationPermissionPrompt(request);
}
case "persistent-storage": {
- if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
- return new PermissionUI.PersistentStoragePermissionPrompt(request);
- }
+ return new PermissionUI.PersistentStoragePermissionPrompt(request);
}
case "midi": {
return new PermissionUI.MIDIPermissionPrompt(request);
diff --git a/browser/components/preferences/in-content/privacy.js b/browser/components/preferences/in-content/privacy.js
index 094d56e6a38a..675fef17de13 100644
--- a/browser/components/preferences/in-content/privacy.js
+++ b/browser/components/preferences/in-content/privacy.js
@@ -337,25 +337,21 @@ var gPrivacyPane = {
}
}
- if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
- Services.obs.addObserver(this, "sitedatamanager:sites-updated");
- Services.obs.addObserver(this, "sitedatamanager:updating-sites");
- let unload = () => {
- window.removeEventListener("unload", unload);
- Services.obs.removeObserver(this, "sitedatamanager:sites-updated");
- Services.obs.removeObserver(this, "sitedatamanager:updating-sites");
- };
- window.addEventListener("unload", unload);
- SiteDataManager.updateSites();
- setEventListener("clearSiteDataButton", "command",
- gPrivacyPane.clearSiteData);
- setEventListener("siteDataSettings", "command",
- gPrivacyPane.showSiteDataSettings);
- let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
- document.getElementById("siteDataLearnMoreLink").setAttribute("href", url);
- let siteDataGroup = document.getElementById("siteDataGroup");
- siteDataGroup.removeAttribute("data-hidden-from-search");
- }
+ Services.obs.addObserver(this, "sitedatamanager:sites-updated");
+ Services.obs.addObserver(this, "sitedatamanager:updating-sites");
+ let unload = () => {
+ window.removeEventListener("unload", unload);
+ Services.obs.removeObserver(this, "sitedatamanager:sites-updated");
+ Services.obs.removeObserver(this, "sitedatamanager:updating-sites");
+ };
+ window.addEventListener("unload", unload);
+ SiteDataManager.updateSites();
+ setEventListener("clearSiteDataButton", "command",
+ gPrivacyPane.clearSiteData);
+ setEventListener("siteDataSettings", "command",
+ gPrivacyPane.showSiteDataSettings);
+ let url = Services.urlFormatter.formatURLPref("app.support.baseURL") + "storage-permissions";
+ document.getElementById("siteDataLearnMoreLink").setAttribute("href", url);
let notificationInfoURL =
Services.urlFormatter.formatURLPref("app.support.baseURL") + "push";
diff --git a/browser/components/preferences/in-content/privacy.xul b/browser/components/preferences/in-content/privacy.xul
index 0ea479eb3a04..d7567e63b991 100644
--- a/browser/components/preferences/in-content/privacy.xul
+++ b/browser/components/preferences/in-content/privacy.xul
@@ -160,7 +160,7 @@
-
+
diff --git a/browser/components/preferences/in-content/tests/browser_bug731866.js b/browser/components/preferences/in-content/tests/browser_bug731866.js
index 5f58b480e54a..791a07150c6d 100644
--- a/browser/components/preferences/in-content/tests/browser_bug731866.js
+++ b/browser/components/preferences/in-content/tests/browser_bug731866.js
@@ -4,7 +4,6 @@
ChromeUtils.import("resource://gre/modules/PlacesUtils.jsm");
ChromeUtils.import("resource://gre/modules/NetUtil.jsm");
-const storageManagerDisabled = !SpecialPowers.getBoolPref("browser.storageManager.enabled");
const browserContainersGroupDisabled = !SpecialPowers.getBoolPref("privacy.userContext.ui.enabled");
function test() {
@@ -22,14 +21,7 @@ function checkElements(expectedPane) {
element.id === "drmGroup") {
continue;
}
- // The siteDataGroup in the Storage Management project is currently only pref-on on Nightly for testing purpose.
- // During the test and the transition period, we have to check the pref to see if the siteDataGroup
- // should be hidden always. This would be a bit bothersome, same as the offlineGroup as below.
- // However, this checking is necessary to make sure we don't leak the siteDataGroup into beta/release build
- if (element.id == "siteDataGroup" && storageManagerDisabled) {
- is_element_hidden(element, "Disabled siteDataGroup should be hidden");
- continue;
- }
+
// The browserContainersGroup is still only pref-on on Nightly
if (element.id == "browserContainersGroup" && browserContainersGroupDisabled) {
is_element_hidden(element, "Disabled browserContainersGroup should be hidden");
diff --git a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js
index 3ba7cdd4ac19..552c48765b55 100644
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_3.js
@@ -5,8 +5,7 @@
// Enabling Searching functionatily. Will display search bar form this testcase forward.
add_task(async function() {
await SpecialPowers.pushPrefEnv({"set": [
- ["browser.preferences.search", true],
- ["browser.storageManager.enabled", true]
+ ["browser.preferences.search", true]
]});
});
diff --git a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_7.js b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_7.js
index e9749d4dc679..b30705cc9413 100644
--- a/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_7.js
+++ b/browser/components/preferences/in-content/tests/browser_search_subdialogs_within_preferences_7.js
@@ -7,8 +7,7 @@ requestLongerTimeout(2);
// Enabling Searching functionatily. Will display search bar form this testcase forward.
add_task(async function() {
await SpecialPowers.pushPrefEnv({"set": [
- ["browser.preferences.search", true],
- ["browser.storageManager.enabled", true]
+ ["browser.preferences.search", true]
]});
});
diff --git a/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js b/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
index 6a6787a545de..2fce25d6325b 100644
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_1.js
@@ -212,49 +212,6 @@ add_task(async function exiting_search_reverts_to_general_pane() {
BrowserTestUtils.removeTab(gBrowser.selectedTab);
});
-/**
- * Test for "Site Data" case, verifying elements with data-hidden-from-search = true
- * are hidden in search result.
- */
-add_task(async function verify_hidden_from_search_elements_dont_show_up() {
- await SpecialPowers.pushPrefEnv({ "set": [["browser.storageManager.enabled", false]] });
- await openPreferencesViaOpenPreferencesAPI("privacy", { leaveOpen: true });
- let generalPane = gBrowser.contentDocument.getElementById("generalCategory");
-
- is_element_hidden(generalPane, "Should not be in general");
-
- // Performs search
- let searchInput = gBrowser.contentDocument.getElementById("searchInput");
-
- is(searchInput, gBrowser.contentDocument.activeElement.closest("#searchInput"),
- "Search input should be focused when visiting preferences");
-
- let query = "site data";
- let searchCompletedPromise = BrowserTestUtils.waitForEvent(
- gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == query);
- EventUtils.sendString(query);
- await searchCompletedPromise;
-
- let mainPrefTag = gBrowser.contentDocument.getElementById("mainPrefPane");
-
- let child = mainPrefTag.querySelector("#siteDataGroup");
- is_element_hidden(child, "Should be hidden in search results");
-
- // Takes search off
- searchCompletedPromise = BrowserTestUtils.waitForEvent(
- gBrowser.contentWindow, "PreferencesSearchCompleted", evt => evt.detail == "");
- let count = query.length;
- while (count--) {
- EventUtils.sendKey("BACK_SPACE");
- }
- await searchCompletedPromise;
-
- // Checks if back to normal
- is_element_visible(generalPane, "Should be in generalPane");
-
- BrowserTestUtils.removeTab(gBrowser.selectedTab);
-});
-
/**
* Test for if we go to another tab after searching
*/
diff --git a/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js b/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
index c9d6ea1ff63c..ab5e37fe98d4 100644
--- a/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
+++ b/browser/components/preferences/in-content/tests/browser_search_within_preferences_command.js
@@ -4,7 +4,6 @@
* Test for "command" event on search input (when user clicks the x button)
*/
add_task(async function() {
- await SpecialPowers.pushPrefEnv({"set": [["browser.storageManager.enabled", false]]});
await openPreferencesViaOpenPreferencesAPI("privacy", {leaveOpen: true});
let generalPane = gBrowser.contentDocument.getElementById("generalCategory");
diff --git a/browser/modules/SitePermissions.jsm b/browser/modules/SitePermissions.jsm
index fb34716edc10..aa1f7b52995b 100644
--- a/browser/modules/SitePermissions.jsm
+++ b/browser/modules/SitePermissions.jsm
@@ -684,12 +684,6 @@ var gPermissionObject = {
}
};
-// Delete this entry while being pre-off
-// or the persistent-storage permission would appear in Page info's Permission section
-if (!Services.prefs.getBoolPref("browser.storageManager.enabled")) {
- delete gPermissionObject["persistent-storage"];
-}
-
if (!Services.prefs.getBoolPref("dom.webmidi.enabled")) {
// ESLint gets angry about array versus dot notation here, but some permission
// names use hyphens. Disabling rule for line to keep things consistent.
diff --git a/browser/modules/test/unit/test_SitePermissions.js b/browser/modules/test/unit/test_SitePermissions.js
index c39b0e721404..3a05d1aa8df5 100644
--- a/browser/modules/test/unit/test_SitePermissions.js
+++ b/browser/modules/test/unit/test_SitePermissions.js
@@ -6,19 +6,13 @@
ChromeUtils.import("resource:///modules/SitePermissions.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
-const STORAGE_MANAGER_ENABLED = Services.prefs.getBoolPref("browser.storageManager.enabled");
const RESIST_FINGERPRINTING_ENABLED = Services.prefs.getBoolPref("privacy.resistFingerprinting");
const MIDI_ENABLED = Services.prefs.getBoolPref("dom.webmidi.enabled");
add_task(async function testPermissionsListing() {
let expectedPermissions = ["camera", "cookie", "desktop-notification", "focus-tab-by-prompt",
- "geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts"];
- if (STORAGE_MANAGER_ENABLED) {
- // The persistent-storage permission is still only pref-on on Nightly
- // so we add it only when it's pref-on.
- // Should remove this checking and add it as default after it is fully pref-on.
- expectedPermissions.push("persistent-storage");
- }
+ "geo", "image", "install", "microphone", "plugin:flash", "popup", "screen", "shortcuts",
+ "persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
// is true.
@@ -113,13 +107,7 @@ add_task(async function testExactHostMatch() {
let subUri = Services.io.newURI("https://test1.example.com");
let exactHostMatched = ["desktop-notification", "focus-tab-by-prompt", "camera",
- "microphone", "screen", "geo"];
- if (STORAGE_MANAGER_ENABLED) {
- // The persistent-storage permission is still only pref-on on Nightly
- // so we add it only when it's pref-on.
- // Should remove this checking and add it as default after it is fully pref-on.
- exactHostMatched.push("persistent-storage");
- }
+ "microphone", "screen", "geo", "persistent-storage"];
if (RESIST_FINGERPRINTING_ENABLED) {
// Canvas permission should be hidden unless privacy.resistFingerprinting
// is true.
diff --git a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
index 7726d77c3709..9cbb899c0e4f 100644
--- a/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
+++ b/browser/tools/mozscreenshots/mozscreenshots/extension/configurations/PermissionPrompts.jsm
@@ -16,7 +16,6 @@ let lastTab = null;
var PermissionPrompts = {
init(libDir) {
- Services.prefs.setBoolPref("browser.storageManager.enabled", true);
Services.prefs.setBoolPref("media.navigator.permission.fake", true);
Services.prefs.setBoolPref("extensions.install.requireBuiltInCerts", false);
Services.prefs.setBoolPref("signon.rememberSignons", true);
diff --git a/devtools/.eslintrc.js b/devtools/.eslintrc.js
index 2ca546f4affc..c0b2b6d3f8d5 100644
--- a/devtools/.eslintrc.js
+++ b/devtools/.eslintrc.js
@@ -47,6 +47,7 @@ module.exports = {
"client/scratchpad/**",
"client/shared/*.jsm",
"client/shared/widgets/*.jsm",
+ "client/webide/**",
],
"rules": {
"consistent-return": "off",
@@ -56,6 +57,7 @@ module.exports = {
"client/framework/**",
"client/scratchpad/**",
"client/shared/AppCacheUtils.jsm",
+ "client/webide/**",
],
"rules": {
"max-nested-callbacks": "off",
@@ -66,6 +68,7 @@ module.exports = {
"client/scratchpad/**",
"client/shared/*.jsm",
"client/shared/widgets/*.jsm",
+ "client/webide/**",
],
"rules": {
"max-len": "off",
@@ -84,6 +87,7 @@ module.exports = {
"client/scratchpad/**",
"client/shared/*.jsm",
"client/shared/widgets/*.jsm",
+ "client/webide/**",
],
"rules": {
"mozilla/no-aArgs": "off",
@@ -102,6 +106,7 @@ module.exports = {
"client/scratchpad/**",
"client/shared/AppCacheUtils.jsm",
"client/shared/widgets/*.jsm",
+ "client/webide/**",
],
"rules": {
"no-shadow": "off",
@@ -110,6 +115,7 @@ module.exports = {
"files": [
"client/framework/**",
"client/scratchpad/**",
+ "client/webide/**",
],
"rules": {
"strict": "off",
@@ -122,16 +128,21 @@ module.exports = {
// Note: Bug 1342237 may be removing shadereditor, check before
// doing more work on enabling these rules.
"client/shadereditor/**",
+ // Note: Bug 1403944 may be removing webaudioeditor, check before
+ // doing more work on enabling these rules.
+ "client/webaudioeditor/**",
],
"rules": {
"consistent-return": "off",
"max-len": "off",
"mozilla/no-aArgs": "off",
"mozilla/var-only-at-top-level": "off",
+ "no-redeclare": "off",
"no-return-assign": "off",
"no-shadow": "off",
"no-undef": "off",
"no-unused-vars": "off",
+ "no-useless-call": "off",
"strict": "off",
}
}, {
diff --git a/devtools/client/aboutdebugging/test/head.js b/devtools/client/aboutdebugging/test/head.js
index eedeb2a1d225..26eb1fee1108 100644
--- a/devtools/client/aboutdebugging/test/head.js
+++ b/devtools/client/aboutdebugging/test/head.js
@@ -15,11 +15,6 @@ Services.scriptloader.loadSubScript(
const { AddonManager } = ChromeUtils.import("resource://gre/modules/AddonManager.jsm", {});
const { Management } = ChromeUtils.import("resource://gre/modules/Extension.jsm", {});
-flags.testing = true;
-registerCleanupFunction(() => {
- flags.testing = false;
-});
-
async function openAboutDebugging(page, win) {
info("opening about:debugging");
let url = "about:debugging";
diff --git a/devtools/client/commandline/test/head.js b/devtools/client/commandline/test/head.js
index c947a06e08f2..898caa16046d 100644
--- a/devtools/client/commandline/test/head.js
+++ b/devtools/client/commandline/test/head.js
@@ -19,11 +19,6 @@ var testDir = gTestPath.substr(0, gTestPath.lastIndexOf("/"));
Services.scriptloader.loadSubScript(testDir + "/helpers.js", this);
Services.scriptloader.loadSubScript(testDir + "/mockCommands.js", this, "UTF-8");
-flags.testing = true;
-SimpleTest.registerCleanupFunction(() => {
- flags.testing = false;
-});
-
function whenDelayedStartupFinished(aWindow, aCallback) {
Services.obs.addObserver(function observer(aSubject, aTopic) {
if (aWindow == aSubject) {
diff --git a/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js b/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js
index 4a9dbd83cafe..01dca058930d 100644
--- a/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js
+++ b/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js
@@ -12,8 +12,7 @@ add_task(async function() {
// TODO: This test tries to verify the normal behavior of the netmonitor and
// therefore needs to avoid the explicit check for tests. Bug 1167188 will
// allow us to remove this workaround.
- let isTesting = flags.testing;
- flags.testing = false;
+ await pushPref("devtools.testing", false);
let tab = await addTab(URL_ROOT + "doc_viewsource.html");
let target = TargetFactory.forTab(tab);
@@ -30,5 +29,4 @@ add_task(async function() {
await gDevTools.closeToolbox(target);
tab = target = toolbox = panel = null;
gBrowser.removeCurrentTab();
- flags.testing = isTesting;
});
diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js
index ec8651142400..a71c403c80a0 100644
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -23,6 +23,7 @@ var ChromeUtils = require("ChromeUtils");
var {gDevTools} = require("devtools/client/framework/devtools");
var EventEmitter = require("devtools/shared/event-emitter");
var Telemetry = require("devtools/client/shared/telemetry");
+const { getUnicodeUrl } = require("devtools/client/shared/unicode-url");
var { attachThread, detachThread } = require("./attach-thread");
var Menu = require("devtools/client/framework/menu");
var MenuItem = require("devtools/client/framework/menu-item");
@@ -2057,11 +2058,13 @@ Toolbox.prototype = {
let title;
if (this.target.name && this.target.name != this.target.url) {
const url = this.target.isWebExtension ?
- this.target.getExtensionPathName(this.target.url) : this.target.url;
+ this.target.getExtensionPathName(this.target.url) :
+ getUnicodeUrl(this.target.url);
title = L10N.getFormatStr("toolbox.titleTemplate2", this.target.name,
url);
} else {
- title = L10N.getFormatStr("toolbox.titleTemplate1", this.target.url);
+ title = L10N.getFormatStr("toolbox.titleTemplate1",
+ getUnicodeUrl(this.target.url));
}
this.postMessage({
name: "set-host-title",
@@ -2148,11 +2151,12 @@ Toolbox.prototype = {
// A frame is checked if it's the selected one.
let checked = frame.id == this.selectedFrameId;
- let label = frame.url;
-
+ let label;
if (this.target.isWebExtension) {
// Show a shorter url for extensions page.
label = this.target.getExtensionPathName(frame.url);
+ } else {
+ label = getUnicodeUrl(frame.url);
}
// Create menu item.
diff --git a/devtools/client/inspector/markup/test/head.js b/devtools/client/inspector/markup/test/head.js
index eb5843f2ea52..648426e3f49e 100644
--- a/devtools/client/inspector/markup/test/head.js
+++ b/devtools/client/inspector/markup/test/head.js
@@ -19,12 +19,6 @@ var {ActorRegistryFront} = require("devtools/shared/fronts/actor-registry");
// lines.
SimpleTest.requestCompleteLog();
-// Set the testing flag on DevToolsUtils and reset it when the test ends
-flags.testing = true;
-registerCleanupFunction(() => {
- flags.testing = false;
-});
-
// Toggle this pref on to see all DevTools event communication. This is hugely
// useful for fixing race conditions.
// Services.prefs.setBoolPref("devtools.dump.emit", true);
diff --git a/devtools/client/inspector/test/head.js b/devtools/client/inspector/test/head.js
index 6ee7f27d3510..c4f83f0e2305 100644
--- a/devtools/client/inspector/test/head.js
+++ b/devtools/client/inspector/test/head.js
@@ -32,11 +32,6 @@ const {LocalizationHelper} = require("devtools/shared/l10n");
const INSPECTOR_L10N =
new LocalizationHelper("devtools/client/locales/inspector.properties");
-flags.testing = true;
-registerCleanupFunction(() => {
- flags.testing = false;
-});
-
registerCleanupFunction(() => {
Services.prefs.clearUserPref("devtools.inspector.activeSidebar");
});
diff --git a/devtools/client/memory/test/chrome/head.js b/devtools/client/memory/test/chrome/head.js
index 4fb618595274..24f038a0ce86 100644
--- a/devtools/client/memory/test/chrome/head.js
+++ b/devtools/client/memory/test/chrome/head.js
@@ -23,8 +23,6 @@ SimpleTest.registerCleanupFunction(function() {
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
var { immutableUpdate } = DevToolsUtils;
-var flags = require("devtools/shared/flags");
-flags.testing = true;
var constants = require("devtools/client/memory/constants");
var {
diff --git a/devtools/client/memory/test/unit/head.js b/devtools/client/memory/test/unit/head.js
index a1a39f5f429c..9484ec28e6e0 100644
--- a/devtools/client/memory/test/unit/head.js
+++ b/devtools/client/memory/test/unit/head.js
@@ -10,10 +10,13 @@ var { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {}
var Services = require("Services");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
-var flags = require("devtools/shared/flags");
-flags.testing = true;
-flags.wantLogging = true;
-flags.wantVerbose = false;
+
+Services.prefs.setBoolPref("devtools.testing", true);
+Services.prefs.setBoolPref("devtools.debugger.log", true);
+registerCleanupFunction(() => {
+ Services.prefs.clearUserPref("devtools.testing");
+ Services.prefs.clearUserPref("devtools.debugger.log");
+});
var { OS } = require("resource://gre/modules/osfile.jsm");
var { FileUtils } = require("resource://gre/modules/FileUtils.jsm");
diff --git a/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js b/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
index 50939d863a58..45749b789882 100644
--- a/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
+++ b/devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js
@@ -3,6 +3,15 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/* eslint-disable mozilla/reject-some-requires */
+// This file is a chrome-API-dependent version of the module
+// devtools/client/netmonitor/src/utils/open-request-in-tab.js, so that it can
+// take advantage of utilizing chrome APIs. But because of this, it isn't
+// intended to be used in Chrome-API-free applications, such as the Launchpad.
+//
+// Please keep in mind that if the feature in this file has changed, don't
+// forget to also change that accordingly in
+// devtools/client/netmonitor/src/utils/open-request-in-tab.js.
+
"use strict";
let { Cc, Ci } = require("chrome");
diff --git a/devtools/client/netmonitor/src/utils/open-request-in-tab.js b/devtools/client/netmonitor/src/utils/open-request-in-tab.js
index edda8bbc5aea..d7a842a8f446 100644
--- a/devtools/client/netmonitor/src/utils/open-request-in-tab.js
+++ b/devtools/client/netmonitor/src/utils/open-request-in-tab.js
@@ -2,6 +2,16 @@
* 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/. */
+// This file is a chrome-API-free version of the module
+// devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js, so that
+// it can be used in Chrome-API-free applications, such as the Launchpad. But
+// because of this, it cannot take advantage of utilizing chrome APIs and should
+// implement the similar functionalities on its own.
+//
+// Please keep in mind that if the feature in this file has changed, don't
+// forget to also change that accordingly in
+// devtools/client/netmonitor/src/utils/firefox/open-request-in-tab.js.
+
"use strict";
const Services = require("Services");
diff --git a/devtools/client/netmonitor/src/utils/request-utils.js b/devtools/client/netmonitor/src/utils/request-utils.js
index 8f843badb7b3..0a4df69e7df4 100644
--- a/devtools/client/netmonitor/src/utils/request-utils.js
+++ b/devtools/client/netmonitor/src/utils/request-utils.js
@@ -6,6 +6,9 @@
"use strict";
+const { getUnicodeUrl, getUnicodeUrlPath, getUnicodeHostname } =
+ require("devtools/client/shared/unicode-url");
+
const {
UPDATE_PROPS,
} = require("devtools/client/netmonitor/src/constants");
@@ -120,22 +123,6 @@ function writeHeaderText(headers) {
return headers.map(({name, value}) => name + ": " + value).join("\n");
}
-/**
- * Convert a string into unicode if string is valid.
- * If there is a malformed URI sequence, it returns input string.
- *
- * @param {string} url - a string
- * @return {string} unicode string
- */
-function decodeUnicodeUrl(string) {
- try {
- return decodeURIComponent(string);
- } catch (err) {
- // Ignore error and return input string directly.
- }
- return string;
-}
-
/**
* Decode base64 string.
*
@@ -175,7 +162,7 @@ function getAbbreviatedMimeType(mimeType) {
*/
function getUrlBaseName(url) {
const pathname = (new URL(url)).pathname;
- return decodeUnicodeUrl(
+ return getUnicodeUrlPath(
pathname.replace(/\S*\//, "") || pathname || "/");
}
@@ -196,27 +183,27 @@ function getUrlQuery(url) {
* @return {string} unicode basename and query portions of a url
*/
function getUrlBaseNameWithQuery(url) {
- return getUrlBaseName(url) + decodeUnicodeUrl((new URL(url)).search);
+ return getUrlBaseName(url) + getUnicodeUrlPath((new URL(url)).search);
}
/**
- * Helpers for getting unicode hostname portion of an URL.
+ * Helpers for getting hostname portion of an URL.
*
* @param {string} url - url string
* @return {string} unicode hostname of a url
*/
function getUrlHostName(url) {
- return decodeUnicodeUrl((new URL(url)).hostname);
+ return new URL(url).hostname;
}
/**
- * Helpers for getting unicode host portion of an URL.
+ * Helpers for getting host portion of an URL.
*
* @param {string} url - url string
* @return {string} unicode host of a url
*/
function getUrlHost(url) {
- return decodeUnicodeUrl((new URL(url)).host);
+ return new URL(url).host;
}
/**
@@ -237,9 +224,22 @@ function getUrlDetails(url) {
let baseNameWithQuery = getUrlBaseNameWithQuery(url);
let host = getUrlHost(url);
let hostname = getUrlHostName(url);
- let unicodeUrl = decodeUnicodeUrl(url);
+ let unicodeUrl = getUnicodeUrl(url);
let scheme = getUrlScheme(url);
+ // If the hostname contains unreadable ASCII characters, we need to do the
+ // following two steps:
+ // 1. Converting the unreadable hostname to a readable Unicode domain name.
+ // For example, converting xn--g6w.xn--8pv into a Unicode domain name.
+ // 2. Replacing the unreadable hostname portion in the `host` with the
+ // readable hostname.
+ // For example, replacing xn--g6w.xn--8pv:8000 with [Unicode domain]:8000
+ // After finishing the two steps, we get a readable `host`.
+ const unicodeHostname = getUnicodeHostname(hostname);
+ if (unicodeHostname !== hostname) {
+ host = host.replace(hostname, unicodeHostname);
+ }
+
// Mark local hosts specially, where "local" is as defined in the W3C
// spec for secure contexts.
// http://www.w3.org/TR/powerful-features/
@@ -277,8 +277,8 @@ function parseQueryString(query) {
return query.replace(/^[?&]/, "").split("&").map(e => {
let param = e.split("=");
return {
- name: param[0] ? decodeUnicodeUrl(param[0]) : "",
- value: param[1] ? decodeUnicodeUrl(param[1]) : "",
+ name: param[0] ? getUnicodeUrlPath(param[0]) : "",
+ value: param[1] ? getUnicodeUrlPath(param[1]) : "",
};
});
}
@@ -297,8 +297,8 @@ function parseFormData(sections) {
return sections.replace(/^&/, "").split("&").map(e => {
let param = e.split("=");
return {
- name: param[0] ? decodeUnicodeUrl(param[0]) : "",
- value: param[1] ? decodeUnicodeUrl(param[1]) : "",
+ name: param[0] ? getUnicodeUrlPath(param[0]) : "",
+ value: param[1] ? getUnicodeUrlPath(param[1]) : "",
};
});
}
@@ -491,7 +491,6 @@ module.exports = {
fetchNetworkUpdatePacket,
formDataURI,
writeHeaderText,
- decodeUnicodeUrl,
getAbbreviatedMimeType,
getEndTime,
getFormattedProtocol,
diff --git a/devtools/client/netmonitor/test/head.js b/devtools/client/netmonitor/test/head.js
index a8c80f8f678d..f1217a91f54c 100644
--- a/devtools/client/netmonitor/test/head.js
+++ b/devtools/client/netmonitor/test/head.js
@@ -18,8 +18,8 @@ const {
getFormattedIPAndPort,
getFormattedTime,
} = require("devtools/client/netmonitor/src/utils/format-utils");
+const { getUnicodeUrl } = require("devtools/client/shared/unicode-url");
const {
- decodeUnicodeUrl,
getFormattedProtocol,
getUrlBaseName,
getUrlHost,
@@ -410,7 +410,7 @@ function verifyRequestItemTarget(document, requestList, requestItem, method,
let target = document.querySelectorAll(".request-list-item")[visibleIndex];
// Bug 1414981 - Request URL should not show #hash
- let unicodeUrl = decodeUnicodeUrl(url).split("#")[0];
+ let unicodeUrl = getUnicodeUrl(url.split("#")[0]);
let name = getUrlBaseName(url);
let query = getUrlQuery(url);
let host = getUrlHost(url);
diff --git a/devtools/client/netmonitor/webpack.config.js b/devtools/client/netmonitor/webpack.config.js
index 49f3922db90b..a92a6c697cf5 100644
--- a/devtools/client/netmonitor/webpack.config.js
+++ b/devtools/client/netmonitor/webpack.config.js
@@ -88,6 +88,7 @@ let webpackConfig = {
"devtools/shared/fronts/timeline": path.join(__dirname, "../../client/shared/webpack/shims/fronts-timeline-shim"),
"devtools/shared/platform/clipboard": path.join(__dirname, "../../client/shared/webpack/shims/platform-clipboard-stub"),
"devtools/client/netmonitor/src/utils/firefox/open-request-in-tab": path.join(__dirname, "src/utils/open-request-in-tab"),
+ "devtools/client/shared/unicode-url": path.join(__dirname, "../../client/shared/webpack/shims/unicode-url-stub"),
// Locales need to be explicitly mapped to the en-US subfolder
"devtools/client/locales": path.join(__dirname, "../../client/locales/en-US"),
diff --git a/devtools/client/performance-new/test/chrome/head.js b/devtools/client/performance-new/test/chrome/head.js
index c0794541aad8..859f2be2db1b 100644
--- a/devtools/client/performance-new/test/chrome/head.js
+++ b/devtools/client/performance-new/test/chrome/head.js
@@ -15,9 +15,7 @@ var { require } = BrowserLoader({
const EventEmitter = require("devtools/shared/event-emitter");
const { perfDescription } = require("devtools/shared/specs/perf");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const flags = require("devtools/shared/flags");
-flags.testing = true;
let EXPECTED_DTU_ASSERT_FAILURE_COUNT = 0;
SimpleTest.registerCleanupFunction(function() {
if (DevToolsUtils.assertionFailureCount !== EXPECTED_DTU_ASSERT_FAILURE_COUNT) {
diff --git a/devtools/client/performance/components/test/head.js b/devtools/client/performance/components/test/head.js
index 7957e3710129..cc5307181d4d 100644
--- a/devtools/client/performance/components/test/head.js
+++ b/devtools/client/performance/components/test/head.js
@@ -14,7 +14,6 @@ let flags = require("devtools/shared/flags");
let { TargetFactory } = require("devtools/client/framework/target");
let { Toolbox } = require("devtools/client/framework/toolbox");
-flags.testing = true;
let { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/performance/",
window
diff --git a/devtools/client/performance/test/head.js b/devtools/client/performance/test/head.js
index 40daa03a21da..d5958926fb7a 100644
--- a/devtools/client/performance/test/head.js
+++ b/devtools/client/performance/test/head.js
@@ -52,11 +52,8 @@ const key = (id, win = window) => {
// Don't pollute global scope.
(() => {
- const flags = require("devtools/shared/flags");
const PrefUtils = require("devtools/client/performance/test/helpers/prefs");
- flags.testing = true;
-
// Make sure all the prefs are reverted to their defaults once tests finish.
let stopObservingPrefs = PrefUtils.whenUnknownPrefChanged("devtools.performance",
pref => {
@@ -71,7 +68,6 @@ const key = (id, win = window) => {
registerCleanupFunction(() => {
info("finish() was called, cleaning up...");
- flags.testing = false;
PrefUtils.rollbackPrefsToDefault();
stopObservingPrefs();
diff --git a/devtools/client/responsive.html/test/browser/head.js b/devtools/client/responsive.html/test/browser/head.js
index 085dfe6a3b81..a53d3e80adf5 100644
--- a/devtools/client/responsive.html/test/browser/head.js
+++ b/devtools/client/responsive.html/test/browser/head.js
@@ -48,14 +48,12 @@ SimpleTest.waitForExplicitFinish();
// should be enough.
requestLongerTimeout(2);
-flags.testing = true;
Services.prefs.setCharPref("devtools.devices.url", TEST_URI_ROOT + "devices.json");
// The appearance of this notification causes intermittent behavior in some tests that
// send mouse events, since it causes the content to shift when it appears.
Services.prefs.setBoolPref("devtools.responsive.reloadNotification.enabled", false);
registerCleanupFunction(async () => {
- flags.testing = false;
Services.prefs.clearUserPref("devtools.devices.url");
Services.prefs.clearUserPref("devtools.responsive.reloadNotification.enabled");
Services.prefs.clearUserPref("devtools.responsive.html.displayedDeviceList");
diff --git a/devtools/client/responsive.html/test/unit/head.js b/devtools/client/responsive.html/test/unit/head.js
index 6d79b84022ed..96c08ee0e4d8 100644
--- a/devtools/client/responsive.html/test/unit/head.js
+++ b/devtools/client/responsive.html/test/unit/head.js
@@ -8,12 +8,12 @@
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
const promise = require("promise");
+const Services = require("Services");
const Store = require("devtools/client/responsive.html/store");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const flags = require("devtools/shared/flags");
-flags.testing = true;
+Services.prefs.setBoolPref("devtools.testing", true);
registerCleanupFunction(() => {
- flags.testing = false;
+ Services.prefs.clearUserPref("devtools.testing");
});
diff --git a/devtools/client/scratchpad/test/head.js b/devtools/client/scratchpad/test/head.js
index a2e0278dfed1..186e10f0dd73 100644
--- a/devtools/client/scratchpad/test/head.js
+++ b/devtools/client/scratchpad/test/head.js
@@ -11,17 +11,11 @@ const {require} = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {}
const {gDevTools} = require("devtools/client/framework/devtools");
const Services = require("Services");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const flags = require("devtools/shared/flags");
const promise = require("promise");
const defer = require("devtools/shared/defer");
var gScratchpadWindow; // Reference to the Scratchpad chrome window object
-flags.testing = true;
-registerCleanupFunction(() => {
- flags.testing = false;
-});
-
/**
* Open a Scratchpad window.
*
diff --git a/devtools/client/shared/components/Frame.js b/devtools/client/shared/components/Frame.js
index e478e79b306a..acb5bfd7294f 100644
--- a/devtools/client/shared/components/Frame.js
+++ b/devtools/client/shared/components/Frame.js
@@ -7,6 +7,8 @@
const { Component } = require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
+const { getUnicodeUrl, getUnicodeUrlPath, getUnicodeHostname } =
+ require("devtools/client/shared/unicode-url");
const { getSourceNames, parseURL, isScratchpadScheme, getSourceMappedFile } =
require("devtools/client/shared/source-utils");
const { LocalizationHelper } = require("devtools/shared/l10n");
@@ -133,6 +135,10 @@ class Frame extends Component {
let column = frame.column != void 0 ? Number(frame.column) : null;
const { short, long, host } = getSourceNames(source);
+ const unicodeShort = getUnicodeUrlPath(short);
+ const unicodeLong = getUnicodeUrl(long);
+ const unicodeHost = host ? getUnicodeHostname(host) : "";
+
// Reparse the URL to determine if we should link this; `getSourceNames`
// has already cached this indirectly. We don't want to attempt to
// link to "self-hosted" and "(unknown)". However, we do want to link
@@ -144,7 +150,7 @@ class Frame extends Component {
const elements = [];
const sourceElements = [];
let sourceEl;
- let tooltip = long;
+ let tooltip = unicodeLong;
// Exclude all falsy values, including `0`, as line numbers start with 1.
if (line) {
@@ -177,7 +183,7 @@ class Frame extends Component {
}
}
- let displaySource = showFullSourceUrl ? long : short;
+ let displaySource = showFullSourceUrl ? unicodeLong : unicodeShort;
if (isSourceMapped) {
displaySource = getSourceMappedFile(displaySource);
} else if (showEmptyPathAsHost && (displaySource === "" || displaySource === "/")) {
@@ -238,12 +244,12 @@ class Frame extends Component {
}
elements.push(sourceEl);
- if (showHost && host) {
+ if (showHost && unicodeHost) {
elements.push(" ");
elements.push(dom.span({
key: "host",
className: "frame-link-host",
- }, host));
+ }, unicodeHost));
}
return dom.span(attributes, ...elements);
diff --git a/devtools/client/shared/components/test/mochitest/head.js b/devtools/client/shared/components/test/mochitest/head.js
index 9ec43e103d6b..b2a024216b1b 100644
--- a/devtools/client/shared/components/test/mochitest/head.js
+++ b/devtools/client/shared/components/test/mochitest/head.js
@@ -15,11 +15,9 @@ var Services = require("Services");
var { DebuggerServer } = require("devtools/server/main");
var { DebuggerClient } = require("devtools/shared/client/debugger-client");
var DevToolsUtils = require("devtools/shared/DevToolsUtils");
-var flags = require("devtools/shared/flags");
var { TargetFactory } = require("devtools/client/framework/target");
var { Toolbox } = require("devtools/client/framework/toolbox");
-flags.testing = true;
var { require: browserRequire } = BrowserLoader({
baseURI: "resource://devtools/client/shared/",
window
diff --git a/devtools/client/shared/moz.build b/devtools/client/shared/moz.build
index 026ea8308633..677ff18eae9e 100644
--- a/devtools/client/shared/moz.build
+++ b/devtools/client/shared/moz.build
@@ -53,6 +53,7 @@ DevToolsModules(
'telemetry.js',
'theme.js',
'undo.js',
+ 'unicode-url.js',
'view-source.js',
'webgl-utils.js',
'zoom-keys.js',
diff --git a/devtools/client/shared/redux/middleware/test/head.js b/devtools/client/shared/redux/middleware/test/head.js
index 836a70071058..8d2b5b3dfee8 100644
--- a/devtools/client/shared/redux/middleware/test/head.js
+++ b/devtools/client/shared/redux/middleware/test/head.js
@@ -7,9 +7,6 @@
"use strict";
const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
-const flags = require("devtools/shared/flags");
-
-flags.testing = true;
function waitUntilState(store, predicate) {
return new Promise(resolve => {
diff --git a/devtools/client/shared/test/browser_telemetry_button_responsive.js b/devtools/client/shared/test/browser_telemetry_button_responsive.js
index 003cfed66f8b..fdc027a34337 100644
--- a/devtools/client/shared/test/browser_telemetry_button_responsive.js
+++ b/devtools/client/shared/test/browser_telemetry_button_responsive.js
@@ -17,13 +17,13 @@ const asyncStorage = require("devtools/shared/async-storage");
// should be enough.
requestLongerTimeout(2);
-flags.testing = true;
+Services.prefs.setBoolPref("devtools.testing", true);
Services.prefs.clearUserPref("devtools.responsive.html.displayedDeviceList");
Services.prefs.setCharPref("devtools.devices.url",
"http://example.com/browser/devtools/client/responsive.html/test/browser/devices.json");
registerCleanupFunction(() => {
- flags.testing = false;
+ Services.prefs.clearUserPref("devtools.testing");
Services.prefs.clearUserPref("devtools.devices.url");
Services.prefs.clearUserPref("devtools.responsive.html.displayedDeviceList");
asyncStorage.removeItem("devtools.devices.url_cache");
diff --git a/devtools/client/shared/test/shared-head.js b/devtools/client/shared/test/shared-head.js
index 1b9a151746ec..9340c1990bd1 100644
--- a/devtools/client/shared/test/shared-head.js
+++ b/devtools/client/shared/test/shared-head.js
@@ -25,7 +25,6 @@ const {loader, require} = scopedCuImport("resource://devtools/shared/Loader.jsm"
const {gDevTools} = require("devtools/client/framework/devtools");
const {TargetFactory} = require("devtools/client/framework/target");
const DevToolsUtils = require("devtools/shared/DevToolsUtils");
-const flags = require("devtools/shared/flags");
let promise = require("promise");
let defer = require("devtools/shared/defer");
const Services = require("Services");
@@ -109,9 +108,7 @@ function loadFrameScriptUtils(browser = gBrowser.selectedBrowser) {
return mm;
}
-flags.testing = true;
registerCleanupFunction(() => {
- flags.testing = false;
Services.prefs.clearUserPref("devtools.dump.emit");
Services.prefs.clearUserPref("devtools.toolbox.host");
Services.prefs.clearUserPref("devtools.toolbox.previousHost");
diff --git a/devtools/client/shared/test/unit/test_unicode-url.js b/devtools/client/shared/test/unit/test_unicode-url.js
new file mode 100644
index 000000000000..ceacccbba163
--- /dev/null
+++ b/devtools/client/shared/test/unit/test_unicode-url.js
@@ -0,0 +1,240 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+"use strict";
+
+/**
+ * Tests utility functions contained in `unicode-url.js`
+ */
+
+const { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
+const { getUnicodeUrl, getUnicodeUrlPath, getUnicodeHostname } =
+ require("devtools/client/shared/unicode-url");
+
+// List of URLs used to test Unicode URL conversion
+const TEST_URLS = [
+ // Type: Readable ASCII URLs
+ // Expected: All of Unicode versions should equal to the raw.
+ {
+ raw: "https://example.org",
+ expectedUnicode: "https://example.org",
+ },
+ {
+ raw: "http://example.org",
+ expectedUnicode: "http://example.org",
+ },
+ {
+ raw: "ftp://example.org",
+ expectedUnicode: "ftp://example.org",
+ },
+ {
+ raw: "https://example.org.",
+ expectedUnicode: "https://example.org.",
+ },
+ {
+ raw: "https://example.org/",
+ expectedUnicode: "https://example.org/",
+ },
+ {
+ raw: "https://example.org/test",
+ expectedUnicode: "https://example.org/test",
+ },
+ {
+ raw: "https://example.org/test.html",
+ expectedUnicode: "https://example.org/test.html",
+ },
+ {
+ raw: "https://example.org/test.html?one=1&two=2",
+ expectedUnicode: "https://example.org/test.html?one=1&two=2",
+ },
+ {
+ raw: "https://example.org/test.html#here",
+ expectedUnicode: "https://example.org/test.html#here",
+ },
+ {
+ raw: "https://example.org/test.html?one=1&two=2#here",
+ expectedUnicode: "https://example.org/test.html?one=1&two=2#here",
+ },
+ // Type: Unreadable URLs with either Punycode domain names or URI-encoded
+ // paths
+ // Expected: Unreadable domain names and URI-encoded paths should be converted
+ // to readable Unicode.
+ {
+ raw: "https://xn--g6w.xn--8pv/test.html",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "https://\u6e2c.\u672c/test.html",
+ },
+ {
+ raw: "https://example.org/%E6%B8%AC%E8%A9%A6.html",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "https://example.org/\u6e2c\u8a66.html",
+ },
+ {
+ raw: "https://example.org/test.html?One=%E4%B8%80",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "https://example.org/test.html?One=\u4e00",
+ },
+ {
+ raw: "https://example.org/test.html?%E4%B8%80=1",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "https://example.org/test.html?\u4e00=1",
+ },
+ {
+ raw: "https://xn--g6w.xn--8pv/%E6%B8%AC%E8%A9%A6.html" +
+ "?%E4%B8%80=%E4%B8%80" +
+ "#%E6%AD%A4",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "https://\u6e2c.\u672c/\u6e2c\u8a66.html" +
+ "?\u4e00=\u4e00" +
+ "#\u6b64",
+ },
+ // Type: data: URIs
+ // Expected: All should not be converted.
+ {
+ raw: "data:text/plain;charset=UTF-8;Hello%20world",
+ expectedUnicode: "data:text/plain;charset=UTF-8;Hello%20world",
+ },
+ {
+ raw: "data:text/plain;charset=UTF-8;%E6%B8%AC%20%E8%A9%A6",
+ expectedUnicode: "data:text/plain;charset=UTF-8;%E6%B8%AC%20%E8%A9%A6",
+ },
+ {
+ raw: "data:image/png;base64,iVBORw0KGgoAAA" +
+ "ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4" +
+ "//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU" +
+ "5ErkJggg==",
+ expectedUnicode: "data:image/png;base64,iVBORw0KGgoAAA" +
+ "ANSUhEUgAAAAUAAAAFCAYAAACNbyblAAAAHElEQVQI12P4" +
+ "//8/w38GIAXDIBKE0DHxgljNBAAO9TXL0Y4OHwAAAABJRU" +
+ "5ErkJggg==",
+ },
+ // Type: Malformed URLs
+ // Expected: All should not be converted.
+ {
+ raw: "://example.org/test",
+ expectedUnicode: "://example.org/test",
+ },
+ {
+ raw: "://xn--g6w.xn--8pv/%E6%B8%AC%E8%A9%A6.html" +
+ "?%E4%B8%80=%E4%B8%80",
+ expectedUnicode: "://xn--g6w.xn--8pv/%E6%B8%AC%E8%A9%A6.html" +
+ "?%E4%B8%80=%E4%B8%80",
+ },
+ {
+ // %E8%A9 isn't a valid UTF-8 code, so this URL is malformed.
+ raw: "https://xn--g6w.xn--8pv/%E6%B8%AC%E8%A9",
+ expectedUnicode: "https://xn--g6w.xn--8pv/%E6%B8%AC%E8%A9",
+ },
+];
+
+// List of hostanmes used to test Unicode hostname conversion
+const TEST_HOSTNAMES = [
+ // Type: Readable ASCII hostnames
+ // Expected: All of Unicode versions should equal to the raw.
+ {
+ raw: "example",
+ expectedUnicode: "example",
+ },
+ {
+ raw: "example.org",
+ expectedUnicode: "example.org",
+ },
+ // Type: Unreadable Punycode hostnames
+ // Expected: Punycode should be converted to readable Unicode.
+ {
+ raw: "xn--g6w",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "\u6e2c",
+ },
+ {
+ raw: "xn--g6w.xn--8pv",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "\u6e2c.\u672c",
+ },
+];
+
+// List of URL paths used to test Unicode URL path conversion
+const TEST_URL_PATHS = [
+ // Type: Readable ASCII URL paths
+ // Expected: All of Unicode versions should equal to the raw.
+ {
+ raw: "test",
+ expectedUnicode: "test",
+ },
+ {
+ raw: "/",
+ expectedUnicode: "/",
+ },
+ {
+ raw: "/test",
+ expectedUnicode: "/test",
+ },
+ {
+ raw: "/test.html?one=1&two=2#here",
+ expectedUnicode: "/test.html?one=1&two=2#here",
+ },
+ // Type: Unreadable URI-encoded URL paths
+ // Expected: URL paths should be converted to readable Unicode.
+ {
+ raw: "/%E6%B8%AC%E8%A9%A6",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "/\u6e2c\u8a66",
+ },
+ {
+ raw: "/%E6%B8%AC%E8%A9%A6.html",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "/\u6e2c\u8a66.html",
+ },
+ {
+ raw: "/%E6%B8%AC%E8%A9%A6.html" +
+ "?%E4%B8%80=%E4%B8%80&%E4%BA%8C=%E4%BA%8C" +
+ "#%E6%AD%A4",
+ // Do not type Unicode characters directly, because this test file isn't
+ // specified with a known encoding.
+ expectedUnicode: "/\u6e2c\u8a66.html" +
+ "?\u4e00=\u4e00&\u4e8c=\u4e8c" +
+ "#\u6b64",
+ },
+ // Type: Malformed URL paths
+ // Expected: All should not be converted.
+ {
+ // %E8%A9 isn't a valid UTF-8 code, so this URL is malformed.
+ raw: "/%E6%B8%AC%E8%A9",
+ expectedUnicode: "/%E6%B8%AC%E8%A9",
+ },
+];
+
+function run_test() {
+ // Test URLs
+ for (let url of TEST_URLS) {
+ let result = getUnicodeUrl(url.raw);
+ equal(result, url.expectedUnicode,
+ "Test getUnicodeUrl: " + url.raw +
+ " should be unicodized to " + url.expectedUnicode);
+ }
+
+ // Test hostnames
+ for (let hostname of TEST_HOSTNAMES) {
+ let result = getUnicodeHostname(hostname.raw);
+ equal(result, hostname.expectedUnicode,
+ "Test getUnicodeHostname: " + hostname.raw +
+ " should be unicodized to " + hostname.expectedUnicode);
+ }
+
+ // Test URL paths
+ for (let urlPath of TEST_URL_PATHS) {
+ let result = getUnicodeUrlPath(urlPath.raw);
+ equal(result, urlPath.expectedUnicode,
+ "Test getUnicodeUrlPath: " + urlPath.raw +
+ " should be unicodized to " + urlPath.expectedUnicode);
+ }
+}
diff --git a/devtools/client/shared/test/unit/xpcshell.ini b/devtools/client/shared/test/unit/xpcshell.ini
index 99d6d1bb6da3..dc0a61ab26db 100644
--- a/devtools/client/shared/test/unit/xpcshell.ini
+++ b/devtools/client/shared/test/unit/xpcshell.ini
@@ -25,5 +25,6 @@ support-files =
[test_source-utils.js]
[test_suggestion-picker.js]
[test_undoStack.js]
+[test_unicode-url.js]
[test_VariablesView_filtering-without-controller.js]
[test_VariablesView_getString_promise.js]
diff --git a/devtools/client/shared/unicode-url.js b/devtools/client/shared/unicode-url.js
new file mode 100644
index 000000000000..e6da095555cf
--- /dev/null
+++ b/devtools/client/shared/unicode-url.js
@@ -0,0 +1,115 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+"use strict";
+
+// This file is a chrome-API-dependent version of the module
+// devtools/client/shared/webpack/shims/unicode-url-stub.js, so that it can
+// take advantage of utilizing chrome APIs. But because of this, it isn't
+// intended to be used in Chrome-API-free applications, such as the Launchpad.
+//
+// Please keep in mind that if the feature in this file has changed, don't
+// forget to also change that accordingly in
+// devtools/client/shared/webpack/shims/unicode-url-stub.js.
+
+const { Cc, Ci } = require("chrome");
+const idnService =
+ Cc["@mozilla.org/network/idn-service;1"].getService(Ci.nsIIDNService);
+
+/**
+ * Gets a readble Unicode hostname from a hostname.
+ *
+ * If the `hostname` is a readable ASCII hostname, such as example.org, then
+ * this function will simply return the original `hostname`.
+ *
+ * If the `hostname` is a Punycode hostname representing a Unicode domain name,
+ * such as xn--g6w.xn--8pv, then this function will return the readable Unicode
+ * domain name by decoding the Punycode hostname.
+ *
+ * @param {string} hostname
+ * the hostname from which the Unicode hostname will be
+ * parsed, such as example.org, xn--g6w.xn--8pv.
+ * @return {string} The Unicode hostname. It may be the same as the `hostname`
+ * passed to this function if the `hostname` itself is
+ * a readable ASCII hostname or a Unicode hostname.
+ */
+function getUnicodeHostname(hostname) {
+ return idnService.convertToDisplayIDN(hostname, {});
+}
+
+/**
+ * Gets a readble Unicode URL pathname from a URL pathname.
+ *
+ * If the `urlPath` is a readable ASCII URL pathname, such as /a/b/c.js, then
+ * this function will simply return the original `urlPath`.
+ *
+ * If the `urlPath` is a URI-encoded pathname, such as %E8%A9%A6/%E6%B8%AC.js,
+ * then this function will return the readable Unicode pathname.
+ *
+ * If the `urlPath` is a malformed URL pathname, then this function will simply
+ * return the original `urlPath`.
+ *
+ * @param {string} urlPath
+ * the URL path from which the Unicode URL path will be parsed,
+ * such as /a/b/c.js, %E8%A9%A6/%E6%B8%AC.js.
+ * @return {string} The Unicode URL Path. It may be the same as the `urlPath`
+ * passed to this function if the `urlPath` itself is a readable
+ * ASCII url or a Unicode url.
+ */
+function getUnicodeUrlPath(urlPath) {
+ try {
+ return decodeURIComponent(urlPath);
+ } catch (err) {
+ dump("Warning: getUnicodeUrlPath failed to get a Unicode URL from" +
+ `${urlPath}, reason: ${err}`);
+ }
+ return urlPath;
+}
+
+/**
+ * Gets a readable Unicode URL from a URL.
+ *
+ * If the `url` is a readable ASCII URL, such as http://example.org/a/b/c.js,
+ * then this function will simply return the original `url`.
+ *
+ * If the `url` includes either an unreadable Punycode domain name or an
+ * unreadable URI-encoded pathname, such as
+ * http://xn--g6w.xn--8pv/%E8%A9%A6/%E6%B8%AC.js, then this function will return
+ * the readable URL by decoding all its unreadable URL components to Unicode
+ * characters.
+ *
+ * If the `url` is a malformed URL, then this function will return the original
+ * `url`.
+ *
+ * If the `url` is a data: URI, then this function will return the original
+ * `url`.
+ *
+ * @param {string} url
+ * the full URL, or a data: URI. from which the readable URL
+ * will be parsed, such as, http://example.org/a/b/c.js,
+ * http://xn--g6w.xn--8pv/%E8%A9%A6/%E6%B8%AC.js
+ * @return {string} The readable URL. It may be the same as the `url` passed to
+ * this function if the `url` itself is readable.
+ */
+function getUnicodeUrl(url) {
+ try {
+ const { protocol, hostname } = new URL(url);
+ if (protocol === "data:") {
+ // Never convert a data: URI.
+ return url;
+ }
+ const readableHostname = getUnicodeHostname(hostname);
+ url = decodeURIComponent(url);
+ return url.replace(hostname, readableHostname);
+ } catch (err) {
+ dump("Warning: getUnicodeUrl failed to get a Unicode URL from" +
+ `${url}, reason: ${err}`);
+ }
+ return url;
+}
+
+module.exports = {
+ getUnicodeHostname,
+ getUnicodeUrlPath,
+ getUnicodeUrl,
+};
diff --git a/devtools/client/shared/webpack/shims/unicode-url-stub.js b/devtools/client/shared/webpack/shims/unicode-url-stub.js
new file mode 100644
index 000000000000..0ae4cde77542
--- /dev/null
+++ b/devtools/client/shared/webpack/shims/unicode-url-stub.js
@@ -0,0 +1,32 @@
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * 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/. */
+
+// TODO This file aims to implement a Chrome-API-free replacement for
+// devtools/client/shared/unicode-url.js, so that it can be used in the
+// Launchpad.
+//
+// Currently this is just a dummpy mock of
+// devtools/client/shared/unicode-url.js, no actual functionaly involved.
+// Eventually we'll want to implement it. Once implemented, we should keep the
+// feature the same as devtools/client/shared/unicode-url.js.
+
+"use strict";
+
+function getUnicodeHostname(hostname) {
+ return hostname;
+}
+
+function getUnicodeUrlPath(urlPath) {
+ return urlPath;
+}
+
+function getUnicodeUrl(url) {
+ return url;
+}
+
+module.exports = {
+ getUnicodeHostname,
+ getUnicodeUrlPath,
+ getUnicodeUrl,
+};
diff --git a/devtools/client/sourceeditor/test/head.js b/devtools/client/sourceeditor/test/head.js
index 0e60e6d3f3e1..207253924cf6 100644
--- a/devtools/client/sourceeditor/test/head.js
+++ b/devtools/client/sourceeditor/test/head.js
@@ -16,11 +16,6 @@ const { NetUtil } = require("resource://gre/modules/NetUtil.jsm");
const Editor = require("devtools/client/sourceeditor/editor");
const {getClientCssProperties} = require("devtools/shared/fronts/css-properties");
-flags.testing = true;
-SimpleTest.registerCleanupFunction(() => {
- flags.testing = false;
-});
-
function promiseWaitForFocus() {
return new Promise(resolve =>
waitForFocus(resolve));
diff --git a/devtools/client/storage/ui.js b/devtools/client/storage/ui.js
index 1ad4faae4b31..3e5e706138cc 100644
--- a/devtools/client/storage/ui.js
+++ b/devtools/client/storage/ui.js
@@ -10,6 +10,7 @@ const {LocalizationHelper, ELLIPSIS} = require("devtools/shared/l10n");
const KeyShortcuts = require("devtools/client/shared/key-shortcuts");
const JSOL = require("devtools/client/shared/vendor/jsol");
const {KeyCodes} = require("devtools/client/shared/keycodes");
+const { getUnicodeHostname } = require("devtools/client/shared/unicode-url");
// GUID to be used as a separator in compound keys. This must match the same
// constant in devtools/server/actors/storage.js,
@@ -455,7 +456,8 @@ class StorageUI {
async handleAddedItems(added) {
for (let type in added) {
for (let host in added[type]) {
- this.tree.add([type, {id: host, type: "url"}]);
+ const label = this.getReadableLabelFromHostname(host);
+ this.tree.add([type, {id: host, label: label, type: "url"}]);
for (let name of added[type][host]) {
try {
name = JSON.parse(name);
@@ -672,7 +674,8 @@ class StorageUI {
}
this.storageTypes[type] = storageTypes[type];
for (let host in storageTypes[type].hosts) {
- this.tree.add([type, {id: host, type: "url"}]);
+ const label = this.getReadableLabelFromHostname(host);
+ this.tree.add([type, {id: host, label: label, type: "url"}]);
for (let name of storageTypes[type].hosts[host]) {
try {
let names = JSON.parse(name);
@@ -772,6 +775,35 @@ class StorageUI {
this.emit("sidebar-updated");
}
+ /**
+ * Gets a readable label from the hostname. If the hostname is a Punycode
+ * domain(I.e. an ASCII domain name representing a Unicode domain name), then
+ * this function decodes it to the readable Unicode domain name, and label
+ * the Unicode domain name toggether with the original domian name, and then
+ * return the label; if the hostname isn't a Punycode domain(I.e. it isn't
+ * encoded and is readable on its own), then this function simply returns the
+ * original hostname.
+ *
+ * @param {string} host
+ * The string representing a host, e.g, example.com, example.com:8000
+ */
+ getReadableLabelFromHostname(host) {
+ try {
+ const { hostname } = new URL(host);
+ const unicodeHostname = getUnicodeHostname(hostname);
+ if (hostname !== unicodeHostname) {
+ // If the hostname is a Punycode domain representing a Unicode domain,
+ // we decode it to the Unicode domain name, and then label the Unicode
+ // domain name together with the original domain name.
+ return host.replace(hostname, unicodeHostname) + " [ " + host + " ]";
+ }
+ } catch (_) {
+ // Skip decoding for a host which doesn't include a domain name, simply
+ // consider them to be readable.
+ }
+ return host;
+ }
+
/**
* Tries to parse a string value into either a json or a key-value separated
* object and populates the sidebar with the parsed value. The value can also
@@ -779,7 +811,7 @@ class StorageUI {
*
* @param {string} name
* The key corresponding to the `value` string in the object
- * @param {string} value
+ * @param {string} originalValue
* The string to be parsed into an object
*/
parseItemValue(name, originalValue) {
@@ -881,8 +913,6 @@ class StorageUI {
* Select handler for the storage tree. Fetches details of the selected item
* from the storage details and populates the storage tree.
*
- * @param {string} event
- * The name of the event fired
* @param {array} item
* An array of ids which represent the location of the selected item in
* the storage tree
diff --git a/devtools/client/webaudioeditor/controller.js b/devtools/client/webaudioeditor/controller.js
index aed8635721cc..3f52f31e54fe 100644
--- a/devtools/client/webaudioeditor/controller.js
+++ b/devtools/client/webaudioeditor/controller.js
@@ -83,7 +83,7 @@ var WebAudioEditorController = {
/**
* Remove events emitted by the current tab target.
*/
- destroy: function () {
+ destroy: function() {
gTarget.off("will-navigate", this._onTabWillNavigate);
gFront.off("start-context", this._onStartContext);
gFront.off("create-node", this._onCreateNode);
@@ -100,7 +100,7 @@ var WebAudioEditorController = {
* Called when page is reloaded to show the reload notice and waiting
* for an audio context notice.
*/
- reset: function () {
+ reset: function() {
$("#content").hidden = true;
ContextView.resetUI();
InspectorView.resetUI();
@@ -110,7 +110,7 @@ var WebAudioEditorController = {
// Since node events (create, disconnect, connect) are all async,
// we have to make sure to wait that the node has finished creating
// before performing an operation on it.
- getNode: async function (nodeActor) {
+ getNode: async function(nodeActor) {
let id = nodeActor.actorID;
let node = gAudioNodes.get(id);
@@ -132,7 +132,7 @@ var WebAudioEditorController = {
* so that the graph can update marker styling, as that
* cannot currently be done with CSS.
*/
- _onThemeChange: function () {
+ _onThemeChange: function() {
let newValue = Services.prefs.getCharPref("devtools.theme");
window.emit(EVENTS.THEME_CHANGE, newValue);
},
@@ -167,7 +167,7 @@ var WebAudioEditorController = {
* Called after the first audio node is created in an audio context,
* signaling that the audio context is being used.
*/
- _onStartContext: function () {
+ _onStartContext: function() {
$("#reload-notice").hidden = true;
$("#waiting-notice").hidden = true;
$("#content").hidden = false;
@@ -178,7 +178,7 @@ var WebAudioEditorController = {
* Called when a new node is created. Creates an `AudioNodeView` instance
* for tracking throughout the editor.
*/
- _onCreateNode: function (nodeActor) {
+ _onCreateNode: function(nodeActor) {
gAudioNodes.add(nodeActor);
},
@@ -186,7 +186,7 @@ var WebAudioEditorController = {
* Called on `destroy-node` when an AudioNode is GC'd. Removes
* from the AudioNode array and fires an event indicating the removal.
*/
- _onDestroyNode: function (nodeActor) {
+ _onDestroyNode: function(nodeActor) {
gAudioNodes.remove(gAudioNodes.get(nodeActor.actorID));
},
diff --git a/devtools/client/webaudioeditor/includes.js b/devtools/client/webaudioeditor/includes.js
index bbbbf7e936f5..9e4586ae0c2e 100644
--- a/devtools/client/webaudioeditor/includes.js
+++ b/devtools/client/webaudioeditor/includes.js
@@ -84,8 +84,12 @@ EventEmitter.decorate(this);
/**
* DOM query helper.
*/
-function $(selector, target = document) { return target.querySelector(selector); }
-function $$(selector, target = document) { return target.querySelectorAll(selector); }
+function $(selector, target = document) {
+ return target.querySelector(selector);
+}
+function $$(selector, target = document) {
+ return target.querySelectorAll(selector);
+}
/**
* Takes an iterable collection, and a hash. Return the first
diff --git a/devtools/client/webaudioeditor/models.js b/devtools/client/webaudioeditor/models.js
index bc47187903f8..046b25e0d897 100644
--- a/devtools/client/webaudioeditor/models.js
+++ b/devtools/client/webaudioeditor/models.js
@@ -141,7 +141,6 @@ class AudioNodeModel extends EventEmitter {
}
}
-
/**
* Constructor for a Collection of `AudioNodeModel` models.
*
@@ -181,6 +180,7 @@ class AudioNodesCollection extends EventEmitter {
* @return AudioNodeModel
*/
add(obj) {
+ // eslint-disable-next-line new-cap
let node = new this.model(obj);
node.collection = this;
diff --git a/devtools/client/webaudioeditor/panel.js b/devtools/client/webaudioeditor/panel.js
index 53ed0a623563..5f1f6d9f5fb7 100644
--- a/devtools/client/webaudioeditor/panel.js
+++ b/devtools/client/webaudioeditor/panel.js
@@ -20,7 +20,7 @@ function WebAudioEditorPanel(iframeWindow, toolbox) {
exports.WebAudioEditorPanel = WebAudioEditorPanel;
WebAudioEditorPanel.prototype = {
- open: function () {
+ open: function() {
let targetPromise;
// Local debugging needs to make the target remote.
@@ -55,7 +55,7 @@ WebAudioEditorPanel.prototype = {
return this._toolbox.target;
},
- destroy: function () {
+ destroy: function() {
// Make sure this panel is not already destroyed.
if (this._destroyer) {
return this._destroyer;
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js
index f7e2309e8175..1e162c126a07 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-add-automation-event.js
@@ -5,7 +5,7 @@
* Test AudioNode#addAutomationEvent();
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-bypass.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-bypass.js
index 008e3bb80e87..52fbb52104d4 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-bypass.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-bypass.js
@@ -5,7 +5,7 @@
* Test AudioNode#bypass(), AudioNode#isBypassed()
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-bypassable.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-bypassable.js
index 40ff60e33897..cc233b8b52fc 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-bypassable.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-bypassable.js
@@ -5,7 +5,7 @@
* Test AudioNode#bypassable
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-connectnode-disconnect.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-connectnode-disconnect.js
index 94426813a6ba..3cda7424f38c 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-connectnode-disconnect.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-connectnode-disconnect.js
@@ -6,7 +6,7 @@
* Uses the editor front as the actors do not retain connect state.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-connectparam.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-connectparam.js
index 54c9b840e864..413b57e3a35d 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-connectparam.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-connectparam.js
@@ -6,7 +6,7 @@
* Uses the editor front as the actors do not retain connect state.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js
index de5526d23efe..a7f3c521db67 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-01.js
@@ -6,7 +6,7 @@
* a curve as the last event to check duration spread.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js
index 0d35b463f355..1888dd9289a3 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-02.js
@@ -6,7 +6,7 @@
* `setTargetAtTime`, which approaches its target to infinity.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-03.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-03.js
index c7505385b988..2196079c3e95 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-03.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-automation-data-03.js
@@ -6,7 +6,7 @@
* its argument.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-param-flags.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-param-flags.js
index fba642de0793..6cf726382bc3 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-param-flags.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-param-flags.js
@@ -5,7 +5,7 @@
* Test AudioNode#getParamFlags()
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
@@ -33,12 +33,10 @@ add_task(async function () {
if (param === "buffer") {
is(flags.Buffer, true, "`buffer` params have Buffer flag");
- }
- else if (param === "bufferSize" || param === "frequencyBinCount") {
+ } else if (param === "bufferSize" || param === "frequencyBinCount") {
is(flags.readonly, true, param + " is readonly");
- }
- else if (param === "curve") {
- is(flags["Float32Array"], true, "`curve` param has Float32Array flag");
+ } else if (param === "curve") {
+ is(flags.Float32Array, true, "`curve` param has Float32Array flag");
}
}
}
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-01.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-01.js
index f0586a4d970b..1af632ffefa9 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-01.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-01.js
@@ -5,7 +5,7 @@
* Test AudioNode#getParams()
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
@@ -35,12 +35,10 @@ add_task(async function () {
if (param === "buffer") {
is(flags.Buffer, true, "`buffer` params have Buffer flag");
- }
- else if (param === "bufferSize" || param === "frequencyBinCount") {
+ } else if (param === "bufferSize" || param === "frequencyBinCount") {
is(flags.readonly, true, param + " is readonly");
- }
- else if (param === "curve") {
- is(flags["Float32Array"], true, "`curve` param has Float32Array flag");
+ } else if (param === "curve") {
+ is(flags.Float32Array, true, "`curve` param has Float32Array flag");
}
});
});
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-02.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-02.js
index 4ee7c11087f8..65f497b8b0cf 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-02.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-params-02.js
@@ -6,7 +6,7 @@
* from the AudioNode actors.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
@@ -39,8 +39,7 @@ function compare(actual, expected, type) {
value = getGripValue(value);
if (typeof expected[param] === "function") {
ok(expected[param](value), type + " has a passing value for " + param);
- }
- else {
+ } else {
is(value, expected[param], type + " has correct default value and type for " + param);
}
});
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-set-param.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-set-param.js
index 4702a92c7bb7..0b6eda51ab61 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-get-set-param.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-get-set-param.js
@@ -5,7 +5,7 @@
* Test AudioNode#getParam() / AudioNode#setParam()
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, [destNode, oscNode, gainNode]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-source.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-source.js
index 6845f197fbbd..5d977c346a27 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-source.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-source.js
@@ -5,7 +5,7 @@
* Test AudioNode#source
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
@@ -17,10 +17,11 @@ add_task(async function () {
actualTypes.forEach((type, i) => {
let shouldBeSource = type === "AudioBufferSourceNode" || type === "OscillatorNode";
- if (shouldBeSource)
+ if (shouldBeSource) {
is(isSourceResult[i], true, type + "'s `source` is `true`");
- else
+ } else {
is(isSourceResult[i], false, type + "'s `source` is `false`");
+ }
});
await removeTab(target.tab);
diff --git a/devtools/client/webaudioeditor/test/browser_audionode-actor-type.js b/devtools/client/webaudioeditor/test/browser_audionode-actor-type.js
index 3f57a3ceff59..8049126b41af 100644
--- a/devtools/client/webaudioeditor/test/browser_audionode-actor-type.js
+++ b/devtools/client/webaudioeditor/test/browser_audionode-actor-type.js
@@ -5,7 +5,7 @@
* Test AudioNode#type
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_NODES_URL);
let [_, nodes] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_callwatcher-01.js b/devtools/client/webaudioeditor/test/browser_callwatcher-01.js
index ade42bd248c0..31be441ecee9 100644
--- a/devtools/client/webaudioeditor/test/browser_callwatcher-01.js
+++ b/devtools/client/webaudioeditor/test/browser_callwatcher-01.js
@@ -10,7 +10,7 @@
const BUG_1130901_URL = EXAMPLE_URL + "doc_bug_1130901.html";
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(BUG_1130901_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_callwatcher-02.js b/devtools/client/webaudioeditor/test/browser_callwatcher-02.js
index a89a04537ef7..278036a07e3b 100644
--- a/devtools/client/webaudioeditor/test/browser_callwatcher-02.js
+++ b/devtools/client/webaudioeditor/test/browser_callwatcher-02.js
@@ -9,7 +9,7 @@
const BUG_1112378_URL = EXAMPLE_URL + "doc_bug_1112378.html";
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(BUG_1112378_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_automation-view-01.js b/devtools/client/webaudioeditor/test/browser_wa_automation-view-01.js
index 14e87cce5fa9..d302dd58db4f 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_automation-view-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_automation-view-01.js
@@ -6,7 +6,7 @@
* or params exist.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(AUTOMATION_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_automation-view-02.js b/devtools/client/webaudioeditor/test/browser_wa_automation-view-02.js
index 61b709a40639..57b967eb149c 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_automation-view-02.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_automation-view-02.js
@@ -6,7 +6,7 @@
* switching between AudioParam rerenders the graph.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(AUTOMATION_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, AutomationView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_controller-01.js b/devtools/client/webaudioeditor/test/browser_wa_controller-01.js
index 0b04c894f058..bd9f7648d48a 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_controller-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_controller-01.js
@@ -9,7 +9,7 @@
const BUG_1125817_URL = EXAMPLE_URL + "doc_bug_1125817.html";
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(BUG_1125817_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js b/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
index 1a15a73f9708..853e9014fbec 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_destroy-node-01.js
@@ -9,7 +9,7 @@
* All done in one test since this test takes a few seconds to clear GC.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(DESTROY_NODES_URL);
let { panelWin } = panel;
let { gFront, $, $$, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_first-run.js b/devtools/client/webaudioeditor/test/browser_wa_first-run.js
index cdc169370eaf..913c4ab9f5a6 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_first-run.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_first-run.js
@@ -5,7 +5,7 @@
* Tests that the reloading/onContentLoaded hooks work.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { gFront, $ } = panel.panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-click.js b/devtools/client/webaudioeditor/test/browser_wa_graph-click.js
index ad3cc3371dbe..40fbe61f5a2e 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-click.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-click.js
@@ -6,7 +6,7 @@
* the correct node in the InspectorView
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(COMPLEX_CONTEXT_URL);
let panelWin = panel.panelWin;
let { gFront, $, $$, InspectorView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-markers.js b/devtools/client/webaudioeditor/test/browser_wa_graph-markers.js
index 3af4bc9d3087..7901cfadb40c 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-markers.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-markers.js
@@ -7,7 +7,7 @@
const { setTheme } = require("devtools/client/shared/theme");
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, MARKER_STYLING } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-01.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-01.js
index 2df2af698209..3fce10d68a18 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-01.js
@@ -7,7 +7,7 @@
var connectCount = 0;
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-02.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-02.js
index 6d39300495b8..6814768f4c75 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-02.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-02.js
@@ -5,7 +5,7 @@
* Tests more edge rendering for complex graphs.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(COMPLEX_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$ } = panelWin;
@@ -23,7 +23,6 @@ add_task(async function () {
let types = ["AudioDestinationNode", "OscillatorNode", "GainNode", "ScriptProcessorNode",
"OscillatorNode", "GainNode", "AudioBufferSourceNode", "BiquadFilterNode"];
-
types.forEach((type, i) => {
ok(findGraphNode(panelWin, nodeIDs[i]).classList.contains("type-" + type), "found " + type + " with class");
});
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-03.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-03.js
index 07a63a836bc2..9534f5278833 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-03.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-03.js
@@ -5,7 +5,7 @@
* Tests to ensure that selected nodes stay selected on graph redraw.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-04.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-04.js
index 9643cb1c7c7f..c9675864e542 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-04.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-04.js
@@ -5,7 +5,7 @@
* Tests audio param connection rendering.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(CONNECT_MULTI_PARAM_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-05.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-05.js
index 5330bc8b3fb2..d09fcdd9b9ca 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-05.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-05.js
@@ -5,7 +5,7 @@
* Tests to ensure that param connections trigger graph redraws
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-render-06.js b/devtools/client/webaudioeditor/test/browser_wa_graph-render-06.js
index 24fb4cf514c3..c239c8078179 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-render-06.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-render-06.js
@@ -7,7 +7,7 @@
const BUG_1141261_URL = EXAMPLE_URL + "doc_bug_1141261.html";
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(BUG_1141261_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-selected.js b/devtools/client/webaudioeditor/test/browser_wa_graph-selected.js
index f623caf42623..5debf04c259c 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-selected.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-selected.js
@@ -5,7 +5,7 @@
* Tests that SVG nodes and edges were created for the Graph View.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_graph-zoom.js b/devtools/client/webaudioeditor/test/browser_wa_graph-zoom.js
index 554465412601..75adc773abd8 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_graph-zoom.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_graph-zoom.js
@@ -5,7 +5,7 @@
* Tests that the graph's scale and position is reset on a page reload.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, ContextView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_inspector-bypass-01.js b/devtools/client/webaudioeditor/test/browser_wa_inspector-bypass-01.js
index 92c2e773788e..69fd684330d7 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_inspector-bypass-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_inspector-bypass-01.js
@@ -5,7 +5,7 @@
* Tests that nodes are correctly bypassed when bypassing.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, gAudioNodes } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_inspector-toggle.js b/devtools/client/webaudioeditor/test/browser_wa_inspector-toggle.js
index 935ed271b873..f8d94fce1867 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_inspector-toggle.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_inspector-toggle.js
@@ -6,7 +6,7 @@
* the inspector panel as intended.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, InspectorView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_inspector-width.js b/devtools/client/webaudioeditor/test/browser_wa_inspector-width.js
index 4d7ceae97a90..8d27c96beb6a 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_inspector-width.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_inspector-width.js
@@ -6,7 +6,7 @@
* a preference
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, InspectorView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_inspector.js b/devtools/client/webaudioeditor/test/browser_wa_inspector.js
index 56b231489d64..a18f68b3bae1 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_inspector.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_inspector.js
@@ -6,7 +6,7 @@
* loads the correct node inside the inspector.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, InspectorView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_navigate.js b/devtools/client/webaudioeditor/test/browser_wa_navigate.js
index 977415050b7f..7a4f2bb7993f 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_navigate.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_navigate.js
@@ -6,7 +6,7 @@
* the audio graph if both pages have an AudioContext.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $ } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-01.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-01.js
index 46b722a75148..ad635e8ae7bc 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-01.js
@@ -5,7 +5,7 @@
* Tests that properties are updated when modifying the VariablesView.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
@@ -37,17 +37,17 @@ add_task(async function () {
}, "default loaded string");
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
- await waitForInspectorRender(panelWin, EVENTS),
+ await waitForInspectorRender(panelWin, EVENTS);
checkVariableView(gVars, 0, {
"gain": 0
}, "default loaded number");
click(panelWin, findGraphNode(panelWin, nodeIds[1]));
- await waitForInspectorRender(panelWin, EVENTS),
+ await waitForInspectorRender(panelWin, EVENTS);
await setAndCheck(0, "type", "square", "square", "sets string as string");
click(panelWin, findGraphNode(panelWin, nodeIds[2]));
- await waitForInspectorRender(panelWin, EVENTS),
+ await waitForInspectorRender(panelWin, EVENTS);
await setAndCheck(0, "gain", "0.005", 0.005, "sets number as number");
await setAndCheck(0, "gain", "0.1", 0.1, "sets float as float");
await setAndCheck(0, "gain", ".2", 0.2, "sets float without leading zero as float");
@@ -56,7 +56,7 @@ add_task(async function () {
});
function setAndCheckVariable(panelWin, gVars) {
- return async function (varNum, prop, value, expected, desc) {
+ return async function(varNum, prop, value, expected, desc) {
await modifyVariableView(panelWin, gVars, varNum, prop, value);
var props = {};
props[prop] = expected;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-02.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-02.js
index 6f89e4329ec6..14d3fc61abdd 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-02.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-edit-02.js
@@ -5,7 +5,7 @@
* Tests that properties are not updated when modifying the VariablesView.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(COMPLEX_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js
index de3f448f603f..cb5576d4b148 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-media-nodes.js
@@ -15,8 +15,9 @@ function waitForDeviceClosed() {
ChromeUtils.import("resource:///modules/webrtcUI.jsm", temp);
let webrtcUI = temp.webrtcUI;
- if (!webrtcUI.showGlobalIndicator)
+ if (!webrtcUI.showGlobalIndicator) {
return Promise.resolve();
+ }
return new Promise((resolve, reject) => {
const message = "webrtc:UpdateGlobalIndicators";
@@ -30,7 +31,7 @@ function waitForDeviceClosed() {
});
}
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(MEDIA_NODES_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-params-objects.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-params-objects.js
index 1ca036088bea..b12207c1782f 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-params-objects.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-params-objects.js
@@ -6,7 +6,7 @@
* like AudioBuffer and Float32Array in properties of AudioNodes.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(BUFFER_AND_ARRAY_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view-params.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view-params.js
index 85dde6c1dc60..77725d8ea59b 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view-params.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view-params.js
@@ -6,7 +6,7 @@
* correctly, with default values and correct types.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_NODES_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_properties-view.js b/devtools/client/webaudioeditor/test/browser_wa_properties-view.js
index 64a0940bdbfd..e7774de09aae 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_properties-view.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_properties-view.js
@@ -5,7 +5,7 @@
* Tests that params view shows params when they exist, and are hidden otherwise.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, $$, EVENTS, PropertiesView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_reset-01.js b/devtools/client/webaudioeditor/test/browser_wa_reset-01.js
index 46fde7c893e1..182e7b087dfe 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_reset-01.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_reset-01.js
@@ -6,7 +6,7 @@
* event and reshow the tools after reloading.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { gFront, $ } = panel.panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_reset-02.js b/devtools/client/webaudioeditor/test/browser_wa_reset-02.js
index bcf0d1c5d9b8..cf85976e0ee4 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_reset-02.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_reset-02.js
@@ -6,7 +6,7 @@
* the graph.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $ } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_reset-03.js b/devtools/client/webaudioeditor/test/browser_wa_reset-03.js
index fd391e81495a..ef0397e66121 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_reset-03.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_reset-03.js
@@ -6,7 +6,7 @@
* the inspector and selected node.
*/
-add_task(async function () {
+add_task(async function() {
let { target, panel } = await initWebAudioEditor(SIMPLE_CONTEXT_URL);
let { panelWin } = panel;
let { gFront, $, InspectorView } = panelWin;
diff --git a/devtools/client/webaudioeditor/test/browser_wa_reset-04.js b/devtools/client/webaudioeditor/test/browser_wa_reset-04.js
index 8f12c3bf6140..6c35495b1bd1 100644
--- a/devtools/client/webaudioeditor/test/browser_wa_reset-04.js
+++ b/devtools/client/webaudioeditor/test/browser_wa_reset-04.js
@@ -5,7 +5,7 @@
* Tests that switching to an iframe works fine.
*/
-add_task(async function () {
+add_task(async function() {
Services.prefs.setBoolPref("devtools.command-button-frames.enabled", true);
let { target, panel, toolbox } = await initWebAudioEditor(IFRAME_CONTEXT_URL);
diff --git a/devtools/client/webaudioeditor/test/browser_webaudio-actor-automation-event.js b/devtools/client/webaudioeditor/test/browser_webaudio-actor-automation-event.js
index b5caa641ebc4..f5809b190417 100644
--- a/devtools/client/webaudioeditor/test/browser_webaudio-actor-automation-event.js
+++ b/devtools/client/webaudioeditor/test/browser_webaudio-actor-automation-event.js
@@ -6,7 +6,7 @@
* with correct arguments from the content.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(AUTOMATION_URL);
let events = [];
diff --git a/devtools/client/webaudioeditor/test/browser_webaudio-actor-connect-param.js b/devtools/client/webaudioeditor/test/browser_webaudio-actor-connect-param.js
index d3abd90ceac5..0f4cae2903d0 100644
--- a/devtools/client/webaudioeditor/test/browser_webaudio-actor-connect-param.js
+++ b/devtools/client/webaudioeditor/test/browser_webaudio-actor-connect-param.js
@@ -5,7 +5,7 @@
* Test the `connect-param` event on the web audio actor.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(CONNECT_PARAM_URL);
let [, , [destNode, carrierNode, modNode, gainNode], , connectParam] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js b/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
index 291b50ac9084..644e7747e222 100644
--- a/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
+++ b/devtools/client/webaudioeditor/test/browser_webaudio-actor-destroy-node.js
@@ -5,7 +5,7 @@
* Test `destroy-node` event on WebAudioActor.
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(DESTROY_NODES_URL);
let [, , created] = await Promise.all([
@@ -34,8 +34,9 @@ add_task(async function () {
function actorIsInList(list, actor) {
for (let i = 0; i < list.length; i++) {
- if (list[i].actorID === actor.actorID)
+ if (list[i].actorID === actor.actorID) {
return list[i];
+ }
}
return null;
}
diff --git a/devtools/client/webaudioeditor/test/browser_webaudio-actor-simple.js b/devtools/client/webaudioeditor/test/browser_webaudio-actor-simple.js
index 764aa3477a81..8e17d250c4f6 100644
--- a/devtools/client/webaudioeditor/test/browser_webaudio-actor-simple.js
+++ b/devtools/client/webaudioeditor/test/browser_webaudio-actor-simple.js
@@ -5,7 +5,7 @@
* Test basic communication of Web Audio actor
*/
-add_task(async function () {
+add_task(async function() {
let { target, front } = await initBackend(SIMPLE_CONTEXT_URL);
let [_, __, [destNode, oscNode, gainNode], [connect1, connect2]] = await Promise.all([
front.setup({ reload: true }),
diff --git a/devtools/client/webaudioeditor/test/doc_buffer-and-array.html b/devtools/client/webaudioeditor/test/doc_buffer-and-array.html
index 9f85222672bb..8b8897806c03 100644
--- a/devtools/client/webaudioeditor/test/doc_buffer-and-array.html
+++ b/devtools/client/webaudioeditor/test/doc_buffer-and-array.html
@@ -42,7 +42,7 @@
return curve;
}
- function getBuffer (url, callback) {
+ function getBuffer(url, callback) {
let xhr = new XMLHttpRequest();
xhr.open("GET", url, true);
xhr.responseType = "arraybuffer";
diff --git a/devtools/client/webaudioeditor/test/doc_bug_1112378.html b/devtools/client/webaudioeditor/test/doc_bug_1112378.html
index 42ca3a38ea3e..7081918d5161 100644
--- a/devtools/client/webaudioeditor/test/doc_bug_1112378.html
+++ b/devtools/client/webaudioeditor/test/doc_bug_1112378.html
@@ -16,7 +16,7 @@
let ctx = new AudioContext();
let osc = ctx.createOscillator();
- function throwError () {
+ function throwError() {
try {
osc.connect({});
} catch (e) {
@@ -28,11 +28,11 @@
instanceof: e instanceof TypeError,
stringified: e.toString(),
name: e.name
- }
+ };
}
}
- function throwDOMException () {
+ function throwDOMException() {
try {
osc.frequency.setValueAtTime(0, -1);
} catch (e) {
@@ -46,11 +46,10 @@
instanceof: e instanceof DOMException,
stringified: e.toString(),
name: e.name
- }
+ };
}
}
-