diff --git a/.eslintignore b/.eslintignore
index a706c0a2a1f..c92509a3659 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -187,8 +187,8 @@ toolkit/components/osfile/**
toolkit/components/passwordmgr/**
# Uses preprocessing
-toolkit/content/contentAreaUtils.js
toolkit/content/widgets/videocontrols.xml
+toolkit/content/widgets/wizard.xml
toolkit/components/jsdownloads/src/DownloadIntegration.jsm
toolkit/components/search/nsSearchService.js
toolkit/components/url-classifier/**
diff --git a/.eslintrc b/.eslintrc
index 19fdb0b55df..491de0d4f26 100644
--- a/.eslintrc
+++ b/.eslintrc
@@ -4,9 +4,7 @@
"mozilla"
],
"rules": {
- "mozilla/components-imports": 1,
- "mozilla/import-globals-from": 1,
- "mozilla/this-top-level-scope": 1,
+ "mozilla/import-globals": 1,
},
"env": {
"es6": true
diff --git a/addon-sdk/source/lib/sdk/places/host/host-query.js b/addon-sdk/source/lib/sdk/places/host/host-query.js
index 7984db95ec2..f2dbd6550cd 100644
--- a/addon-sdk/source/lib/sdk/places/host/host-query.js
+++ b/addon-sdk/source/lib/sdk/places/host/host-query.js
@@ -47,18 +47,32 @@ function execute (queries, options) {
return new Promise(resolve => {
let root = historyService
.executeQueries(queries, queries.length, options).root;
- resolve(collect([], root));
+ // Let's extract an eventual uri wildcard, if both domain and uri are set.
+ // See utils.js::urlQueryParser() for more details.
+ // In case of multiple queries, we only retain the first found wildcard.
+ let uriWildcard = queries.reduce((prev, query) => {
+ if (query.uri && query.domain) {
+ if (!prev)
+ prev = query.uri.spec;
+ query.uri = null;
+ }
+ return prev;
+ }, "");
+ resolve(collect([], root, uriWildcard));
});
}
-function collect (acc, node) {
+function collect (acc, node, uriWildcard) {
node.containerOpen = true;
for (let i = 0; i < node.childCount; i++) {
let child = node.getChild(i);
- acc.push(child);
+
+ if (!uriWildcard || child.uri.startsWith(uriWildcard)) {
+ acc.push(child);
+ }
if (child.type === child.RESULT_TYPE_FOLDER) {
let container = child.QueryInterface(Ci.nsINavHistoryContainerResultNode);
- collect(acc, container);
+ collect(acc, container, uriWildcard);
}
}
node.containerOpen = false;
diff --git a/addon-sdk/source/lib/sdk/places/utils.js b/addon-sdk/source/lib/sdk/places/utils.js
index 034b4f946f9..44366d2aaba 100644
--- a/addon-sdk/source/lib/sdk/places/utils.js
+++ b/addon-sdk/source/lib/sdk/places/utils.js
@@ -12,7 +12,7 @@ module.metadata = {
}
};
-const { Cc, Ci } = require('chrome');
+const { Cc, Ci, Cu } = require('chrome');
const { Class } = require('../core/heritage');
const { method } = require('../lang/functional');
const { defer, promised, all } = require('../core/promise');
@@ -22,6 +22,8 @@ const { merge } = require('../util/object');
const bmsrv = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
+Cu.importGlobalProperties(["URL"]);
+
/*
* TreeNodes are used to construct dependency trees
* for BookmarkItems
@@ -128,9 +130,9 @@ exports.isRootGroup = isRootGroup;
* --> 'http://moz.com', 'http://moz.com/thunderbird'
* '*.moz.com' // domain: moz.com, domainIsHost: false
* --> 'http://moz.com', 'http://moz.com/index', 'http://ff.moz.com/test'
- * 'http://moz.com' // url: http://moz.com/, urlIsPrefix: false
+ * 'http://moz.com' // uri: http://moz.com/
* --> 'http://moz.com/'
- * 'http://moz.com/*' // url: http://moz.com/, urlIsPrefix: true
+ * 'http://moz.com/*' // uri: http://moz.com/, domain: moz.com, domainIsHost: true
* --> 'http://moz.com/', 'http://moz.com/thunderbird'
*/
@@ -139,8 +141,21 @@ function urlQueryParser (query, url) {
if (/^https?:\/\//.test(url)) {
query.uri = url.charAt(url.length - 1) === '/' ? url : url + '/';
if (/\*$/.test(url)) {
- query.uri = url.replace(/\*$/, '');
- query.uriIsPrefix = true;
+ // Wildcard searches on URIs are not supported, so try to extract a
+ // domain and filter the data later.
+ url = url.replace(/\*$/, '');
+ try {
+ query.domain = new URL(url).hostname;
+ query.domainIsHost = true;
+ // Unfortunately here we cannot use an expando to store the wildcard,
+ // cause the query is a wrapped native XPCOM object, so we reuse uri.
+ // We clearly don't want to query for both uri and domain, thus we'll
+ // have to handle this in host-query.js::execute()
+ query.uri = url;
+ } catch (ex) {
+ // Cannot extract an host cause it's not a valid uri, the query will
+ // just return nothing.
+ }
}
} else {
if (/^\*/.test(url)) {
diff --git a/browser/base/content/browser-menubar.inc b/browser/base/content/browser-menubar.inc
index f85031c233f..f6c2c16ae69 100644
--- a/browser/base/content/browser-menubar.inc
+++ b/browser/base/content/browser-menubar.inc
@@ -453,8 +453,8 @@
key="bookmarkAllTabsKb"/>
-
-
-
-
- tab.linkedBrowser));
- ]]>
-
-
- null
+
+ {
+ if (typeof name == "string" && Number.isInteger(parseInt(name))) {
+ return (name in this.tabs);
+ }
+ return false;
+ },
+ get: (target, name) => {
+ if (name == "length") {
+ return this.tabs.length;
+ }
+ if (typeof name == "string" && Number.isInteger(parseInt(name))) {
+ if (!(name in this.tabs)) {
+ return undefined;
+ }
+ return this.tabs[name].linkedBrowser;
+ }
+ return target[name];
+ }
+ });
+ ]]>
+
@@ -2929,8 +2941,7 @@
this.mCurrentTab._logicallySelected = false;
this.mCurrentTab._visuallySelected = false;
- // invalidate caches
- this._browsers = null;
+ // invalidate cache
this._visibleTabs = null;
// use .item() instead of [] because dragging to the end of the strip goes out of
diff --git a/browser/base/content/test/general/browser.ini b/browser/base/content/test/general/browser.ini
index 392f5020596..3185c7d9fe3 100644
--- a/browser/base/content/test/general/browser.ini
+++ b/browser/base/content/test/general/browser.ini
@@ -136,7 +136,6 @@ skip-if = e10s # Bug 1093153 - no about:home support yet
[browser_action_searchengine_alias.js]
[browser_addKeywordSearch.js]
[browser_search_favicon.js]
-skip-if = e10s # Bug 1212647
[browser_alltabslistener.js]
[browser_audioTabIcon.js]
[browser_autocomplete_a11y_label.js]
@@ -290,8 +289,6 @@ skip-if = os == 'win' || e10s # Bug 1159268 - Need a content-process safe versio
skip-if = e10s # Bug 1094510 - test hits the network in e10s mode only
[browser_clipboard.js]
[browser_contentAreaClick.js]
-[browser_contextSearchTabPosition.js]
-skip-if = os == "mac" || e10s # bug 967013; e10s: bug 1094761 - test hits the network in e10s, causing next test to crash
[browser_ctrlTab.js]
[browser_datachoices_notification.js]
skip-if = !datareporting
diff --git a/browser/components/extensions/ext-bookmarks.js b/browser/components/extensions/ext-bookmarks.js
index c1d759dd0b2..26a6909ae31 100644
--- a/browser/components/extensions/ext-bookmarks.js
+++ b/browser/components/extensions/ext-bookmarks.js
@@ -2,7 +2,7 @@
/* vim: set sts=2 sw=2 et tw=80: */
"use strict";
-const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
+const {classes: Cc, interfaces: Ci, utils: Cu} = Components;
Cu.import("resource://gre/modules/PlacesUtils.jsm");
var Bookmarks = PlacesUtils.bookmarks;
@@ -111,7 +111,9 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
return getTree(id, false);
},
- // search
+ search: function(query) {
+ return Bookmarks.search(query).then(result => result.map(convert));
+ },
create: function(bookmark) {
let info = {
@@ -139,7 +141,7 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
try {
return Bookmarks.insert(info).then(convert);
} catch (e) {
- return Promise.reject({ message: `Invalid bookmark: ${JSON.stringify(info)}` });
+ return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
}
},
@@ -158,7 +160,7 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
try {
return Bookmarks.update(info).then(convert);
} catch (e) {
- return Promise.reject({ message: `Invalid bookmark: ${JSON.stringify(info)}` });
+ return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
}
},
@@ -177,7 +179,7 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
try {
return Bookmarks.update(info).then(convert);
} catch (e) {
- return Promise.reject({ message: `Invalid bookmark: ${JSON.stringify(info)}` });
+ return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
}
},
@@ -190,7 +192,7 @@ extensions.registerSchemaAPI("bookmarks", "bookmarks", (extension, context) => {
try {
return Bookmarks.remove(info).then(result => {});
} catch (e) {
- return Promise.reject({ message: `Invalid bookmark: ${JSON.stringify(info)}` });
+ return Promise.reject({message: `Invalid bookmark: ${JSON.stringify(info)}`});
}
},
},
diff --git a/browser/components/extensions/ext-browserAction.js b/browser/components/extensions/ext-browserAction.js
index 0da06076b75..718eccd143f 100644
--- a/browser/components/extensions/ext-browserAction.js
+++ b/browser/components/extensions/ext-browserAction.js
@@ -44,7 +44,7 @@ function BrowserAction(options, extension) {
title: title || extension.name,
badgeText: "",
badgeBackgroundColor: null,
- icon: IconDetails.normalize({ path: options.default_icon }, extension,
+ icon: IconDetails.normalize({path: options.default_icon}, extension,
null, true),
popup: popup,
};
diff --git a/browser/components/extensions/ext-contextMenus.js b/browser/components/extensions/ext-contextMenus.js
index d1c54398a4d..ae0cafa4174 100644
--- a/browser/components/extensions/ext-contextMenus.js
+++ b/browser/components/extensions/ext-contextMenus.js
@@ -310,7 +310,7 @@ MenuItem.prototype = {
let extension = this.extension;
if (!rootItems.has(extension)) {
let root = new MenuItem(extension, this.context,
- { title: extension.name },
+ {title: extension.name},
/* isRoot = */ true);
rootItems.set(extension, root);
}
diff --git a/browser/components/extensions/ext-desktop-runtime.js b/browser/components/extensions/ext-desktop-runtime.js
index ccfa3207ede..a7d9f176bd2 100644
--- a/browser/components/extensions/ext-desktop-runtime.js
+++ b/browser/components/extensions/ext-desktop-runtime.js
@@ -4,7 +4,7 @@
extensions.on("uninstall", (msg, extension) => {
if (extension.uninstallURL) {
let browser = Services.wm.getMostRecentWindow("navigator:browser").gBrowser;
- browser.addTab(extension.uninstallURL, { relatedToCurrent: true });
+ browser.addTab(extension.uninstallURL, {relatedToCurrent: true});
}
});
diff --git a/browser/components/extensions/ext-pageAction.js b/browser/components/extensions/ext-pageAction.js
index 3d89b170e5e..138069999ad 100644
--- a/browser/components/extensions/ext-pageAction.js
+++ b/browser/components/extensions/ext-pageAction.js
@@ -28,7 +28,7 @@ function PageAction(options, extension) {
this.defaults = {
show: false,
title: title || extension.name,
- icon: IconDetails.normalize({ path: options.default_icon }, extension,
+ icon: IconDetails.normalize({path: options.default_icon}, extension,
null, true),
popup: popup && extension.baseURI.resolve(popup),
};
diff --git a/browser/components/extensions/ext-tabs.js b/browser/components/extensions/ext-tabs.js
index 72a43e787c2..c8d0fea1fe2 100644
--- a/browser/components/extensions/ext-tabs.js
+++ b/browser/components/extensions/ext-tabs.js
@@ -465,7 +465,7 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
captureVisibleTab: function(windowId, options) {
if (!extension.hasPermission("")) {
- return Promise.reject({ message: "The permission is required to use the captureVisibleTab API" });
+ return Promise.reject({message: "The permission is required to use the captureVisibleTab API"});
}
let window = windowId == null ?
@@ -524,7 +524,7 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
if (details.file !== null) {
let url = context.uri.resolve(details.file);
if (!extension.isExtensionURL(url)) {
- return Promise.reject({ message: "Files to be injected must be within the extension" });
+ return Promise.reject({message: "Files to be injected must be within the extension"});
}
options[kind].push(url);
}
@@ -538,7 +538,7 @@ extensions.registerSchemaAPI("tabs", null, (extension, context) => {
options.run_at = details.runAt;
}
- return context.sendMessage(mm, "Extension:Execute", { options }, recipient);
+ return context.sendMessage(mm, "Extension:Execute", {options}, recipient);
},
executeScript: function(tabId, details) {
diff --git a/browser/components/extensions/ext-utils.js b/browser/components/extensions/ext-utils.js
index 8b2374e5c67..a05f5356684 100644
--- a/browser/components/extensions/ext-utils.js
+++ b/browser/components/extensions/ext-utils.js
@@ -235,7 +235,7 @@ class BasePopup {
};
this.browser.addEventListener("load", loadListener, true);
}).then(() => {
- let { contentWindow } = this.browser;
+ let {contentWindow} = this.browser;
contentWindow.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIDOMWindowUtils)
@@ -423,7 +423,7 @@ ExtensionTabManager.prototype = {
convert(tab) {
let window = tab.ownerDocument.defaultView;
- let mutedInfo = { muted: tab.muted };
+ let mutedInfo = {muted: tab.muted};
if (tab.muteReason === null) {
mutedInfo.reason = "user";
} else if (tab.muteReason) {
diff --git a/browser/components/extensions/schemas/bookmarks.json b/browser/components/extensions/schemas/bookmarks.json
index 09f67c26363..867bb76715c 100644
--- a/browser/components/extensions/schemas/bookmarks.json
+++ b/browser/components/extensions/schemas/bookmarks.json
@@ -234,7 +234,6 @@
},
{
"name": "search",
- "unsupported": true,
"type": "function",
"description": "Searches for BookmarkTreeNodes matching the given query. Queries specified with an object produce BookmarkTreeNodes matching all specified properties.",
"async": "callback",
@@ -258,6 +257,7 @@
},
"url": {
"type": "string",
+ "format": "url",
"optional": true,
"description": "The URL of the bookmark; matches verbatim. Note that folders have no URL."
},
diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_context.js b/browser/components/extensions/test/browser/browser_ext_browserAction_context.js
index a325d23a430..eee0d97a9bd 100644
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_context.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_context.js
@@ -13,10 +13,10 @@ function* runTests(options) {
browser.browserAction.getBadgeText({tabId}),
browser.browserAction.getBadgeBackgroundColor({tabId})]
).then(details => {
- return Promise.resolve({ title: details[0],
- popup: details[1],
- badge: details[2],
- badgeBackgroundColor: details[3] });
+ return Promise.resolve({title: details[0],
+ popup: details[1],
+ badge: details[2],
+ badgeBackgroundColor: details[3]});
});
}
@@ -53,7 +53,7 @@ function* runTests(options) {
// Check that the API returns the expected values, and then
// run the next test.
new Promise(resolve => {
- return browser.tabs.query({ active: true, currentWindow: true }, resolve);
+ return browser.tabs.query({active: true, currentWindow: true}, resolve);
}).then(tabs => {
return checkDetails(expecting, tabs[0].id);
}).then(() => {
@@ -72,7 +72,7 @@ function* runTests(options) {
nextTest();
});
- browser.tabs.query({ active: true, currentWindow: true }, resultTabs => {
+ browser.tabs.query({active: true, currentWindow: true}, resultTabs => {
tabs[0] = resultTabs[0].id;
nextTest();
@@ -148,39 +148,39 @@ add_task(function* testTabSwitchContext() {
getTests(tabs, expectDefaults) {
let details = [
- { "icon": browser.runtime.getURL("default.png"),
- "popup": browser.runtime.getURL("default.html"),
- "title": "Default Title",
- "badge": "",
- "badgeBackgroundColor": null },
- { "icon": browser.runtime.getURL("1.png"),
- "popup": browser.runtime.getURL("default.html"),
- "title": "Default Title",
- "badge": "",
- "badgeBackgroundColor": null },
- { "icon": browser.runtime.getURL("2.png"),
- "popup": browser.runtime.getURL("2.html"),
- "title": "Title 2",
- "badge": "2",
- "badgeBackgroundColor": [0xff, 0, 0, 0xff],
- "disabled": true },
- { "icon": browser.runtime.getURL("1.png"),
- "popup": browser.runtime.getURL("default-2.html"),
- "title": "Default Title 2",
- "badge": "d2",
- "badgeBackgroundColor": [0, 0xff, 0, 0xff],
- "disabled": true },
- { "icon": browser.runtime.getURL("1.png"),
- "popup": browser.runtime.getURL("default-2.html"),
- "title": "Default Title 2",
- "badge": "d2",
- "badgeBackgroundColor": [0, 0xff, 0, 0xff],
- "disabled": false },
- { "icon": browser.runtime.getURL("default-2.png"),
- "popup": browser.runtime.getURL("default-2.html"),
- "title": "Default Title 2",
- "badge": "d2",
- "badgeBackgroundColor": [0, 0xff, 0, 0xff] },
+ {"icon": browser.runtime.getURL("default.png"),
+ "popup": browser.runtime.getURL("default.html"),
+ "title": "Default Title",
+ "badge": "",
+ "badgeBackgroundColor": null},
+ {"icon": browser.runtime.getURL("1.png"),
+ "popup": browser.runtime.getURL("default.html"),
+ "title": "Default Title",
+ "badge": "",
+ "badgeBackgroundColor": null},
+ {"icon": browser.runtime.getURL("2.png"),
+ "popup": browser.runtime.getURL("2.html"),
+ "title": "Title 2",
+ "badge": "2",
+ "badgeBackgroundColor": [0xff, 0, 0, 0xff],
+ "disabled": true},
+ {"icon": browser.runtime.getURL("1.png"),
+ "popup": browser.runtime.getURL("default-2.html"),
+ "title": "Default Title 2",
+ "badge": "d2",
+ "badgeBackgroundColor": [0, 0xff, 0, 0xff],
+ "disabled": true},
+ {"icon": browser.runtime.getURL("1.png"),
+ "popup": browser.runtime.getURL("default-2.html"),
+ "title": "Default Title 2",
+ "badge": "d2",
+ "badgeBackgroundColor": [0, 0xff, 0, 0xff],
+ "disabled": false},
+ {"icon": browser.runtime.getURL("default-2.png"),
+ "popup": browser.runtime.getURL("default-2.html"),
+ "title": "Default Title 2",
+ "badge": "d2",
+ "badgeBackgroundColor": [0, 0xff, 0, 0xff]},
];
return [
@@ -192,14 +192,14 @@ add_task(function* testTabSwitchContext() {
},
expect => {
browser.test.log("Change the icon in the current tab. Expect default properties excluding the icon.");
- browser.browserAction.setIcon({ tabId: tabs[0], path: "1.png" });
+ browser.browserAction.setIcon({tabId: tabs[0], path: "1.png"});
expectDefaults(details[0]).then(() => {
expect(details[1]);
});
},
expect => {
browser.test.log("Create a new tab. Expect default properties.");
- browser.tabs.create({ active: true, url: "about:blank?0" }, tab => {
+ browser.tabs.create({active: true, url: "about:blank?0"}, tab => {
tabs.push(tab.id);
expectDefaults(details[0]).then(() => {
expect(details[0]);
@@ -209,11 +209,11 @@ add_task(function* testTabSwitchContext() {
expect => {
browser.test.log("Change properties. Expect new properties.");
let tabId = tabs[1];
- browser.browserAction.setIcon({ tabId, path: "2.png" });
- browser.browserAction.setPopup({ tabId, popup: "2.html" });
- browser.browserAction.setTitle({ tabId, title: "Title 2" });
- browser.browserAction.setBadgeText({ tabId, text: "2" });
- browser.browserAction.setBadgeBackgroundColor({ tabId, color: [0xff, 0, 0, 0xff] });
+ browser.browserAction.setIcon({tabId, path: "2.png"});
+ browser.browserAction.setPopup({tabId, popup: "2.html"});
+ browser.browserAction.setTitle({tabId, title: "Title 2"});
+ browser.browserAction.setBadgeText({tabId, text: "2"});
+ browser.browserAction.setBadgeBackgroundColor({tabId, color: [0xff, 0, 0, 0xff]});
browser.browserAction.disable(tabId);
expectDefaults(details[0]).then(() => {
@@ -232,21 +232,21 @@ add_task(function* testTabSwitchContext() {
}
});
- browser.tabs.update(tabs[1], { url: "about:blank?1" });
+ browser.tabs.update(tabs[1], {url: "about:blank?1"});
},
expect => {
browser.test.log("Switch back to the first tab. Expect previously set properties.");
- browser.tabs.update(tabs[0], { active: true }, () => {
+ browser.tabs.update(tabs[0], {active: true}, () => {
expect(details[1]);
});
},
expect => {
browser.test.log("Change default values, expect those changes reflected.");
- browser.browserAction.setIcon({ path: "default-2.png" });
- browser.browserAction.setPopup({ popup: "default-2.html" });
- browser.browserAction.setTitle({ title: "Default Title 2" });
- browser.browserAction.setBadgeText({ text: "d2" });
- browser.browserAction.setBadgeBackgroundColor({ color: [0, 0xff, 0, 0xff] });
+ browser.browserAction.setIcon({path: "default-2.png"});
+ browser.browserAction.setPopup({popup: "default-2.html"});
+ browser.browserAction.setTitle({title: "Default Title 2"});
+ browser.browserAction.setBadgeText({text: "d2"});
+ browser.browserAction.setBadgeBackgroundColor({color: [0, 0xff, 0, 0xff]});
browser.browserAction.disable();
expectDefaults(details[3]).then(() => {
expect(details[3]);
@@ -261,7 +261,7 @@ add_task(function* testTabSwitchContext() {
},
expect => {
browser.test.log("Switch back to tab 2. Expect former value, unaffected by changes to defaults in previous step.");
- browser.tabs.update(tabs[1], { active: true }, () => {
+ browser.tabs.update(tabs[1], {active: true}, () => {
expectDefaults(details[3]).then(() => {
expect(details[2]);
});
@@ -275,7 +275,7 @@ add_task(function* testTabSwitchContext() {
},
expect => {
browser.test.log("Create a new tab. Expect new default properties.");
- browser.tabs.create({ active: true, url: "about:blank?2" }, tab => {
+ browser.tabs.create({active: true, url: "about:blank?2"}, tab => {
tabs.push(tab.id);
expect(details[5]);
});
@@ -305,26 +305,26 @@ add_task(function* testDefaultTitle() {
getTests(tabs, expectDefaults) {
let details = [
- { "title": "Foo Extension",
- "popup": "",
- "badge": "",
- "badgeBackgroundColor": null,
- "icon": browser.runtime.getURL("icon.png") },
- { "title": "Foo Title",
- "popup": "",
- "badge": "",
- "badgeBackgroundColor": null,
- "icon": browser.runtime.getURL("icon.png") },
- { "title": "Bar Title",
- "popup": "",
- "badge": "",
- "badgeBackgroundColor": null,
- "icon": browser.runtime.getURL("icon.png") },
- { "title": "",
- "popup": "",
- "badge": "",
- "badgeBackgroundColor": null,
- "icon": browser.runtime.getURL("icon.png") },
+ {"title": "Foo Extension",
+ "popup": "",
+ "badge": "",
+ "badgeBackgroundColor": null,
+ "icon": browser.runtime.getURL("icon.png")},
+ {"title": "Foo Title",
+ "popup": "",
+ "badge": "",
+ "badgeBackgroundColor": null,
+ "icon": browser.runtime.getURL("icon.png")},
+ {"title": "Bar Title",
+ "popup": "",
+ "badge": "",
+ "badgeBackgroundColor": null,
+ "icon": browser.runtime.getURL("icon.png")},
+ {"title": "",
+ "popup": "",
+ "badge": "",
+ "badgeBackgroundColor": null,
+ "icon": browser.runtime.getURL("icon.png")},
];
return [
@@ -336,28 +336,28 @@ add_task(function* testDefaultTitle() {
},
expect => {
browser.test.log("Change the title. Expect new title.");
- browser.browserAction.setTitle({ tabId: tabs[0], title: "Foo Title" });
+ browser.browserAction.setTitle({tabId: tabs[0], title: "Foo Title"});
expectDefaults(details[0]).then(() => {
expect(details[1]);
});
},
expect => {
browser.test.log("Change the default. Expect same properties.");
- browser.browserAction.setTitle({ title: "Bar Title" });
+ browser.browserAction.setTitle({title: "Bar Title"});
expectDefaults(details[2]).then(() => {
expect(details[1]);
});
},
expect => {
browser.test.log("Clear the title. Expect new default title.");
- browser.browserAction.setTitle({ tabId: tabs[0], title: "" });
+ browser.browserAction.setTitle({tabId: tabs[0], title: ""});
expectDefaults(details[2]).then(() => {
expect(details[2]);
});
},
expect => {
browser.test.log("Set default title to null string. Expect null string from API, extension title in UI.");
- browser.browserAction.setTitle({ title: "" });
+ browser.browserAction.setTitle({title: ""});
expectDefaults(details[3]).then(() => {
expect(details[3]);
});
diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
index 53fefefaa30..2e8ac03bf81 100644
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_pageAction_icon.js
@@ -31,100 +31,100 @@ add_task(function* testDetailsObjects() {
/* eslint-disable comma-dangle, indent */
let iconDetails = [
// Only paths.
- { details: { "path": "a.png" },
+ {details: {"path": "a.png"},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": browser.runtime.getURL("data/a.png"), } },
- { details: { "path": "/a.png" },
+ "2": browser.runtime.getURL("data/a.png")}},
+ {details: {"path": "/a.png"},
resolutions: {
"1": browser.runtime.getURL("a.png"),
- "2": browser.runtime.getURL("a.png"), } },
- { details: { "path": { "19": "a.png" } },
+ "2": browser.runtime.getURL("a.png")}},
+ {details: {"path": {"19": "a.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": browser.runtime.getURL("data/a.png"), } },
- { details: { "path": { "38": "a.png" } },
+ "2": browser.runtime.getURL("data/a.png")}},
+ {details: {"path": {"38": "a.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": browser.runtime.getURL("data/a.png"), } },
- { details: { "path": { "19": "a.png", "38": "a-x2.png" } },
+ "2": browser.runtime.getURL("data/a.png")}},
+ {details: {"path": {"19": "a.png", "38": "a-x2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": browser.runtime.getURL("data/a-x2.png"), } },
+ "2": browser.runtime.getURL("data/a-x2.png")}},
// Only ImageData objects.
- { details: { "imageData": imageData.red.imageData },
+ {details: {"imageData": imageData.red.imageData},
resolutions: {
"1": imageData.red.url,
- "2": imageData.red.url, } },
- { details: { "imageData": { "19": imageData.red.imageData } },
+ "2": imageData.red.url}},
+ {details: {"imageData": {"19": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
- "2": imageData.red.url, } },
- { details: { "imageData": { "38": imageData.red.imageData } },
+ "2": imageData.red.url}},
+ {details: {"imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
- "2": imageData.red.url, } },
- { details: { "imageData": {
+ "2": imageData.red.url}},
+ {details: {"imageData": {
"19": imageData.red.imageData,
- "38": imageData.green.imageData } },
+ "38": imageData.green.imageData}},
resolutions: {
"1": imageData.red.url,
- "2": imageData.green.url, } },
+ "2": imageData.green.url}},
// Mixed path and imageData objects.
//
// The behavior is currently undefined if both |path| and
// |imageData| specify icons of the same size.
- { details: {
- "path": { "19": "a.png" },
- "imageData": { "38": imageData.red.imageData } },
+ {details: {
+ "path": {"19": "a.png"},
+ "imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": imageData.red.url, } },
- { details: {
- "path": { "38": "a.png" },
- "imageData": { "19": imageData.red.imageData } },
+ "2": imageData.red.url}},
+ {details: {
+ "path": {"38": "a.png"},
+ "imageData": {"19": imageData.red.imageData}},
resolutions: {
"1": imageData.red.url,
- "2": browser.runtime.getURL("data/a.png"), } },
+ "2": browser.runtime.getURL("data/a.png")}},
// A path or ImageData object by itself is treated as a 19px icon.
- { details: {
+ {details: {
"path": "a.png",
- "imageData": { "38": imageData.red.imageData } },
+ "imageData": {"38": imageData.red.imageData}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": imageData.red.url, } },
- { details: {
- "path": { "38": "a.png" },
- "imageData": imageData.red.imageData, },
+ "2": imageData.red.url}},
+ {details: {
+ "path": {"38": "a.png"},
+ "imageData": imageData.red.imageData},
resolutions: {
"1": imageData.red.url,
- "2": browser.runtime.getURL("data/a.png"), } },
+ "2": browser.runtime.getURL("data/a.png")}},
// Various resolutions
- { details: { "path": { "18": "a.png", "32": "a-x2.png" } },
+ {details: {"path": {"18": "a.png", "32": "a-x2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
- "2": browser.runtime.getURL("data/a-x2.png"), } },
- { details: { "path": { "16": "16.png", "100": "100.png" } },
+ "2": browser.runtime.getURL("data/a-x2.png")}},
+ {details: {"path": {"16": "16.png", "100": "100.png"}},
resolutions: {
"1": browser.runtime.getURL("data/100.png"),
- "2": browser.runtime.getURL("data/100.png"), } },
- { details: { "path": { "2": "2.png"} },
+ "2": browser.runtime.getURL("data/100.png")}},
+ {details: {"path": {"2": "2.png"}},
resolutions: {
"1": browser.runtime.getURL("data/2.png"),
- "2": browser.runtime.getURL("data/2.png"), } },
- { details: { "path": {
+ "2": browser.runtime.getURL("data/2.png")}},
+ {details: {"path": {
"6": "6.png",
"18": "18.png",
"32": "32.png",
"48": "48.png",
- "128": "128.png" } },
+ "128": "128.png"}},
resolutions: {
"1": browser.runtime.getURL("data/18.png"),
- "2": browser.runtime.getURL("data/48.png"), } },
+ "2": browser.runtime.getURL("data/48.png")}},
];
// Allow serializing ImageData objects for logging.
@@ -162,7 +162,7 @@ add_task(function* testDetailsObjects() {
let tests = [];
for (let [idx, icon] of iconDetails.entries()) {
for (let res of Object.keys(icon.resolutions)) {
- tests.push({ index: idx, resolution: Number(res) });
+ tests.push({index: idx, resolution: Number(res)});
}
}
@@ -170,7 +170,7 @@ add_task(function* testDetailsObjects() {
// between each test.
tests.sort(test => test.resolution);
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
tabId = tabs[0].id;
browser.pageAction.show(tabId);
@@ -230,7 +230,7 @@ add_task(function* testInvalidIconSizes() {
},
background: function() {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
let tabId = tabs[0].id;
let promises = [];
@@ -255,16 +255,16 @@ add_task(function* testInvalidIconSizes() {
for (let type of ["path", "imageData"]) {
let img = type == "imageData" ? imageData : "test.png";
- assertSetIconThrows({ [type]: { "abcdef": img } });
- assertSetIconThrows({ [type]: { "48px": img } });
- assertSetIconThrows({ [type]: { "20.5": img } });
- assertSetIconThrows({ [type]: { "5.0": img } });
- assertSetIconThrows({ [type]: { "-300": img } });
- assertSetIconThrows({ [type]: { "abc": img, "5": img }});
+ assertSetIconThrows({[type]: {"abcdef": img}});
+ assertSetIconThrows({[type]: {"48px": img}});
+ assertSetIconThrows({[type]: {"20.5": img}});
+ assertSetIconThrows({[type]: {"5.0": img}});
+ assertSetIconThrows({[type]: {"-300": img}});
+ assertSetIconThrows({[type]: {"abc": img, "5": img}});
}
- assertSetIconThrows({ imageData: { "abcdef": imageData }, path: {"5": "test.png"} });
- assertSetIconThrows({ path: { "abcdef": "test.png" }, imageData: {"5": imageData} });
+ assertSetIconThrows({imageData: {"abcdef": imageData}, path: {"5": "test.png"}});
+ assertSetIconThrows({path: {"abcdef": "test.png"}, imageData: {"5": imageData}});
}
Promise.all(promises).then(() => {
@@ -287,9 +287,9 @@ add_task(function* testDefaultDetails() {
let icons = [
"foo/bar.png",
"/foo/bar.png",
- { "19": "foo/bar.png" },
- { "38": "foo/bar.png" },
- { "19": "foo/bar.png", "38": "baz/quux.png" },
+ {"19": "foo/bar.png"},
+ {"38": "foo/bar.png"},
+ {"19": "foo/bar.png", "38": "baz/quux.png"},
];
let expectedURL = new RegExp(String.raw`^moz-extension://[^/]+/foo/bar\.png$`);
@@ -297,12 +297,12 @@ add_task(function* testDefaultDetails() {
for (let icon of icons) {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
- "browser_action": { "default_icon": icon },
- "page_action": { "default_icon": icon },
+ "browser_action": {"default_icon": icon},
+ "page_action": {"default_icon": icon},
},
background: function() {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
let tabId = tabs[0].id;
browser.pageAction.show(tabId);
@@ -345,7 +345,7 @@ add_task(function* testSecureURLsDenied() {
},
background: function() {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
let tabId = tabs[0].id;
let urls = ["chrome://browser/content/browser.xul",
diff --git a/browser/components/extensions/test/browser/browser_ext_browserAction_popup.js b/browser/components/extensions/test/browser/browser_ext_browserAction_popup.js
index ee94ad73537..a4f5fb8afb5 100644
--- a/browser/components/extensions/test/browser/browser_ext_browserAction_popup.js
+++ b/browser/components/extensions/test/browser/browser_ext_browserAction_popup.js
@@ -30,34 +30,34 @@ function* testInArea(area) {
let sendClick;
let tests = [
() => {
- sendClick({ expectEvent: false, expectPopup: "a" });
+ sendClick({expectEvent: false, expectPopup: "a"});
},
() => {
- sendClick({ expectEvent: false, expectPopup: "a" });
+ sendClick({expectEvent: false, expectPopup: "a"});
},
() => {
- browser.browserAction.setPopup({ popup: "popup-b.html" });
- sendClick({ expectEvent: false, expectPopup: "b" });
+ browser.browserAction.setPopup({popup: "popup-b.html"});
+ sendClick({expectEvent: false, expectPopup: "b"});
},
() => {
- sendClick({ expectEvent: false, expectPopup: "b" });
+ sendClick({expectEvent: false, expectPopup: "b"});
},
() => {
- browser.browserAction.setPopup({ popup: "" });
- sendClick({ expectEvent: true, expectPopup: null });
+ browser.browserAction.setPopup({popup: ""});
+ sendClick({expectEvent: true, expectPopup: null});
},
() => {
- sendClick({ expectEvent: true, expectPopup: null });
+ sendClick({expectEvent: true, expectPopup: null});
},
() => {
- browser.browserAction.setPopup({ popup: "/popup-a.html" });
- sendClick({ expectEvent: false, expectPopup: "a" });
+ browser.browserAction.setPopup({popup: "/popup-a.html"});
+ sendClick({expectEvent: false, expectPopup: "a"});
},
];
let expect = {};
- sendClick = ({ expectEvent, expectPopup }) => {
- expect = { event: expectEvent, popup: expectPopup };
+ sendClick = ({expectEvent, expectPopup}) => {
+ expect = {event: expectEvent, popup: expectPopup};
browser.test.sendMessage("send-click");
};
diff --git a/browser/components/extensions/test/browser/browser_ext_contentscript_connect.js b/browser/components/extensions/test/browser/browser_ext_contentscript_connect.js
index 41b0cf86e46..c2ae72c7925 100644
--- a/browser/components/extensions/test/browser/browser_ext_contentscript_connect.js
+++ b/browser/components/extensions/test/browser/browser_ext_contentscript_connect.js
@@ -43,7 +43,7 @@ add_task(function* () {
});
});
- browser.tabs.executeScript({ file: "script.js" });
+ browser.tabs.executeScript({file: "script.js"});
},
files: {
diff --git a/browser/components/extensions/test/browser/browser_ext_contextMenus.js b/browser/components/extensions/test/browser/browser_ext_contextMenus.js
index bbaf38045dc..8daca183948 100644
--- a/browser/components/extensions/test/browser/browser_ext_contextMenus.js
+++ b/browser/components/extensions/test/browser/browser_ext_contextMenus.js
@@ -22,14 +22,14 @@ add_task(function* () {
browser.test.sendMessage("menuItemClick", JSON.stringify(info));
}
- browser.contextMenus.create({ contexts: ["all"], type: "separator" });
+ browser.contextMenus.create({contexts: ["all"], type: "separator"});
let contexts = ["page", "selection", "image"];
for (let i = 0; i < contexts.length; i++) {
let context = contexts[i];
let title = context;
- browser.contextMenus.create({ title: title, contexts: [context], id: "ext-" + context,
- onclick: genericOnClick });
+ browser.contextMenus.create({title: title, contexts: [context], id: "ext-" + context,
+ onclick: genericOnClick});
if (context == "selection") {
browser.contextMenus.update("ext-selection", {
title: "selection is: '%s'",
@@ -41,20 +41,20 @@ add_task(function* () {
}
}
- let parent = browser.contextMenus.create({ title: "parent" });
+ let parent = browser.contextMenus.create({title: "parent"});
browser.contextMenus.create(
- { title: "child1", parentId: parent, onclick: genericOnClick });
+ {title: "child1", parentId: parent, onclick: genericOnClick});
let child2 = browser.contextMenus.create(
- { title: "child2", parentId: parent, onclick: genericOnClick });
+ {title: "child2", parentId: parent, onclick: genericOnClick});
- let parentToDel = browser.contextMenus.create({ title: "parentToDel" });
+ let parentToDel = browser.contextMenus.create({title: "parentToDel"});
browser.contextMenus.create(
- { title: "child1", parentId: parentToDel, onclick: genericOnClick });
+ {title: "child1", parentId: parentToDel, onclick: genericOnClick});
browser.contextMenus.create(
- { title: "child2", parentId: parentToDel, onclick: genericOnClick });
+ {title: "child2", parentId: parentToDel, onclick: genericOnClick});
browser.contextMenus.remove(parentToDel);
- browser.contextMenus.update(parent, { parentId: child2 }).then(
+ browser.contextMenus.update(parent, {parentId: child2}).then(
() => {
browser.test.notifyFail();
},
@@ -81,7 +81,7 @@ add_task(function* () {
let contentAreaContextMenu = document.getElementById("contentAreaContextMenu");
let popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouseAtCenter("#img1",
- { type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
+ {type: "contextmenu", button: 2}, gBrowser.selectedBrowser);
yield popupShownPromise;
// Check some menu items
@@ -134,7 +134,7 @@ add_task(function* () {
// Bring up context menu again
popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouse(null, 1, 1,
- { type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
+ {type: "contextmenu", button: 2}, gBrowser.selectedBrowser);
yield popupShownPromise;
items = contentAreaContextMenu.getElementsByAttribute("ext-type", "top-level-menu");
@@ -163,7 +163,7 @@ add_task(function* () {
popupShownPromise = BrowserTestUtils.waitForEvent(contentAreaContextMenu, "popupshown");
yield BrowserTestUtils.synthesizeMouseAtCenter("#img1",
- { type: "contextmenu", button: 2 }, gBrowser.selectedBrowser);
+ {type: "contextmenu", button: 2}, gBrowser.selectedBrowser);
yield popupShownPromise;
items = contentAreaContextMenu.getElementsByAttribute("ext-type", "top-level-menu");
diff --git a/browser/components/extensions/test/browser/browser_ext_lastError.js b/browser/components/extensions/test/browser/browser_ext_lastError.js
index 8df84833397..21e5525af3f 100644
--- a/browser/components/extensions/test/browser/browser_ext_lastError.js
+++ b/browser/components/extensions/test/browser/browser_ext_lastError.js
@@ -37,7 +37,7 @@ add_task(function* testLastError() {
SimpleTest.monitorConsole(resolve, [{message: /Invalid extension ID/, forbid: true}]);
});
- yield sendMessage({ checkLastError: api });
+ yield sendMessage({checkLastError: api});
SimpleTest.endMonitorConsole();
yield waitForConsole;
diff --git a/browser/components/extensions/test/browser/browser_ext_pageAction_context.js b/browser/components/extensions/test/browser/browser_ext_pageAction_context.js
index a91186f68f2..6b9b17a9a27 100644
--- a/browser/components/extensions/test/browser/browser_ext_pageAction_context.js
+++ b/browser/components/extensions/test/browser/browser_ext_pageAction_context.js
@@ -11,7 +11,7 @@ function* runTests(options) {
// promise that resolves to an object containing them.
function getDetails() {
return new Promise(resolve => {
- return browser.tabs.query({ active: true, currentWindow: true }, resolve);
+ return browser.tabs.query({active: true, currentWindow: true}, resolve);
}).then(([tab]) => {
let tabId = tab.id;
browser.test.log(`Get details: tab={id: ${tabId}, url: ${JSON.stringify(tab.url)}}`);
@@ -19,8 +19,8 @@ function* runTests(options) {
browser.pageAction.getTitle({tabId}),
browser.pageAction.getPopup({tabId})]);
}).then(details => {
- return Promise.resolve({ title: details[0],
- popup: details[1] });
+ return Promise.resolve({title: details[0],
+ popup: details[1]});
});
}
@@ -59,7 +59,7 @@ function* runTests(options) {
tabs = [];
tests = getTests(tabs);
- browser.tabs.query({ active: true, currentWindow: true }, resultTabs => {
+ browser.tabs.query({active: true, currentWindow: true}, resultTabs => {
tabs[0] = resultTabs[0].id;
nextTest();
@@ -163,18 +163,18 @@ add_task(function* testTabSwitchContext() {
getTests(tabs) {
let details = [
- { "icon": browser.runtime.getURL("default.png"),
- "popup": browser.runtime.getURL("default.html"),
- "title": "Default Title \u263a" },
- { "icon": browser.runtime.getURL("1.png"),
- "popup": browser.runtime.getURL("default.html"),
- "title": "Default Title \u263a" },
- { "icon": browser.runtime.getURL("2.png"),
- "popup": browser.runtime.getURL("2.html"),
- "title": "Title 2" },
- { "icon": browser.runtime.getURL("2.png"),
- "popup": browser.runtime.getURL("2.html"),
- "title": "Default Title \u263a" },
+ {"icon": browser.runtime.getURL("default.png"),
+ "popup": browser.runtime.getURL("default.html"),
+ "title": "Default Title \u263a"},
+ {"icon": browser.runtime.getURL("1.png"),
+ "popup": browser.runtime.getURL("default.html"),
+ "title": "Default Title \u263a"},
+ {"icon": browser.runtime.getURL("2.png"),
+ "popup": browser.runtime.getURL("2.html"),
+ "title": "Title 2"},
+ {"icon": browser.runtime.getURL("2.png"),
+ "popup": browser.runtime.getURL("2.html"),
+ "title": "Default Title \u263a"},
];
let promiseTabLoad = details => {
@@ -201,13 +201,13 @@ add_task(function* testTabSwitchContext() {
},
expect => {
browser.test.log("Change the icon. Expect default properties excluding the icon.");
- browser.pageAction.setIcon({ tabId: tabs[0], path: "1.png" });
+ browser.pageAction.setIcon({tabId: tabs[0], path: "1.png"});
expect(details[1]);
},
expect => {
browser.test.log("Create a new tab. No icon visible.");
- browser.tabs.create({ active: true, url: "about:blank?0" }, tab => {
- tabLoadPromise = promiseTabLoad({ url: "about:blank?0", id: tab.id });
+ browser.tabs.create({active: true, url: "about:blank?0"}, tab => {
+ tabLoadPromise = promiseTabLoad({url: "about:blank?0", id: tab.id});
tabs.push(tab.id);
expect(null);
});
@@ -222,15 +222,15 @@ add_task(function* testTabSwitchContext() {
browser.test.log("Change properties. Expect new properties.");
let tabId = tabs[1];
browser.pageAction.show(tabId);
- browser.pageAction.setIcon({ tabId, path: "2.png" });
- browser.pageAction.setPopup({ tabId, popup: "2.html" });
- browser.pageAction.setTitle({ tabId, title: "Title 2" });
+ browser.pageAction.setIcon({tabId, path: "2.png"});
+ browser.pageAction.setPopup({tabId, popup: "2.html"});
+ browser.pageAction.setTitle({tabId, title: "Title 2"});
expect(details[2]);
},
expect => {
browser.test.log("Clear the title. Expect default title.");
- browser.pageAction.setTitle({ tabId: tabs[1], title: "" });
+ browser.pageAction.setTitle({tabId: tabs[1], title: ""});
expect(details[3]);
},
@@ -239,11 +239,11 @@ add_task(function* testTabSwitchContext() {
// TODO: This listener should not be necessary, but the |tabs.update|
// callback currently fires too early in e10s windows.
- promiseTabLoad({ id: tabs[1], url: "about:blank?1" }).then(() => {
+ promiseTabLoad({id: tabs[1], url: "about:blank?1"}).then(() => {
expect(null);
});
- browser.tabs.update(tabs[1], { url: "about:blank?1" });
+ browser.tabs.update(tabs[1], {url: "about:blank?1"});
},
expect => {
browser.test.log("Show the icon. Expect default properties again.");
@@ -252,14 +252,14 @@ add_task(function* testTabSwitchContext() {
},
expect => {
browser.test.log("Switch back to the first tab. Expect previously set properties.");
- browser.tabs.update(tabs[0], { active: true }, () => {
+ browser.tabs.update(tabs[0], {active: true}, () => {
expect(details[1]);
});
},
expect => {
browser.test.log("Hide the icon on tab 2. Switch back, expect hidden.");
browser.pageAction.hide(tabs[1]);
- browser.tabs.update(tabs[1], { active: true }, () => {
+ browser.tabs.update(tabs[1], {active: true}, () => {
expect(null);
});
},
@@ -293,12 +293,12 @@ add_task(function* testDefaultTitle() {
getTests(tabs) {
let details = [
- { "title": "Foo Extension",
- "popup": "",
- "icon": browser.runtime.getURL("icon.png") },
- { "title": "Foo Title",
- "popup": "",
- "icon": browser.runtime.getURL("icon.png") },
+ {"title": "Foo Extension",
+ "popup": "",
+ "icon": browser.runtime.getURL("icon.png")},
+ {"title": "Foo Title",
+ "popup": "",
+ "icon": browser.runtime.getURL("icon.png")},
];
return [
@@ -313,12 +313,12 @@ add_task(function* testDefaultTitle() {
},
expect => {
browser.test.log("Change the title. Expect new title.");
- browser.pageAction.setTitle({ tabId: tabs[0], title: "Foo Title" });
+ browser.pageAction.setTitle({tabId: tabs[0], title: "Foo Title"});
expect(details[1]);
},
expect => {
browser.test.log("Clear the title. Expect extension title.");
- browser.pageAction.setTitle({ tabId: tabs[0], title: "" });
+ browser.pageAction.setTitle({tabId: tabs[0], title: ""});
expect(details[0]);
},
];
diff --git a/browser/components/extensions/test/browser/browser_ext_pageAction_popup.js b/browser/components/extensions/test/browser/browser_ext_pageAction_popup.js
index 463e3057697..488c96d1dc7 100644
--- a/browser/components/extensions/test/browser/browser_ext_pageAction_popup.js
+++ b/browser/components/extensions/test/browser/browser_ext_pageAction_popup.js
@@ -34,34 +34,34 @@ add_task(function* testPageActionPopup() {
let sendClick;
let tests = [
() => {
- sendClick({ expectEvent: false, expectPopup: "a" });
+ sendClick({expectEvent: false, expectPopup: "a"});
},
() => {
- sendClick({ expectEvent: false, expectPopup: "a" });
+ sendClick({expectEvent: false, expectPopup: "a"});
},
() => {
- browser.pageAction.setPopup({ tabId, popup: "popup-b.html" });
- sendClick({ expectEvent: false, expectPopup: "b" });
+ browser.pageAction.setPopup({tabId, popup: "popup-b.html"});
+ sendClick({expectEvent: false, expectPopup: "b"});
},
() => {
- sendClick({ expectEvent: false, expectPopup: "b" });
+ sendClick({expectEvent: false, expectPopup: "b"});
},
() => {
- browser.pageAction.setPopup({ tabId, popup: "" });
- sendClick({ expectEvent: true, expectPopup: null });
+ browser.pageAction.setPopup({tabId, popup: ""});
+ sendClick({expectEvent: true, expectPopup: null});
},
() => {
- sendClick({ expectEvent: true, expectPopup: null });
+ sendClick({expectEvent: true, expectPopup: null});
},
() => {
- browser.pageAction.setPopup({ tabId, popup: "/popup-a.html" });
- sendClick({ expectEvent: false, expectPopup: "a" });
+ browser.pageAction.setPopup({tabId, popup: "/popup-a.html"});
+ sendClick({expectEvent: false, expectPopup: "a"});
},
];
let expect = {};
- sendClick = ({ expectEvent, expectPopup }) => {
- expect = { event: expectEvent, popup: expectPopup };
+ sendClick = ({expectEvent, expectPopup}) => {
+ expect = {event: expectEvent, popup: expectPopup};
browser.test.sendMessage("send-click");
};
@@ -101,7 +101,7 @@ add_task(function* testPageActionPopup() {
}
});
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
tabId = tabs[0].id;
browser.pageAction.show(tabId);
@@ -165,7 +165,7 @@ add_task(function* testPageActionSecurity() {
let extension = ExtensionTestUtils.loadExtension({
manifest: {
- [api]: { "default_popup": URL },
+ [api]: {"default_popup": URL},
},
});
diff --git a/browser/components/extensions/test/browser/browser_ext_popup_api_injection.js b/browser/components/extensions/test/browser/browser_ext_popup_api_injection.js
index e28c1ccb670..6684cb3213e 100644
--- a/browser/components/extensions/test/browser/browser_ext_popup_api_injection.js
+++ b/browser/components/extensions/test/browser/browser_ext_popup_api_injection.js
@@ -27,15 +27,15 @@ add_task(function* testPageActionPopup() {
background: function() {
let tabId;
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
tabId = tabs[0].id;
browser.pageAction.show(tabId);
browser.test.sendMessage("ready");
});
browser.test.onMessage.addListener(() => {
- browser.browserAction.setPopup({ popup: "/popup-a.html" });
- browser.pageAction.setPopup({ tabId, popup: "popup-b.html" });
+ browser.browserAction.setPopup({popup: "/popup-a.html"});
+ browser.pageAction.setPopup({tabId, popup: "popup-b.html"});
browser.test.sendMessage("ok");
});
diff --git a/browser/components/extensions/test/browser/browser_ext_runtime_setUninstallURL.js b/browser/components/extensions/test/browser/browser_ext_runtime_setUninstallURL.js
index e13a8d06d3c..e723b0de478 100644
--- a/browser/components/extensions/test/browser/browser_ext_runtime_setUninstallURL.js
+++ b/browser/components/extensions/test/browser/browser_ext_runtime_setUninstallURL.js
@@ -1,7 +1,7 @@
"use strict";
-let { AddonManager } = Components.utils.import("resource://gre/modules/AddonManager.jsm", {});
-let { Extension } = Components.utils.import("resource://gre/modules/Extension.jsm", {});
+let {AddonManager} = Components.utils.import("resource://gre/modules/AddonManager.jsm", {});
+let {Extension} = Components.utils.import("resource://gre/modules/Extension.jsm", {});
function install(url) {
return new Promise((resolve, reject) => {
@@ -78,7 +78,7 @@ add_task(function* test_setuninstallurl_badargs() {
add_task(function* test_setuninstall_empty_url() {
function backgroundScript() {
browser.runtime.setUninstallURL("")
- .then(() => browser.tabs.create({ url: "http://example.com/addon_loaded" }));
+ .then(() => browser.tabs.create({url: "http://example.com/addon_loaded"}));
}
let addon = yield makeAndInstallXPI("test_uinstallurl2@tests.mozilla.org",
@@ -95,7 +95,7 @@ add_task(function* test_setuninstall_empty_url() {
add_task(function* test_setuninstallurl() {
function backgroundScript() {
browser.runtime.setUninstallURL("http://example.com/addon_uninstalled")
- .then(() => browser.tabs.create({ url: "http://example.com/addon_loaded" }));
+ .then(() => browser.tabs.create({url: "http://example.com/addon_loaded"}));
}
let addon = yield makeAndInstallXPI("test_uinstallurl@tests.mozilla.org",
diff --git a/browser/components/extensions/test/browser/browser_ext_tab_runtimeConnect.js b/browser/components/extensions/test/browser/browser_ext_tab_runtimeConnect.js
index d145388cb88..a5541a00234 100644
--- a/browser/components/extensions/test/browser/browser_ext_tab_runtimeConnect.js
+++ b/browser/components/extensions/test/browser/browser_ext_tab_runtimeConnect.js
@@ -38,16 +38,16 @@ add_task(function* () {
});
});
- browser.tabs.create({ url: "tab.html" },
+ browser.tabs.create({url: "tab.html"},
(tab) => { tabId = tab.id; });
},
files: {
"tab.js": function() {
- let port = browser.runtime.connect({ name: "tab-connection-name"});
+ let port = browser.runtime.connect({name: "tab-connection-name"});
port.postMessage("tab to background port message");
port.onMessage.addListener((msg) => {
- port.postMessage({ tabReceived: msg });
+ port.postMessage({tabReceived: msg});
});
},
"tab.html": `
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_audio.js b/browser/components/extensions/test/browser/browser_ext_tabs_audio.js
index 664e88d74cf..8b4440f54b4 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_audio.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_audio.js
@@ -49,7 +49,7 @@ add_task(function* () {
let windowId;
let tabIds;
- promiseTabs.query({ lastFocusedWindow: true }).then(tabs => {
+ promiseTabs.query({lastFocusedWindow: true}).then(tabs => {
browser.test.assertEq(tabs.length, 3, "We have three tabs");
for (let tab of tabs) {
@@ -65,10 +65,10 @@ add_task(function* () {
browser.test.log("Test initial queries for muted and audible return no tabs");
return Promise.all([
- promiseTabs.query({ windowId, audible: false }),
- promiseTabs.query({ windowId, audible: true }),
- promiseTabs.query({ windowId, muted: true }),
- promiseTabs.query({ windowId, muted: false }),
+ promiseTabs.query({windowId, audible: false}),
+ promiseTabs.query({windowId, audible: true}),
+ promiseTabs.query({windowId, muted: true}),
+ promiseTabs.query({windowId, muted: false}),
]);
}).then(([silent, audible, muted, nonMuted]) => {
browser.test.assertEq(3, silent.length, "Three silent tabs");
@@ -95,10 +95,10 @@ add_task(function* () {
browser.test.log("Re-check queries. Expect one audible and one muted tab");
return Promise.all([
- promiseTabs.query({ windowId, audible: false }),
- promiseTabs.query({ windowId, audible: true }),
- promiseTabs.query({ windowId, muted: true }),
- promiseTabs.query({ windowId, muted: false }),
+ promiseTabs.query({windowId, audible: false}),
+ promiseTabs.query({windowId, audible: true}),
+ promiseTabs.query({windowId, muted: true}),
+ promiseTabs.query({windowId, muted: false}),
]);
}).then(([silent, audible, muted, nonMuted]) => {
browser.test.assertEq(2, silent.length, "Two silent tabs");
@@ -116,8 +116,8 @@ add_task(function* () {
return Promise.all([
promiseUpdated(tabIds[0], "mutedInfo"),
promiseUpdated(tabIds[1], "mutedInfo"),
- promiseTabs.update(tabIds[0], { muted: false }),
- promiseTabs.update(tabIds[1], { muted: true }),
+ promiseTabs.update(tabIds[0], {muted: false}),
+ promiseTabs.update(tabIds[1], {muted: true}),
]);
}).then(([unmuted, muted]) => {
for (let obj of [unmuted.changeInfo, unmuted.tab]) {
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_captureVisibleTab.js b/browser/components/extensions/test/browser/browser_ext_tabs_captureVisibleTab.js
index 4f62b77a8c0..91bd733e17c 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_captureVisibleTab.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_captureVisibleTab.js
@@ -39,11 +39,11 @@ function* runTest(options) {
browser.test.log(`Test color ${options.color} at fullZoom=${options.fullZoom}`);
- promiseTabs.query({ currentWindow: true, active: true }).then(([tab]) => {
+ promiseTabs.query({currentWindow: true, active: true}).then(([tab]) => {
return Promise.all([
- promiseTabs.captureVisibleTab(tab.windowId, { format: "jpeg", quality: 95 }),
- promiseTabs.captureVisibleTab(tab.windowId, { format: "png", quality: 95 }),
- promiseTabs.captureVisibleTab(tab.windowId, { quality: 95 }),
+ promiseTabs.captureVisibleTab(tab.windowId, {format: "jpeg", quality: 95}),
+ promiseTabs.captureVisibleTab(tab.windowId, {format: "png", quality: 95}),
+ promiseTabs.captureVisibleTab(tab.windowId, {quality: 95}),
promiseTabs.captureVisibleTab(tab.windowId),
]).then(([jpeg, png, ...pngs]) => {
browser.test.assertTrue(pngs.every(url => url == png), "All PNGs are identical");
@@ -60,7 +60,7 @@ function* runTest(options) {
}).then(([jpeg, png]) => {
let tabDims = `${tab.width}\u00d7${tab.height}`;
- let images = { jpeg, png };
+ let images = {jpeg, png};
for (let format of Object.keys(images)) {
let img = images[format];
@@ -78,17 +78,17 @@ function* runTest(options) {
// Check the colors of the first and last pixels of the image, to make
// sure we capture the entire frame, and scale it correctly.
let coords = [
- { x: 0, y: 0,
- color: options.color },
- { x: img.width - 1,
- y: img.height - 1,
- color: options.color },
- { x: img.width / 2 | 0,
- y: img.height / 2 | 0,
- color: options.neutral },
+ {x: 0, y: 0,
+ color: options.color},
+ {x: img.width - 1,
+ y: img.height - 1,
+ color: options.color},
+ {x: img.width / 2 | 0,
+ y: img.height / 2 | 0,
+ color: options.neutral},
];
- for (let { x, y, color } of coords) {
+ for (let {x, y, color} of coords) {
let imageData = ctx.getImageData(x, y, 1, 1).data;
if (format == "png") {
@@ -133,13 +133,13 @@ function* runTest(options) {
}
add_task(function* testCaptureVisibleTab() {
- yield runTest({ color: [0, 0, 0], fullZoom: 1 });
+ yield runTest({color: [0, 0, 0], fullZoom: 1});
- yield runTest({ color: [0, 0, 0], fullZoom: 2 });
+ yield runTest({color: [0, 0, 0], fullZoom: 2});
- yield runTest({ color: [0, 0, 0], fullZoom: 0.5 });
+ yield runTest({color: [0, 0, 0], fullZoom: 0.5});
- yield runTest({ color: [255, 255, 255], fullZoom: 1 });
+ yield runTest({color: [255, 255, 255], fullZoom: 1});
});
add_task(function* testCaptureVisibleTabPermissions() {
@@ -149,7 +149,7 @@ add_task(function* testCaptureVisibleTabPermissions() {
},
background: function(x) {
- browser.tabs.query({ currentWindow: true, active: true }, tab => {
+ browser.tabs.query({currentWindow: true, active: true}, tab => {
browser.tabs.captureVisibleTab(tab.windowId).then(
() => {
browser.test.notifyFail("captureVisibleTabPermissions");
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_create.js b/browser/components/extensions/test/browser/browser_ext_tabs_create.js
index dfb6897c123..5b7c352c86b 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_create.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_create.js
@@ -19,7 +19,7 @@ add_task(function* () {
manifest: {
"permissions": ["tabs"],
- "background": { "page": "bg/background.html" },
+ "background": {"page": "bg/background.html"},
},
files: {
@@ -45,48 +45,48 @@ add_task(function* () {
let tests = [
{
- create: { url: "http://example.com/" },
- result: { url: "http://example.com/" },
+ create: {url: "http://example.com/"},
+ result: {url: "http://example.com/"},
},
{
- create: { url: "blank.html" },
- result: { url: browser.runtime.getURL("bg/blank.html") },
+ create: {url: "blank.html"},
+ result: {url: browser.runtime.getURL("bg/blank.html")},
},
{
create: {},
- result: { url: "about:newtab" },
+ result: {url: "about:newtab"},
},
{
- create: { active: false },
- result: { active: false },
+ create: {active: false},
+ result: {active: false},
},
{
- create: { active: true },
- result: { active: true },
+ create: {active: true},
+ result: {active: true},
},
{
- create: { pinned: true },
- result: { pinned: true, index: 0 },
+ create: {pinned: true},
+ result: {pinned: true, index: 0},
},
{
- create: { pinned: true, active: true },
- result: { pinned: true, active: true, index: 0 },
+ create: {pinned: true, active: true},
+ result: {pinned: true, active: true, index: 0},
},
{
- create: { pinned: true, active: false },
- result: { pinned: true, active: false, index: 0 },
+ create: {pinned: true, active: false},
+ result: {pinned: true, active: false, index: 0},
},
{
- create: { index: 1 },
- result: { index: 1 },
+ create: {index: 1},
+ result: {index: 1},
},
{
- create: { index: 1, active: false },
- result: { index: 1, active: false },
+ create: {index: 1, active: false},
+ result: {index: 1, active: false},
},
{
- create: { windowId: activeWindow },
- result: { windowId: activeWindow },
+ create: {windowId: activeWindow},
+ result: {windowId: activeWindow},
},
];
@@ -141,7 +141,7 @@ add_task(function* () {
return browser.tabs.remove(tabId);
}).then(() => {
- return browser.tabs.update(activeTab, { active: true });
+ return browser.tabs.update(activeTab, {active: true});
}).then(() => {
nextTest();
});
@@ -150,7 +150,7 @@ add_task(function* () {
nextTest();
}
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
activeTab = tabs[0].id;
activeWindow = tabs[0].windowId;
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
index 45ff816283e..e07622d54d1 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_bad.js
@@ -14,7 +14,7 @@ function* testHasNoPermission(params) {
browser.test.onMessage.addListener(msg => {
browser.test.assertEq(msg, "execute-script");
- browser.tabs.query({ currentWindow: true }, tabs => {
+ browser.tabs.query({currentWindow: true}, tabs => {
browser.tabs.executeScript({
file: "script.js",
});
@@ -70,12 +70,12 @@ add_task(function* testBadPermissions() {
info("Test no special permissions");
yield testHasNoPermission({
- manifest: { "permissions": ["http://example.com/"] },
+ manifest: {"permissions": ["http://example.com/"]},
});
info("Test tabs permissions");
yield testHasNoPermission({
- manifest: { "permissions": ["http://example.com/", "tabs"] },
+ manifest: {"permissions": ["http://example.com/", "tabs"]},
});
info("Test active tab, browser action, no click");
@@ -94,7 +94,7 @@ add_task(function* testBadPermissions() {
},
contentSetup() {
return new Promise(resolve => {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
resolve();
});
@@ -108,7 +108,7 @@ add_task(function* testBadPermissions() {
add_task(function* testBadURL() {
function background() {
- browser.tabs.query({ currentWindow: true }, tabs => {
+ browser.tabs.query({currentWindow: true}, tabs => {
let promises = [
new Promise(resolve => {
browser.tabs.executeScript({
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
index 4f30172cf4f..78ea11ed531 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_executeScript_good.js
@@ -61,17 +61,17 @@ add_task(function* testGoodPermissions() {
info("Test explicit host permission");
yield testHasPermission({
- manifest: { "permissions": ["http://mochi.test/"] },
+ manifest: {"permissions": ["http://mochi.test/"]},
});
info("Test explicit host subdomain permission");
yield testHasPermission({
- manifest: { "permissions": ["http://*.mochi.test/"] },
+ manifest: {"permissions": ["http://*.mochi.test/"]},
});
info("Test explicit permission");
yield testHasPermission({
- manifest: { "permissions": [""] },
+ manifest: {"permissions": [""]},
});
info("Test activeTab permission with a browser action click");
@@ -98,7 +98,7 @@ add_task(function* testGoodPermissions() {
},
contentSetup() {
return new Promise(resolve => {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
resolve();
});
@@ -112,7 +112,7 @@ add_task(function* testGoodPermissions() {
yield testHasPermission({
manifest: {
"permissions": ["activeTab"],
- "browser_action": { "default_popup": "_blank.html" },
+ "browser_action": {"default_popup": "_blank.html"},
},
setup: clickBrowserAction,
tearDown: closeBrowserAction,
@@ -122,11 +122,11 @@ add_task(function* testGoodPermissions() {
yield testHasPermission({
manifest: {
"permissions": ["activeTab"],
- "page_action": { "default_popup": "_blank.html" },
+ "page_action": {"default_popup": "_blank.html"},
},
contentSetup() {
return new Promise(resolve => {
- browser.tabs.query({ active: true, currentWindow: true }, tabs => {
+ browser.tabs.query({active: true, currentWindow: true}, tabs => {
browser.pageAction.show(tabs[0].id);
resolve();
});
@@ -142,7 +142,7 @@ add_task(function* testGoodPermissions() {
"permissions": ["activeTab", "contextMenus"],
},
contentSetup() {
- browser.contextMenus.create({ title: "activeTab", contexts: ["all"] });
+ browser.contextMenus.create({title: "activeTab", contexts: ["all"]});
return Promise.resolve();
},
setup: function* (extension) {
@@ -150,7 +150,7 @@ add_task(function* testGoodPermissions() {
let awaitPopupShown = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
let awaitPopupHidden = BrowserTestUtils.waitForEvent(contextMenu, "popuphidden");
- yield BrowserTestUtils.synthesizeMouseAtCenter("a[href]", { type: "contextmenu", button: 2 },
+ yield BrowserTestUtils.synthesizeMouseAtCenter("a[href]", {type: "contextmenu", button: 2},
gBrowser.selectedBrowser);
yield awaitPopupShown;
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js b/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
index 6894ccd834e..6184ada69dd 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_getCurrent.js
@@ -7,7 +7,7 @@ add_task(function* () {
manifest: {
"permissions": ["tabs"],
- "browser_action": { "default_popup": "popup.html" },
+ "browser_action": {"default_popup": "popup.html"},
},
files: {
@@ -18,7 +18,7 @@ add_task(function* () {
browser.test.assertEq(currentTab.url, url, "getCurrent in non-active background tab");
// Activate the tab.
- browser.tabs.onActivated.addListener(function listener({ tabId }) {
+ browser.tabs.onActivated.addListener(function listener({tabId}) {
if (tabId == currentTab.id) {
browser.tabs.onActivated.removeListener(listener);
@@ -31,7 +31,7 @@ add_task(function* () {
});
}
});
- browser.tabs.update(currentTab.id, { active: true });
+ browser.tabs.update(currentTab.id, {active: true});
});
},
@@ -52,7 +52,7 @@ add_task(function* () {
browser.test.sendMessage("background-finished");
});
- browser.tabs.create({ url: "tab.html", active: false });
+ browser.tabs.create({url: "tab.html", active: false});
},
});
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_insertCSS.js b/browser/components/extensions/test/browser/browser_ext_tabs_insertCSS.js
index 5ad47de7356..5fd52f74368 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_insertCSS.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_insertCSS.js
@@ -62,7 +62,7 @@ add_task(function* testExecuteScript() {
return;
}
- let { promise, background, foreground } = promises.shift();
+ let {promise, background, foreground} = promises.shift();
new Promise(promise).then(() => {
browser.tabs.executeScript({
code: `(${checkCSS})()`,
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_move.js b/browser/components/extensions/test/browser/browser_ext_tabs_move.js
index 8b9f34c905b..dde5fdc465f 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_move.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_move.js
@@ -20,7 +20,7 @@ add_task(function* () {
let tab = tabs[0];
browser.tabs.move(tab.id, {index: 0});
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
browser.test.assertEq(tabs[0].url, tab.url, "should be first tab");
browser.test.notifyPass("tabs.move.single");
@@ -40,12 +40,12 @@ add_task(function* () {
background: function() {
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
tabs.sort(function(a, b) { return a.url > b.url; });
browser.tabs.move(tabs.map(tab => tab.id), {index: 0});
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
browser.test.assertEq(tabs[0].url, "about:blank", "should be first tab");
browser.test.assertEq(tabs[1].url, "about:config", "should be second tab");
@@ -67,13 +67,13 @@ add_task(function* () {
background: function() {
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
let tab = tabs[0];
// Assuming that tab.id of 12345 does not exist.
browser.tabs.move([12345, tab.id], {index: 0});
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
browser.test.assertEq(tabs[0].url, tab.url, "should be first tab");
browser.test.notifyPass("tabs.move.invalid");
@@ -93,12 +93,12 @@ add_task(function* () {
background: function() {
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
let tab = tabs[0];
browser.tabs.move(tab.id, {index: -1});
browser.tabs.query(
- { lastFocusedWindow: true },
+ {lastFocusedWindow: true},
tabs => {
browser.test.assertEq(tabs[2].url, tab.url, "should be last tab");
browser.test.notifyPass("tabs.move.last");
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_move_window.js b/browser/components/extensions/test/browser/browser_ext_tabs_move_window.js
index 3f74a712993..f42fed85528 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_move_window.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_move_window.js
@@ -21,7 +21,7 @@ add_task(function* () {
browser.tabs.move(source.id, {windowId: destination.windowId, index: 0});
browser.tabs.query(
- { url: "" },
+ {url: ""},
tabs => {
browser.test.assertEq(tabs[0].url, "http://example.com/");
browser.test.assertEq(tabs[0].windowId, destination.windowId);
@@ -54,14 +54,14 @@ add_task(function* () {
background: function() {
browser.tabs.query(
- { url: "" },
+ {url: ""},
tabs => {
let destination = tabs[0];
let source = tabs[1]; // remember, pinning moves it to the left.
browser.tabs.move(source.id, {windowId: destination.windowId, index: 0});
browser.tabs.query(
- { url: "" },
+ {url: ""},
tabs => {
browser.test.assertEq(true, tabs[0].pinned);
browser.test.notifyPass("tabs.move.pin");
@@ -94,13 +94,13 @@ add_task(function* () {
background: function() {
browser.tabs.query(
- { url: "" },
+ {url: ""},
tabs => {
let move1 = tabs[1];
let move3 = tabs[3];
browser.tabs.move([move1.id, move3.id], {index: 0});
browser.tabs.query(
- { url: "" },
+ {url: ""},
tabs => {
browser.test.assertEq(tabs[0].url, move1.url);
browser.test.assertEq(tabs[2].url, move3.url);
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
index 94a34707db3..13a5a7ddc43 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_onUpdated.js
@@ -23,9 +23,9 @@ add_task(function* () {
let pageURL = "http://mochi.test:8888/browser/browser/components/extensions/test/browser/context_tabs_onUpdated_page.html";
let expectedSequence = [
- { status: "loading" },
- { status: "loading", url: pageURL },
- { status: "complete" },
+ {status: "loading"},
+ {status: "loading", url: pageURL},
+ {status: "complete"},
];
let collectedSequence = [];
@@ -60,7 +60,7 @@ add_task(function* () {
browser.test.notifyPass("tabs.onUpdated");
});
- browser.tabs.create({ url: pageURL });
+ browser.tabs.create({url: pageURL});
},
files: {
"content-script.js": `
diff --git a/browser/components/extensions/test/browser/browser_ext_tabs_sendMessage.js b/browser/components/extensions/test/browser/browser_ext_tabs_sendMessage.js
index fc961bb81d9..0c0215f3f10 100644
--- a/browser/components/extensions/test/browser/browser_ext_tabs_sendMessage.js
+++ b/browser/components/extensions/test/browser/browser_ext_tabs_sendMessage.js
@@ -9,7 +9,7 @@ add_task(function* tabsSendMessageNoExceptionOnNonExistentTab() {
},
background: function() {
- browser.tabs.create({ url: "about:robots"}, tab => {
+ browser.tabs.create({url: "about:robots"}, tab => {
let exception;
try {
browser.tabs.sendMessage(tab.id, "message");
diff --git a/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js b/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
index bfa16e9a612..b2bd19bae99 100644
--- a/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
+++ b/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
@@ -8,7 +8,7 @@ add_task(function* testWebNavigationGetNonExistentTab() {
let results = [
// There is no "tabId = 0" because the id assigned by TabManager (defined in ext-utils.js)
// starts from 1.
- browser.webNavigation.getAllFrames({ tabId: 0 }).then(() => {
+ browser.webNavigation.getAllFrames({tabId: 0}).then(() => {
browser.test.fail("getAllFrames Promise should be rejected on error");
}, (error) => {
browser.test.assertEq("No tab found with tabId: 0", error.message,
@@ -16,7 +16,7 @@ add_task(function* testWebNavigationGetNonExistentTab() {
}),
// There is no "tabId = 0" because the id assigned by TabManager (defined in ext-utils.js)
// starts from 1, processId is currently marked as optional and it is ignored.
- browser.webNavigation.getFrame({ tabId: 0, frameId: 15, processId: 20 }).then(() => {
+ browser.webNavigation.getFrame({tabId: 0, frameId: 15, processId: 20}).then(() => {
browser.test.fail("getFrame Promise should be rejected on error");
}, (error) => {
browser.test.assertEq("No tab found with tabId: 0", error.message,
@@ -57,11 +57,11 @@ add_task(function* testWebNavigationFrames() {
return;
}
- browser.webNavigation.getAllFrames({ tabId }).then((getAllFramesDetails) => {
+ browser.webNavigation.getAllFrames({tabId}).then((getAllFramesDetails) => {
let getFramePromises = getAllFramesDetails.map((frameDetail) => {
- let { frameId } = frameDetail;
+ let {frameId} = frameDetail;
// processId is currently marked as optional and it is ignored.
- return browser.webNavigation.getFrame({ tabId, frameId, processId: 0 });
+ return browser.webNavigation.getFrame({tabId, frameId, processId: 0});
});
Promise.all(getFramePromises).then((getFrameResults) => {
@@ -81,7 +81,7 @@ add_task(function* testWebNavigationFrames() {
}
// Check that getFrame Promise is rejected with the expected error message on nonexistent frameId.
- browser.webNavigation.getFrame({ tabId, frameId: nonExistentFrameId, processId: 20 }).then(() => {
+ browser.webNavigation.getFrame({tabId, frameId: nonExistentFrameId, processId: 20}).then(() => {
browser.test.fail("getFrame promise should be rejected for an unexistent frameId");
}, (error) => {
browser.test.assertEq(`No frame found with frameId: ${nonExistentFrameId}`, error.message,
@@ -93,7 +93,7 @@ add_task(function* testWebNavigationFrames() {
});
});
- browser.tabs.create({ url: "tab.html" }, (tab) => {
+ browser.tabs.create({url: "tab.html"}, (tab) => {
tabId = tab.id;
});
} + ")();",
diff --git a/browser/components/search/test/browser.ini b/browser/components/search/test/browser.ini
index 5d5745a2bda..39d8d1953ba 100644
--- a/browser/components/search/test/browser.ini
+++ b/browser/components/search/test/browser.ini
@@ -21,6 +21,8 @@ support-files =
[browser_bing.js]
[browser_bing_behavior.js]
[browser_contextmenu.js]
+[browser_contextSearchTabPosition.js]
+skip-if = os == "mac" # bug 967013
[browser_eBay.js]
[browser_eBay_behavior.js]
[browser_google.js]
diff --git a/browser/base/content/test/general/browser_contextSearchTabPosition.js b/browser/components/search/test/browser_contextSearchTabPosition.js
similarity index 85%
rename from browser/base/content/test/general/browser_contextSearchTabPosition.js
rename to browser/components/search/test/browser_contextSearchTabPosition.js
index 76646789000..b928a36979b 100644
--- a/browser/base/content/test/general/browser_contextSearchTabPosition.js
+++ b/browser/components/search/test/browser_contextSearchTabPosition.js
@@ -3,12 +3,10 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
add_task(function* test() {
-
- // Will need to be changed if Google isn't the default search engine.
- // Note: geoSpecificDefaults are disabled for mochitests, so this is the
- // non-US en-US default.
- let histogramKey = "google.contextmenu";
+ let engine = yield promiseNewEngine("testEngine.xml");
+ let histogramKey = "other-" + engine.name + ".contextmenu";
let numSearchesBefore = 0;
+
try {
let hs = Services.telemetry.getKeyedHistogramById("SEARCH_COUNTS").snapshot();
if (histogramKey in hs) {
@@ -19,7 +17,7 @@ add_task(function* test() {
}
let tabs = [];
- let tabsLoadedDeferred = Promise.defer();
+ let tabsLoadedDeferred = new Deferred();
function tabAdded(event) {
let tab = event.target;
@@ -54,3 +52,10 @@ add_task(function* test() {
Assert.equal(hs[histogramKey].sum, numSearchesBefore + 2,
"The histogram must contain the correct search count");
});
+
+function Deferred() {
+ this.promise = new Promise((resolve, reject) => {
+ this.resolve = resolve;
+ this.reject = reject;
+ });
+}
diff --git a/browser/components/sessionstore/SessionSaver.jsm b/browser/components/sessionstore/SessionSaver.jsm
index 98c2ca12ad2..02149c966ff 100644
--- a/browser/components/sessionstore/SessionSaver.jsm
+++ b/browser/components/sessionstore/SessionSaver.jsm
@@ -21,6 +21,8 @@ XPCOMUtils.defineLazyModuleGetter(this, "console",
"resource://gre/modules/Console.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PrivacyFilter",
"resource:///modules/sessionstore/PrivacyFilter.jsm");
+XPCOMUtils.defineLazyModuleGetter(this, "RunState",
+ "resource:///modules/sessionstore/RunState.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionStore",
"resource:///modules/sessionstore/SessionStore.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SessionFile",
@@ -209,6 +211,19 @@ var SessionSaverInternal = {
}
}
+ // If this is the final write on a clean shutdown, and the user changed
+ // their cookie preferences to "Keep until I close Firefox", then we
+ // should remove all cookies. Check "resume_session_once" so we keep
+ // cookies when restarting due to a Firefox update.
+ if (RunState.isClosing &&
+ Services.prefs.getIntPref("network.cookie.lifetimePolicy") ==
+ Services.cookies.ACCEPT_SESSION &&
+ !Services.prefs.getBoolPref("browser.sessionstore.resume_session_once")) {
+ for (let window of state.windows) {
+ delete window.cookies;
+ }
+ }
+
stopWatchFinish("COLLECT_DATA_MS", "COLLECT_DATA_LONGEST_OP_MS");
return this._writeState(state);
},
diff --git a/browser/components/sessionstore/SessionStore.jsm b/browser/components/sessionstore/SessionStore.jsm
index 2d619afefe8..5abdfc9b0dc 100644
--- a/browser/components/sessionstore/SessionStore.jsm
+++ b/browser/components/sessionstore/SessionStore.jsm
@@ -1236,9 +1236,7 @@ var SessionStoreInternal = {
var tabbrowser = aWindow.gBrowser;
- // The tabbrowser binding will go away once the window is closed,
- // so we'll hold a reference to the browsers in the closure here.
- let browsers = tabbrowser.browsers;
+ let browsers = Array.from(tabbrowser.browsers);
TAB_EVENTS.forEach(function(aEvent) {
tabbrowser.tabContainer.removeEventListener(aEvent, this, true);
@@ -1320,7 +1318,6 @@ var SessionStoreInternal = {
// access any DOM elements from aWindow within this callback unless
// you're holding on to them in the closure.
- // We can still access tabbrowser.browsers, thankfully.
for (let browser of browsers) {
if (this._closedWindowTabs.has(browser.permanentKey)) {
let tabData = this._closedWindowTabs.get(browser.permanentKey);
diff --git a/browser/components/test/browser.ini b/browser/components/test/browser.ini
index a6c154438a8..5e7a7ccc0eb 100644
--- a/browser/components/test/browser.ini
+++ b/browser/components/test/browser.ini
@@ -1,4 +1,3 @@
[DEFAULT]
[browser_bug538331.js]
-skip-if = e10s # Bug ?????? - child process crash, but only when run as part of the suite (ie, probably not actually this tests fault!?)
diff --git a/browser/components/test/browser_bug538331.js b/browser/components/test/browser_bug538331.js
index d8abb25045b..fce3790a055 100644
--- a/browser/components/test/browser_bug538331.js
+++ b/browser/components/test/browser_bug538331.js
@@ -361,11 +361,8 @@ function testShowNotification()
if (i == (BG_NOTIFY_TESTS.length - 1)) {
// Wait for any windows caught by the windowcatcher to close
gWindowCatcher.finish(function () {
+ BrowserTestUtils.waitForNewTab(gBrowser).then(testNotificationURL);
button.click();
- gBrowser.selectedBrowser.addEventListener("load", function () {
- gBrowser.selectedBrowser.removeEventListener("load", arguments.callee, true);
- testNotificationURL();
- }, true);
});
} else {
notifyBox.removeAllNotifications(true);
@@ -389,7 +386,7 @@ function testNotificationURL()
{
ok(true, "Test testNotificationURL: clicking the notification button " +
"opened the url specified by the update");
- let href = gBrowser.selectedBrowser.contentWindow.location.href;
+ let href = gBrowser.currentURI.spec;
let expectedURL = BG_NOTIFY_TESTS[BG_NOTIFY_TESTS.length - 1].notificationURL;
is(href, expectedURL, "The url opened from the notification should be the " +
"url provided by the update");
diff --git a/build.gradle b/build.gradle
index 94d92b8f55b..68922a84930 100644
--- a/build.gradle
+++ b/build.gradle
@@ -9,7 +9,9 @@ allprojects {
}
repositories {
- jcenter()
+ maven {
+ url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
+ }
}
}
@@ -17,8 +19,9 @@ buildDir "${topobjdir}/gradle/build"
buildscript {
repositories {
- jcenter()
-
+ maven {
+ url gradle.mozconfig.substs.GRADLE_MAVEN_REPOSITORY
+ }
}
dependencies {
diff --git a/configure.in b/configure.in
index 096e538d56f..bef32fce9fa 100644
--- a/configure.in
+++ b/configure.in
@@ -5252,12 +5252,56 @@ if test -n "$MOZ_OMX_PLUGIN"; then
fi
dnl ========================================================
-dnl = Enable building mobile/android with Gradle
+dnl Gradle support
+dnl
+dnl If --with-gradle is specified, build mobile/android with Gradle.
+dnl
+dnl If no Gradle binary is specified, use the in tree Gradle wrapper.
+dnl The wrapper downloads and installs Gradle, which is good for local
+dnl developers but not good in automation.
dnl ========================================================
-MOZ_ARG_ENABLE_BOOL(gradle-mobile-android-builds,
-[ --enable-gradle-mobile-android-builds Enable building mobile/android with Gradle],
- MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1,
- MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=)
+
+GRADLE=
+MOZ_ARG_WITH_STRING(gradle,
+[ --with-gradle=/path/to/bin/gradle
+ Enable building mobile/android with Gradle (argument: location of binary or wrapper (gradle/gradlew))],
+ if test "$withval" = "no" ; then
+ dnl --without-gradle => use the wrapper in |mach gradle|, don't build
+ dnl with Gradle by default.
+ GRADLE=$srcdir/gradlew
+ MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
+ elif test "$withval" = "yes" ; then
+ dnl --with-gradle => use the wrapper in |mach gradle|, build with
+ dnl Gradle by default.
+ GRADLE=$srcdir/gradlew
+ MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1
+ else
+ dnl --with-gradle=/path/to/gradle => use the given binary in |mach
+ dnl gradle|, build with Gradle by default.
+ GRADLE=$withval
+ MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=1
+ fi
+ ,
+ dnl No --with{out}-gradle => use the wrapper in |mach gradle|, don't build
+ dnl with Gradle by default.
+ GRADLE=$srcdir/gradlew
+ MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE=
+ )
+
+if test "$OS_TARGET" = Android -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk" ; then
+ if test -z "$GRADLE" -o ! -x "$GRADLE" ; then
+ AC_MSG_ERROR([The program gradlew/gradle was not found. Use --with-gradle=/path/to/bin/gradle}])
+ fi
+fi
+AC_SUBST(GRADLE)
+
+dnl Path to Maven repository containing Gradle dependencies. Automation will
+dnl set this to file:///path/to/local via the mozconfig. Local developer
+dnl default is jcenter.
+if test -z "$GRADLE_MAVEN_REPOSITORY" ; then
+ GRADLE_MAVEN_REPOSITORY=https://jcenter.bintray.com/
+fi
+AC_SUBST(GRADLE_MAVEN_REPOSITORY)
if test -n "$MOZ_BUILD_MOBILE_ANDROID_WITH_GRADLE"; then
if test "$OS_TARGET" = "Android" -a x"$MOZ_WIDGET_TOOLKIT" != x"gonk"; then
diff --git a/devtools/bootstrap.js b/devtools/bootstrap.js
index d9b1f423355..7f5e5bbc516 100644
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -79,11 +79,77 @@ function reload(event) {
// Ask the loader to update itself and reopen the toolbox if needed
const {devtools} = Cu.import("resource://devtools/shared/Loader.jsm", {});
- devtools.reload(reloadToolbox);
+ devtools.reload();
- // Also tells gDevTools to reload its dependencies
- const {gDevTools} = devtools.require("devtools/client/framework/devtools");
- gDevTools.reload();
+ // Go over all top level windows to reload all devtools related things
+ let windowsEnum = Services.wm.getEnumerator(null);
+ while (windowsEnum.hasMoreElements()) {
+ let window = windowsEnum.getNext();
+ let windowtype = window.document.documentElement.getAttribute("windowtype");
+ if (windowtype == "navigator:browser" && window.gBrowser) {
+ // Enumerate tabs on firefox windows
+ for (let tab of window.gBrowser.tabs) {
+ let browser = tab.linkedBrowser;
+ let location = browser.documentURI.spec;
+ let mm = browser.messageManager;
+ // To reload JSON-View tabs and any devtools document
+ if (location.startsWith("about:debugging") ||
+ location.startsWith("chrome://devtools/")) {
+ browser.reload();
+ }
+ // We have to use a frame script to query "baseURI"
+ mm.loadFrameScript("data:text/javascript,new " + function () {
+ let isJSONView = content.document.baseURI.startsWith("resource://devtools/");
+ if (isJSONView) {
+ content.location.reload();
+ }
+ }, false);
+ }
+
+ // Manually reload gcli if it has been used
+ // Bug 1248348: Inject the developer toolbar dynamically within browser/
+ // so that we can easily remove/reinject it
+ const desc = Object.getOwnPropertyDescriptor(window, "DeveloperToolbar");
+ if (desc && !desc.get) {
+ let wasVisible = window.DeveloperToolbar.visible;
+ window.DeveloperToolbar.hide()
+ .then(() => {
+ window.DeveloperToolbar.destroy();
+
+ let { DeveloperToolbar } = devtools.require("devtools/client/shared/developer-toolbar");
+ window.DeveloperToolbar = new DeveloperToolbar(window, window.document.getElementById("developer-toolbar"));
+ if (wasVisible) {
+ window.DeveloperToolbar.show();
+ }
+ });
+ }
+ } else if (windowtype === "devtools:webide") {
+ window.location.reload();
+ } else if (windowtype === "devtools:webconsole") {
+ // Browser console document can't just be reloaded.
+ // HUDService is going to close it on unload.
+ // Instead we have to manually toggle it.
+ let HUDService = devtools.require("devtools/client/webconsole/hudservice");
+ HUDService.toggleBrowserConsole()
+ .then(() => {
+ HUDService.toggleBrowserConsole();
+ });
+ }
+ }
+
+ if (reloadToolbox) {
+ // Reopen the toolbox automatically if we are reloading from toolbox shortcut
+ // and are on a browser window.
+ // Wait for a second before opening the toolbox to avoid races
+ // between the old and the new one.
+ let {setTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
+ setTimeout(() => {
+ let { TargetFactory } = devtools.require("devtools/client/framework/target");
+ let { gDevTools } = devtools.require("devtools/client/framework/devtools");
+ let target = TargetFactory.forTab(top.gBrowser.selectedTab);
+ gDevTools.showToolbox(target);
+ }, 1000);
+ }
}
let listener;
diff --git a/devtools/client/animationinspector/animation-inspector.xhtml b/devtools/client/animationinspector/animation-inspector.xhtml
index 298147be332..3c721fc8d87 100644
--- a/devtools/client/animationinspector/animation-inspector.xhtml
+++ b/devtools/client/animationinspector/animation-inspector.xhtml
@@ -10,7 +10,6 @@
&animationInspectorTitle;
-
diff --git a/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js b/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
index 51d91043f6c..49d440e0be0 100644
--- a/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
+++ b/devtools/client/animationinspector/test/browser_animation_timeline_pause_button.js
@@ -65,8 +65,10 @@ add_task(function*() {
info("Select a finite animation, reload the page and wait for the " +
"animation to complete");
yield selectNode(".negative-delay", inspector);
+
+ let onScrubberStopped = waitForScrubberStopped(timeline);
yield reloadTab(inspector);
- yield waitForScrubberStopped(timeline);
+ yield onScrubberStopped;
ok(btn.classList.contains("paused"),
"The button is in paused state once finite animations are done");
diff --git a/devtools/client/canvasdebugger/canvasdebugger.xul b/devtools/client/canvasdebugger/canvasdebugger.xul
index 504200be310..33765d351de 100644
--- a/devtools/client/canvasdebugger/canvasdebugger.xul
+++ b/devtools/client/canvasdebugger/canvasdebugger.xul
@@ -4,7 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
-
-
{
+ let options = {"set": [
+ ["devtools.debugger.prompt-connection", false],
+ ["devtools.debugger.remote-enabled", true],
+ ["devtools.chrome.enabled", true],
+ // Test-only pref to allow passing `testScript` argument to the browser
+ // toolbox
+ ["devtools.browser-toolbox.allow-unsafe-script", true],
+ // On debug test slave, it takes more than the default time (20s)
+ // to get a initialized console
+ ["devtools.debugger.remote-timeout", 120000]
+ ]};
+ SpecialPowers.pushPrefEnv(options, done);
+ });
+
+ // Wait for a notification sent by a script evaluated in the webconsole
+ // of the browser toolbox.
+ let onCustomMessage = new Promise(done => {
+ Services.obs.addObserver(function listener() {
+ Services.obs.removeObserver(listener, "browser-toolbox-console-works");
+ done();
+ }, "browser-toolbox-console-works", false);
+ });
+
+ let { BrowserToolboxProcess } = Cu.import("resource://devtools/client/framework/ToolboxProcess.jsm", {});
+ let closePromise;
+ yield new Promise(onRun => {
+ let options = {
+ // Pass a test script evaluated in the browser toolbox window
+ // living in a distinct process. It has access to `toolbox` object
+ // in its global scope.
+ testScript: "new " + function () {
+ toolbox.selectTool("webconsole")
+ .then(() => toolbox.getPanel("webconsole"))
+ .then(() => {
+ let { jsterm } = toolbox.getPanel("webconsole").hud;
+ let js = "Services.obs.notifyObservers(null, 'browser-toolbox-console-works', null);";
+ return jsterm.execute(js);
+ })
+ .then(() => toolbox.destroy());
+ }
+ };
+ closePromise = new Promise(onClose => {
+ info("Opening the browser toolbox\n");
+ BrowserToolboxProcess.init(onClose, onRun, options);
+ });
+ });
+ ok(true, "Browser toolbox started\n");
+
+ yield onCustomMessage;
+ ok(true, "Received the custom message");
+
+ yield closePromise;
+ ok(true, "Browser toolbox process just closed");
+});
diff --git a/devtools/client/framework/test/browser_devtools_api.js b/devtools/client/framework/test/browser_devtools_api.js
index ea263dd551c..e090b5c1c69 100644
--- a/devtools/client/framework/test/browser_devtools_api.js
+++ b/devtools/client/framework/test/browser_devtools_api.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_devtools_api_destroy.js b/devtools/client/framework/test/browser_devtools_api_destroy.js
index e002e4a296c..5c488de6171 100644
--- a/devtools/client/framework/test/browser_devtools_api_destroy.js
+++ b/devtools/client/framework/test/browser_devtools_api_destroy.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_dynamic_tool_enabling.js b/devtools/client/framework/test/browser_dynamic_tool_enabling.js
index c9989669b34..db3468a8f36 100644
--- a/devtools/client/framework/test/browser_dynamic_tool_enabling.js
+++ b/devtools/client/framework/test/browser_dynamic_tool_enabling.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
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 4965901eb02..e7f4c5753d0 100644
--- a/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js
+++ b/devtools/client/framework/test/browser_ignore_toolbox_network_requests.js
@@ -1,5 +1,8 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
// Test that network requests originating from the toolbox don't get recorded in
diff --git a/devtools/client/framework/test/browser_keybindings_01.js b/devtools/client/framework/test/browser_keybindings_01.js
index 547e1347718..f2e6df896c4 100644
--- a/devtools/client/framework/test/browser_keybindings_01.js
+++ b/devtools/client/framework/test/browser_keybindings_01.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// Tests that the keybindings for opening and closing the inspector work as expected
// Can probably make this a shared test that tests all of the tools global keybindings
diff --git a/devtools/client/framework/test/browser_keybindings_02.js b/devtools/client/framework/test/browser_keybindings_02.js
index 6bbd4a6a216..8871b3eac6d 100644
--- a/devtools/client/framework/test/browser_keybindings_02.js
+++ b/devtools/client/framework/test/browser_keybindings_02.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_keybindings_03.js b/devtools/client/framework/test/browser_keybindings_03.js
index c276e37972b..fbe74961012 100644
--- a/devtools/client/framework/test/browser_keybindings_03.js
+++ b/devtools/client/framework/test/browser_keybindings_03.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_new_activation_workflow.js b/devtools/client/framework/test/browser_new_activation_workflow.js
index d97481c8f26..79483a689fa 100644
--- a/devtools/client/framework/test/browser_new_activation_workflow.js
+++ b/devtools/client/framework/test/browser_new_activation_workflow.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_target_events.js b/devtools/client/framework/test/browser_target_events.js
index 2eb8a4038f0..d0054a484be 100644
--- a/devtools/client/framework/test/browser_target_events.js
+++ b/devtools/client/framework/test/browser_target_events.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
var target;
diff --git a/devtools/client/framework/test/browser_target_remote.js b/devtools/client/framework/test/browser_target_remote.js
index cc19a7fe6e5..b828d14ff56 100644
--- a/devtools/client/framework/test/browser_target_remote.js
+++ b/devtools/client/framework/test/browser_target_remote.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// Ensure target is closed if client is closed directly
function test() {
diff --git a/devtools/client/framework/test/browser_target_support.js b/devtools/client/framework/test/browser_target_support.js
index 587cf8b1c77..e26cf725b65 100644
--- a/devtools/client/framework/test/browser_target_support.js
+++ b/devtools/client/framework/test/browser_target_support.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// Test support methods on Target, such as `hasActor`, `getActorDescription`,
// `actorHasMethod` and `getTrait`.
diff --git a/devtools/client/framework/test/browser_toolbox_custom_host.js b/devtools/client/framework/test/browser_toolbox_custom_host.js
index 573b3305220..07d848a47ae 100644
--- a/devtools/client/framework/test/browser_toolbox_custom_host.js
+++ b/devtools/client/framework/test/browser_toolbox_custom_host.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
let {Toolbox} = require("devtools/client/framework/toolbox");
diff --git a/devtools/client/framework/test/browser_toolbox_dynamic_registration.js b/devtools/client/framework/test/browser_toolbox_dynamic_registration.js
index 44a07ad1aa8..f5453e79c17 100644
--- a/devtools/client/framework/test/browser_toolbox_dynamic_registration.js
+++ b/devtools/client/framework/test/browser_toolbox_dynamic_registration.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
var toolbox;
diff --git a/devtools/client/framework/test/browser_toolbox_getpanelwhenready.js b/devtools/client/framework/test/browser_toolbox_getpanelwhenready.js
index 93006f05e0c..3d531ac07a0 100644
--- a/devtools/client/framework/test/browser_toolbox_getpanelwhenready.js
+++ b/devtools/client/framework/test/browser_toolbox_getpanelwhenready.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_highlight.js b/devtools/client/framework/test/browser_toolbox_highlight.js
index d4140a526a4..170e5cd2a24 100644
--- a/devtools/client/framework/test/browser_toolbox_highlight.js
+++ b/devtools/client/framework/test/browser_toolbox_highlight.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_hosts.js b/devtools/client/framework/test/browser_toolbox_hosts.js
index 2558ed4217a..d46f5a615fc 100644
--- a/devtools/client/framework/test/browser_toolbox_hosts.js
+++ b/devtools/client/framework/test/browser_toolbox_hosts.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/test/browser_toolbox_hosts_size.js b/devtools/client/framework/test/browser_toolbox_hosts_size.js
index b66acfae547..a28e28826ad 100644
--- a/devtools/client/framework/test/browser_toolbox_hosts_size.js
+++ b/devtools/client/framework/test/browser_toolbox_hosts_size.js
@@ -1,7 +1,5 @@
-/* vim: set ts=2 et sw=2 tw=80: */
-/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
-
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_minimize.js b/devtools/client/framework/test/browser_toolbox_minimize.js
index d78d60b8cab..ce66826b139 100644
--- a/devtools/client/framework/test/browser_toolbox_minimize.js
+++ b/devtools/client/framework/test/browser_toolbox_minimize.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_options.js b/devtools/client/framework/test/browser_toolbox_options.js
index c977aab23e2..a8aa5c924a8 100644
--- a/devtools/client/framework/test/browser_toolbox_options.js
+++ b/devtools/client/framework/test/browser_toolbox_options.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js b/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
index a1c1ee32464..ee9b4388ecd 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_buttons.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js b/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
index 2625cf4703e..6d8c43da2b3 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_cache-01.js
@@ -1,6 +1,8 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
requestLongerTimeout(2);
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js b/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
index 3861d3cdb97..5739abce630 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_cache-02.js
@@ -1,6 +1,8 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
requestLongerTimeout(2);
diff --git a/devtools/client/framework/test/browser_toolbox_options_disable_js.js b/devtools/client/framework/test/browser_toolbox_options_disable_js.js
index 512a50721d8..de029295a65 100644
--- a/devtools/client/framework/test/browser_toolbox_options_disable_js.js
+++ b/devtools/client/framework/test/browser_toolbox_options_disable_js.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js
index a94d2225417..d66a8284ba6 100644
--- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js
+++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing_frame_script.js b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing_frame_script.js
index 63ee55f2edb..a228afe7c20 100644
--- a/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing_frame_script.js
+++ b/devtools/client/framework/test/browser_toolbox_options_enable_serviceworkers_testing_frame_script.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// A helper frame-script for devtools/client/framework service worker tests.
diff --git a/devtools/client/framework/test/browser_toolbox_raise.js b/devtools/client/framework/test/browser_toolbox_raise.js
index 6c857995658..7ff6d1288a9 100644
--- a/devtools/client/framework/test/browser_toolbox_raise.js
+++ b/devtools/client/framework/test/browser_toolbox_raise.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
var {Toolbox} = require("devtools/client/framework/toolbox");
diff --git a/devtools/client/framework/test/browser_toolbox_ready.js b/devtools/client/framework/test/browser_toolbox_ready.js
index 21e9fc4d92a..34be6f1155e 100644
--- a/devtools/client/framework/test/browser_toolbox_ready.js
+++ b/devtools/client/framework/test/browser_toolbox_ready.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
function test() {
gBrowser.selectedTab = gBrowser.addTab();
diff --git a/devtools/client/framework/test/browser_toolbox_select_event.js b/devtools/client/framework/test/browser_toolbox_select_event.js
index 35dc10cb6b2..0909b168392 100644
--- a/devtools/client/framework/test/browser_toolbox_select_event.js
+++ b/devtools/client/framework/test/browser_toolbox_select_event.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_selected_tool_unavailable.js b/devtools/client/framework/test/browser_toolbox_selected_tool_unavailable.js
index b6ac2e3484c..e7aefc9bc6f 100644
--- a/devtools/client/framework/test/browser_toolbox_selected_tool_unavailable.js
+++ b/devtools/client/framework/test/browser_toolbox_selected_tool_unavailable.js
@@ -1,5 +1,8 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
// Test that opening the toolbox doesn't throw when the previously selected
diff --git a/devtools/client/framework/test/browser_toolbox_sidebar.js b/devtools/client/framework/test/browser_toolbox_sidebar.js
index e52a6ef5c0a..2dbda37da56 100644
--- a/devtools/client/framework/test/browser_toolbox_sidebar.js
+++ b/devtools/client/framework/test/browser_toolbox_sidebar.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
@@ -6,7 +8,6 @@ function test() {
let {ToolSidebar} = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8," +
- "" +
"" +
"foo" +
"" +
diff --git a/devtools/client/framework/test/browser_toolbox_sidebar_events.js b/devtools/client/framework/test/browser_toolbox_sidebar_events.js
index fedcc1e35e7..9e56845d6db 100644
--- a/devtools/client/framework/test/browser_toolbox_sidebar_events.js
+++ b/devtools/client/framework/test/browser_toolbox_sidebar_events.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
@@ -6,7 +8,6 @@ function test() {
const { ToolSidebar } = require("devtools/client/framework/sidebar");
const toolURL = "data:text/xml;charset=utf8," +
- "" +
"" +
"foo" +
"" +
diff --git a/devtools/client/framework/test/browser_toolbox_sidebar_existing_tabs.js b/devtools/client/framework/test/browser_toolbox_sidebar_existing_tabs.js
index e9b3bff9637..ec856868620 100644
--- a/devtools/client/framework/test/browser_toolbox_sidebar_existing_tabs.js
+++ b/devtools/client/framework/test/browser_toolbox_sidebar_existing_tabs.js
@@ -1,5 +1,8 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
// Test that the sidebar widget auto-registers existing tabs.
@@ -7,7 +10,6 @@
const {ToolSidebar} = require("devtools/client/framework/sidebar");
const testToolURL = "data:text/xml;charset=utf8," +
- "" +
"" +
"test tool" +
"" +
diff --git a/devtools/client/framework/test/browser_toolbox_sidebar_overflow_menu.js b/devtools/client/framework/test/browser_toolbox_sidebar_overflow_menu.js
index 62df6112182..3c850dd28d2 100644
--- a/devtools/client/framework/test/browser_toolbox_sidebar_overflow_menu.js
+++ b/devtools/client/framework/test/browser_toolbox_sidebar_overflow_menu.js
@@ -1,5 +1,8 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
// Test that the sidebar widget correctly displays the "all tabs..." button
diff --git a/devtools/client/framework/test/browser_toolbox_sidebar_tool.xul b/devtools/client/framework/test/browser_toolbox_sidebar_tool.xul
index 2367115ce8f..2ce4951580a 100644
--- a/devtools/client/framework/test/browser_toolbox_sidebar_tool.xul
+++ b/devtools/client/framework/test/browser_toolbox_sidebar_tool.xul
@@ -4,7 +4,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
diff --git a/devtools/client/framework/test/browser_toolbox_split_console.js b/devtools/client/framework/test/browser_toolbox_split_console.js
index b2347820e43..228ad696221 100644
--- a/devtools/client/framework/test/browser_toolbox_split_console.js
+++ b/devtools/client/framework/test/browser_toolbox_split_console.js
@@ -1,5 +1,5 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js b/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
index 4208fbd15fa..84177a34242 100644
--- a/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
+++ b/devtools/client/framework/test/browser_toolbox_tabsswitch_shortcuts.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js b/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
index 826706a69f0..c81ed6eb62a 100644
--- a/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
+++ b/devtools/client/framework/test/browser_toolbox_textbox_context_menu.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_theme_registration.js b/devtools/client/framework/test/browser_toolbox_theme_registration.js
index 541a5ee8e05..c61ed623c9d 100644
--- a/devtools/client/framework/test/browser_toolbox_theme_registration.js
+++ b/devtools/client/framework/test/browser_toolbox_theme_registration.js
@@ -1,6 +1,7 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// Test for dynamically registering and unregistering themes
const CHROME_URL = "chrome://mochitests/content/browser/devtools/client/framework/test/";
diff --git a/devtools/client/framework/test/browser_toolbox_toggle.js b/devtools/client/framework/test/browser_toolbox_toggle.js
index 77104296619..554b9ddfc69 100644
--- a/devtools/client/framework/test/browser_toolbox_toggle.js
+++ b/devtools/client/framework/test/browser_toolbox_toggle.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/test/browser_toolbox_tool_ready.js b/devtools/client/framework/test/browser_toolbox_tool_ready.js
index ffe5dca3a7c..1821bf48e1a 100644
--- a/devtools/client/framework/test/browser_toolbox_tool_ready.js
+++ b/devtools/client/framework/test/browser_toolbox_tool_ready.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js b/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
index 14d585779de..785ebc2a32b 100644
--- a/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
+++ b/devtools/client/framework/test/browser_toolbox_tool_remote_reopen.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/test/browser_toolbox_transport_events.js b/devtools/client/framework/test/browser_toolbox_transport_events.js
index 13424801158..74800746fb0 100644
--- a/devtools/client/framework/test/browser_toolbox_transport_events.js
+++ b/devtools/client/framework/test/browser_toolbox_transport_events.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_view_source_01.js b/devtools/client/framework/test/browser_toolbox_view_source_01.js
index f6d70b3471b..ee75bb91300 100644
--- a/devtools/client/framework/test/browser_toolbox_view_source_01.js
+++ b/devtools/client/framework/test/browser_toolbox_view_source_01.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInDebugger works when debugger is not
diff --git a/devtools/client/framework/test/browser_toolbox_view_source_02.js b/devtools/client/framework/test/browser_toolbox_view_source_02.js
index 525aa49e704..26781781d4d 100644
--- a/devtools/client/framework/test/browser_toolbox_view_source_02.js
+++ b/devtools/client/framework/test/browser_toolbox_view_source_02.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInDebugger works when debugger is already loaded.
diff --git a/devtools/client/framework/test/browser_toolbox_view_source_03.js b/devtools/client/framework/test/browser_toolbox_view_source_03.js
index 663febbddbc..0d2ff1b68b1 100644
--- a/devtools/client/framework/test/browser_toolbox_view_source_03.js
+++ b/devtools/client/framework/test/browser_toolbox_view_source_03.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInStyleEditor works when style editor is not
diff --git a/devtools/client/framework/test/browser_toolbox_view_source_04.js b/devtools/client/framework/test/browser_toolbox_view_source_04.js
index 4d4b9cbdbbc..274d3261e1f 100644
--- a/devtools/client/framework/test/browser_toolbox_view_source_04.js
+++ b/devtools/client/framework/test/browser_toolbox_view_source_04.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests that Toolbox#viewSourceInScratchpad works.
diff --git a/devtools/client/framework/test/browser_toolbox_window_reload_target.js b/devtools/client/framework/test/browser_toolbox_window_reload_target.js
index 71a65b9a2b7..57a8f52255c 100644
--- a/devtools/client/framework/test/browser_toolbox_window_reload_target.js
+++ b/devtools/client/framework/test/browser_toolbox_window_reload_target.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_window_shortcuts.js b/devtools/client/framework/test/browser_toolbox_window_shortcuts.js
index 1d4d0d2cd28..4c17281314a 100644
--- a/devtools/client/framework/test/browser_toolbox_window_shortcuts.js
+++ b/devtools/client/framework/test/browser_toolbox_window_shortcuts.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_window_title_changes.js b/devtools/client/framework/test/browser_toolbox_window_title_changes.js
index eeac68de811..91ba9325dff 100644
--- a/devtools/client/framework/test/browser_toolbox_window_title_changes.js
+++ b/devtools/client/framework/test/browser_toolbox_window_title_changes.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_toolbox_zoom.js b/devtools/client/framework/test/browser_toolbox_zoom.js
index a7e50ca2a8e..a0d4e8fe806 100644
--- a/devtools/client/framework/test/browser_toolbox_zoom.js
+++ b/devtools/client/framework/test/browser_toolbox_zoom.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
diff --git a/devtools/client/framework/test/browser_two_tabs.js b/devtools/client/framework/test/browser_two_tabs.js
index 41dcc721cb5..2fada35d363 100644
--- a/devtools/client/framework/test/browser_two_tabs.js
+++ b/devtools/client/framework/test/browser_two_tabs.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Check regression when opening two tabs
diff --git a/devtools/client/framework/test/code_math.js b/devtools/client/framework/test/code_math.js
index 97c289411fd..9fe2a354176 100644
--- a/devtools/client/framework/test/code_math.js
+++ b/devtools/client/framework/test/code_math.js
@@ -1,3 +1,8 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
function add(a, b, k) {
var result = a + b;
return k(result);
diff --git a/devtools/client/framework/test/head.js b/devtools/client/framework/test/head.js
index 977268197cc..4ca722b9e7e 100644
--- a/devtools/client/framework/test/head.js
+++ b/devtools/client/framework/test/head.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
// shared-head.js handles imports, constants, and utility functions
Services.scriptloader.loadSubScript("chrome://mochitests/content/browser/devtools/client/framework/test/shared-head.js", this);
diff --git a/devtools/client/framework/test/helper_disable_cache.js b/devtools/client/framework/test/helper_disable_cache.js
index 720008257ea..ad5a8498e4a 100644
--- a/devtools/client/framework/test/helper_disable_cache.js
+++ b/devtools/client/framework/test/helper_disable_cache.js
@@ -1,6 +1,8 @@
-/* vim: set ts=2 et sw=2 tw=80: */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
+
"use strict";
// Common code shared by browser_toolbox_options_disable_cache-*.js
diff --git a/devtools/client/framework/test/serviceworker.js b/devtools/client/framework/test/serviceworker.js
index 5f23cd547e2..ed3c1ec323b 100644
--- a/devtools/client/framework/test/serviceworker.js
+++ b/devtools/client/framework/test/serviceworker.js
@@ -1 +1,6 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
+
// empty service worker, always succeed!
diff --git a/devtools/client/framework/test/shared-head.js b/devtools/client/framework/test/shared-head.js
index d2299dc5499..5df1e6c97c7 100644
--- a/devtools/client/framework/test/shared-head.js
+++ b/devtools/client/framework/test/shared-head.js
@@ -1,6 +1,7 @@
-/* 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/. */
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
+/* Any copyright is dedicated to the Public Domain.
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/test/shared-redux-head.js b/devtools/client/framework/test/shared-redux-head.js
index 81687e8cf1b..d2ab50ff19e 100644
--- a/devtools/client/framework/test/shared-redux-head.js
+++ b/devtools/client/framework/test/shared-redux-head.js
@@ -1,5 +1,7 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
- http://creativecommons.org/publicdomain/zero/1.0/ */
+ * http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
diff --git a/devtools/client/framework/toolbox-highlighter-utils.js b/devtools/client/framework/toolbox-highlighter-utils.js
index 806bfdd5b87..97f5f1639a9 100644
--- a/devtools/client/framework/toolbox-highlighter-utils.js
+++ b/devtools/client/framework/toolbox-highlighter-utils.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
diff --git a/devtools/client/framework/toolbox-hosts.js b/devtools/client/framework/toolbox-hosts.js
index 6c681d977bd..47ce544cbf4 100644
--- a/devtools/client/framework/toolbox-hosts.js
+++ b/devtools/client/framework/toolbox-hosts.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
diff --git a/devtools/client/framework/toolbox-options.js b/devtools/client/framework/toolbox-options.js
index 9bce031c253..5ca4d61d6d0 100644
--- a/devtools/client/framework/toolbox-options.js
+++ b/devtools/client/framework/toolbox-options.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
diff --git a/devtools/client/framework/toolbox-process-window.js b/devtools/client/framework/toolbox-process-window.js
index a24e4265370..ca6b56150ab 100644
--- a/devtools/client/framework/toolbox-process-window.js
+++ b/devtools/client/framework/toolbox-process-window.js
@@ -1,6 +1,9 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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";
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
@@ -111,9 +114,26 @@ function openToolbox({ form, chrome, isTabActor }) {
}
function onNewToolbox(toolbox) {
- gToolbox = toolbox;
- bindToolboxHandlers();
- raise();
+ gToolbox = toolbox;
+ bindToolboxHandlers();
+ raise();
+ let testScript = getParameterByName("testScript");
+ if (testScript) {
+ // Only allow executing random chrome scripts when a special
+ // test-only pref is set
+ let prefName = "devtools.browser-toolbox.allow-unsafe-script";
+ if (Services.prefs.getPrefType(prefName) == Services.prefs.PREF_BOOL &&
+ Services.prefs.getBoolPref(prefName) === true) {
+ evaluateTestScript(testScript, toolbox);
+ }
+ }
+}
+
+function evaluateTestScript(script, toolbox) {
+ let sandbox = Cu.Sandbox(window);
+ sandbox.window = window;
+ sandbox.toolbox = toolbox;
+ Cu.evalInSandbox(script, sandbox);
}
function bindToolboxHandlers() {
diff --git a/devtools/client/framework/toolbox.js b/devtools/client/framework/toolbox.js
index 53cbb237233..1cf89156d02 100644
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -1,3 +1,5 @@
+/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* 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/. */
@@ -28,8 +30,6 @@ Cu.import("resource://devtools/client/scratchpad/scratchpad-manager.jsm");
Cu.import("resource://devtools/client/shared/DOMHelpers.jsm");
Cu.import("resource://gre/modules/Task.jsm");
-loader.lazyImporter(this, "CommandUtils",
- "resource://devtools/client/shared/DeveloperToolbar.jsm");
loader.lazyGetter(this, "toolboxStrings", () => {
const properties = "chrome://devtools/locale/toolbox.properties";
const bundle = Services.strings.createBundle(properties);
@@ -45,6 +45,8 @@ loader.lazyGetter(this, "toolboxStrings", () => {
}
};
});
+loader.lazyRequireGetter(this, "CommandUtils",
+ "devtools/client/shared/developer-toolbar", true);
loader.lazyRequireGetter(this, "getHighlighterUtils",
"devtools/client/framework/toolbox-highlighter-utils", true);
loader.lazyRequireGetter(this, "Hosts",
diff --git a/devtools/client/framework/toolbox.xul b/devtools/client/framework/toolbox.xul
index f7c18aaa743..7999e6c87f5 100644
--- a/devtools/client/framework/toolbox.xul
+++ b/devtools/client/framework/toolbox.xul
@@ -3,7 +3,6 @@
- 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/. -->
-
diff --git a/devtools/client/inspector/inspector-panel.js b/devtools/client/inspector/inspector-panel.js
index 40e43c12416..d94edf7bda3 100644
--- a/devtools/client/inspector/inspector-panel.js
+++ b/devtools/client/inspector/inspector-panel.js
@@ -36,7 +36,7 @@ loader.lazyGetter(this, "clipboardHelper", () => {
return Cc["@mozilla.org/widget/clipboardhelper;1"].getService(Ci.nsIClipboardHelper);
});
-loader.lazyImporter(this, "CommandUtils", "resource://devtools/client/shared/DeveloperToolbar.jsm");
+loader.lazyRequireGetter(this, "CommandUtils", "devtools/client/shared/developer-toolbar", true);
/**
* Represents an open instance of the Inspector for a tab.
diff --git a/devtools/client/inspector/inspector.xul b/devtools/client/inspector/inspector.xul
index 597389c8021..2bad1a82ea5 100644
--- a/devtools/client/inspector/inspector.xul
+++ b/devtools/client/inspector/inspector.xul
@@ -5,7 +5,6 @@
-
diff --git a/devtools/client/inspector/markup/markup.xhtml b/devtools/client/inspector/markup/markup.xhtml
index aad1a21c6f4..9547bf6e5e4 100644
--- a/devtools/client/inspector/markup/markup.xhtml
+++ b/devtools/client/inspector/markup/markup.xhtml
@@ -9,7 +9,6 @@
-
diff --git a/devtools/client/memory/app.js b/devtools/client/memory/app.js
index 0825cb9a024..35eb21834b8 100644
--- a/devtools/client/memory/app.js
+++ b/devtools/client/memory/app.js
@@ -3,6 +3,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
const { assert } = require("devtools/shared/DevToolsUtils");
+const { appinfo } = require("Services");
const { DOM: dom, createClass, createFactory, PropTypes } = require("devtools/client/shared/vendor/react");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const { breakdowns, diffingState, viewState } = require("./constants");
@@ -53,6 +54,17 @@ const MemoryApp = createClass({
return {};
},
+ componentDidMount() {
+ // Attach the keydown listener directly to the window. When an element that
+ // has the focus (such as a tree node) is removed from the DOM, the focus
+ // falls back to the body.
+ window.addEventListener("keydown", this.onKeyDown);
+ },
+
+ componentWillUnmount() {
+ window.removeEventListener("keydown", this.onKeyDown);
+ },
+
childContextTypes: {
front: PropTypes.any,
heapWorker: PropTypes.any,
@@ -67,6 +79,27 @@ const MemoryApp = createClass({
};
},
+ onKeyDown(e) {
+ let { snapshots, dispatch, heapWorker } = this.props;
+ const selectedSnapshot = snapshots.find(s => s.selected);
+ const selectedIndex = snapshots.indexOf(selectedSnapshot);
+
+ let isOSX = appinfo.OS == "Darwin";
+ let isAccelKey = (isOSX && e.metaKey) || (!isOSX && e.ctrlKey);
+ // On ACCEL+UP, select previous snapshot.
+ if (isAccelKey && e.key === "ArrowUp") {
+ let previousIndex = Math.max(0, selectedIndex - 1);
+ let previousSnapshotId = snapshots[previousIndex].id;
+ dispatch(selectSnapshotAndRefresh(heapWorker, previousSnapshotId));
+ }
+ // On ACCEL+DOWN, select next snapshot.
+ if (isAccelKey && e.key === "ArrowDown") {
+ let nextIndex = Math.min(snapshots.length - 1, selectedIndex + 1);
+ let nextSnapshotId = snapshots[nextIndex].id;
+ dispatch(selectSnapshotAndRefresh(heapWorker, nextSnapshotId));
+ }
+ },
+
render() {
let {
dispatch,
diff --git a/devtools/client/memory/memory.xhtml b/devtools/client/memory/memory.xhtml
index 914b3526653..a126dcc34a5 100644
--- a/devtools/client/memory/memory.xhtml
+++ b/devtools/client/memory/memory.xhtml
@@ -11,7 +11,6 @@
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
-
diff --git a/devtools/client/memory/test/browser/browser.ini b/devtools/client/memory/test/browser/browser.ini
index 29fee425dc4..769c61b3ca9 100644
--- a/devtools/client/memory/test/browser/browser.ini
+++ b/devtools/client/memory/test/browser/browser.ini
@@ -15,6 +15,7 @@ support-files =
[browser_memory_dominator_trees_02.js]
[browser_memory_filter_01.js]
[browser_memory_keyboard.js]
+[browser_memory_keyboard-snapshot-list.js]
[browser_memory_no_allocation_stacks.js]
[browser_memory_no_auto_expand.js]
skip-if = debug # bug 1219554
diff --git a/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js b/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js
new file mode 100644
index 00000000000..72614c0838e
--- /dev/null
+++ b/devtools/client/memory/test/browser/browser_memory_keyboard-snapshot-list.js
@@ -0,0 +1,94 @@
+/* Any copyright is dedicated to the Public Domain.
+ http://creativecommons.org/publicdomain/zero/1.0/ */
+
+// Test that using ACCEL+UP/DOWN, the user can navigate between snapshots.
+
+"use strict";
+
+const {
+ snapshotState
+} = require("devtools/client/memory/constants");
+const {
+ takeSnapshotAndCensus
+} = require("devtools/client/memory/actions/snapshot");
+
+const TEST_URL = "http://example.com/browser/devtools/client/memory/test/browser/doc_steady_allocation.html";
+
+this.test = makeMemoryTest(TEST_URL, function* ({ panel }) {
+ // Creating snapshots already takes ~25 seconds on linux 32 debug machines
+ // which makes the test very likely to go over the allowed timeout
+ requestLongerTimeout(2);
+
+ const heapWorker = panel.panelWin.gHeapAnalysesClient;
+ const front = panel.panelWin.gFront;
+ const store = panel.panelWin.gStore;
+ const { dispatch } = store;
+ const doc = panel.panelWin.document;
+
+ info("Take 3 snapshots");
+ dispatch(takeSnapshotAndCensus(front, heapWorker));
+ dispatch(takeSnapshotAndCensus(front, heapWorker));
+ dispatch(takeSnapshotAndCensus(front, heapWorker));
+
+ yield waitUntilState(store, state =>
+ state.snapshots.length == 3 &&
+ state.snapshots.every(s => s.state === snapshotState.SAVED_CENSUS));
+ ok(true, "All snapshots are in SAVED_CENSUS state");
+
+ yield waitUntilSnapshotSelected(store, 2);
+ ok(true, "Third snapshot selected after creating all snapshots.");
+
+ info("Press ACCEL+UP key, expect second snapshot selected.");
+ EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
+ yield waitUntilSnapshotSelected(store, 1);
+ ok(true, "Second snapshot selected after alt+UP.");
+
+ info("Press ACCEL+UP key, expect first snapshot selected.");
+ EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
+ yield waitUntilSnapshotSelected(store, 0);
+ ok(true, "First snapshot is selected after ACCEL+UP");
+
+ info("Check ACCEL+UP is a noop when the first snapshot is selected.");
+ EventUtils.synthesizeKey("VK_UP", { accelKey: true }, panel.panelWin);
+ // We assume the snapshot selection should be synchronous here.
+ is(getSelectedSnapshotIndex(store), 0, "First snapshot is still selected");
+
+ info("Press ACCEL+DOWN key, expect second snapshot selected.");
+ EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
+ yield waitUntilSnapshotSelected(store, 1);
+ ok(true, "Second snapshot is selected after ACCEL+DOWN");
+
+ info("Click on first node.");
+ let firstNode = doc.querySelector(".tree .heap-tree-item-name");
+ EventUtils.synthesizeMouseAtCenter(firstNode, {}, panel.panelWin);
+ yield waitUntilState(store, state => state.snapshots[1].census.focused ===
+ state.snapshots[1].census.report.children[0]
+ );
+ ok(true, "First root is selected after click.");
+
+ info("Press DOWN key, expect second root focused.");
+ EventUtils.synthesizeKey("VK_DOWN", {}, panel.panelWin);
+ yield waitUntilState(store, state => state.snapshots[1].census.focused ===
+ state.snapshots[1].census.report.children[1]
+ );
+ ok(true, "Second root is selected after pressing DOWN.");
+ is(getSelectedSnapshotIndex(store), 1, "Second snapshot is still selected");
+
+ info("Press UP key, expect second root focused.");
+ EventUtils.synthesizeKey("VK_UP", {}, panel.panelWin);
+ yield waitUntilState(store, state => state.snapshots[1].census.focused ===
+ state.snapshots[1].census.report.children[0]
+ );
+ ok(true, "First root is selected after pressing UP.");
+ is(getSelectedSnapshotIndex(store), 1, "Second snapshot is still selected");
+
+ info("Press ACCEL+DOWN key, expect third snapshot selected.");
+ EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
+ yield waitUntilSnapshotSelected(store, 2);
+ ok(true, "Thirdˆ snapshot is selected after ACCEL+DOWN");
+
+ info("Check ACCEL+DOWN is a noop when the last snapshot is selected.");
+ EventUtils.synthesizeKey("VK_DOWN", { accelKey: true }, panel.panelWin);
+ // We assume the snapshot selection should be synchronous here.
+ is(getSelectedSnapshotIndex(store), 2, "Third snapshot is still selected");
+});
diff --git a/devtools/client/memory/test/browser/head.js b/devtools/client/memory/test/browser/head.js
index a6f51e8381b..a9d7f445e68 100644
--- a/devtools/client/memory/test/browser/head.js
+++ b/devtools/client/memory/test/browser/head.js
@@ -142,3 +142,26 @@ function getDisplayedSnapshotStatus(document) {
const status = document.querySelector(".snapshot-status");
return status ? status.textContent.trim() : null;
}
+
+/**
+ * Get the index of the currently selected snapshot.
+ *
+ * @return {Number}
+ */
+function getSelectedSnapshotIndex(store) {
+ let snapshots = store.getState().snapshots;
+ let selectedSnapshot = snapshots.find(s => s.selected);
+ return snapshots.indexOf(selectedSnapshot);
+}
+
+/**
+ * Returns a promise that will resolve when the snapshot with provided index
+ * becomes selected.
+ *
+ * @return {Promise}
+ */
+function waitUntilSnapshotSelected(store, snapshotIndex) {
+ return waitUntilState(store, state =>
+ state.snapshots[snapshotIndex] &&
+ state.snapshots[snapshotIndex].selected === true);
+}
diff --git a/devtools/client/netmonitor/netmonitor.xul b/devtools/client/netmonitor/netmonitor.xul
index 4b46861c627..fa344911664 100644
--- a/devtools/client/netmonitor/netmonitor.xul
+++ b/devtools/client/netmonitor/netmonitor.xul
@@ -5,7 +5,6 @@
-
-
diff --git a/devtools/client/preferences/devtools.js b/devtools/client/preferences/devtools.js
index bd7cb53b671..269dbe9979a 100644
--- a/devtools/client/preferences/devtools.js
+++ b/devtools/client/preferences/devtools.js
@@ -332,12 +332,11 @@ pref("devtools.fontinspector.enabled", true);
// version for each user.
pref("devtools.telemetry.tools.opened.version", "{}");
-// Enable the JSON View tool (an inspector for application/json documents) on
-// Nightly and Dev. Edition.
-#ifdef RELEASE_BUILD
-pref("devtools.jsonview.enabled", false);
+// Enable the JSON View tool (an inspector for application/json documents)
+#ifdef MOZ_DEV_EDITION
+ pref("devtools.jsonview.enabled", true);
#else
-pref("devtools.jsonview.enabled", true);
+ pref("devtools.jsonview.enabled", false);
#endif
// Disable the HTML responsive design tool by default. Currently disabled until
diff --git a/devtools/client/promisedebugger/promise-debugger.xhtml b/devtools/client/promisedebugger/promise-debugger.xhtml
index e4064a99529..cca446f531e 100644
--- a/devtools/client/promisedebugger/promise-debugger.xhtml
+++ b/devtools/client/promisedebugger/promise-debugger.xhtml
@@ -12,7 +12,6 @@
&title;
-
diff --git a/devtools/client/responsive.html/index.xhtml b/devtools/client/responsive.html/index.xhtml
index e991414a0bf..4073622c105 100644
--- a/devtools/client/responsive.html/index.xhtml
+++ b/devtools/client/responsive.html/index.xhtml
@@ -6,8 +6,6 @@
-
diff --git a/devtools/client/shared/widgets/graphs-frame.xhtml b/devtools/client/shared/widgets/graphs-frame.xhtml
index 6e951982fb0..8c6f45e03ca 100644
--- a/devtools/client/shared/widgets/graphs-frame.xhtml
+++ b/devtools/client/shared/widgets/graphs-frame.xhtml
@@ -7,7 +7,6 @@
-