This commit is contained in:
Wes Kocher 2016-05-13 16:45:32 -07:00
Родитель a960c70ca2 d3b44c704b
Коммит af53901606
51 изменённых файлов: 435 добавлений и 425 удалений

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

@ -83,9 +83,7 @@ devtools/client/eyedropper/**
devtools/client/framework/**
# devtools/client/inspector/shared/*.js files are eslint-clean, so they aren't
# included in the ignore list.
devtools/client/inspector/computed/**
devtools/client/inspector/fonts/**
devtools/client/inspector/shared/test/**
devtools/client/inspector/test/**
devtools/client/inspector/*.js
!devtools/client/inspector/breadcrumbs.js

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

@ -453,11 +453,13 @@ class Automation(object):
# Kill the application.
hitMaxTime = True
self.log.info("TEST-UNEXPECTED-FAIL | %s | application ran for longer than allowed maximum time of %d seconds", self.lastTestSeen, int(maxTime))
self.log.warning("Force-terminating active process(es).");
self.killAndGetStack(proc.pid, utilityPath, debuggerInfo)
if didTimeout:
if line:
self.log.info(line.rstrip().decode("UTF-8", "ignore"))
self.log.info("TEST-UNEXPECTED-FAIL | %s | application timed out after %d seconds with no output", self.lastTestSeen, int(timeout))
self.log.warning("Force-terminating active process(es).");
if browserProcessId == -1:
browserProcessId = proc.pid
self.killAndGetStack(browserProcessId, utilityPath, debuggerInfo)

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

@ -111,7 +111,7 @@
// rule is a better rule to check this.
"max-depth": 0,
// Maximum length of a line.
"max-len": [2, 80, 2, {"ignoreUrls": true, "ignorePattern": "\\s*require\\s*\\(|^\\s*loader\\.lazy|-\\*-"}],
"max-len": [2, 80, 2, {"ignoreUrls": true, "ignorePattern": "data:image\/|\\s*require\\s*\\(|^\\s*loader\\.lazy|-\\*-"}],
// Maximum depth callbacks can be nested.
"max-nested-callbacks": [2, 3],
// Don't limit the number of parameters that can be used in a function.

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

@ -30,12 +30,12 @@ Cu.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "PluralForm",
"resource://gre/modules/PluralForm.jsm");
XPCOMUtils.defineLazyGetter(CssComputedView, "_strings", function() {
XPCOMUtils.defineLazyGetter(CssComputedView, "_strings", function () {
return Services.strings.createBundle(
"chrome://devtools-shared/locale/styleinspector.properties");
});
XPCOMUtils.defineLazyGetter(this, "clipboardHelper", function() {
XPCOMUtils.defineLazyGetter(this, "clipboardHelper", function () {
return Cc["@mozilla.org/widget/clipboardhelper;1"]
.getService(Ci.nsIClipboardHelper);
});
@ -63,10 +63,10 @@ const HTML_NS = "http://www.w3.org/1999/xhtml";
function UpdateProcess(win, generator, options) {
this.win = win;
this.iter = _Iterator(generator);
this.onItem = options.onItem || function() {};
this.onBatch = options.onBatch || function() {};
this.onDone = options.onDone || function() {};
this.onCancel = options.onCancel || function() {};
this.onItem = options.onItem || function () {};
this.onBatch = options.onBatch || function () {};
this.onDone = options.onDone || function () {};
this.onCancel = options.onCancel || function () {};
this.threshold = options.threshold || 45;
this.canceled = false;
@ -76,7 +76,7 @@ UpdateProcess.prototype = {
/**
* Schedule a new batch on the main loop.
*/
schedule: function() {
schedule: function () {
if (this.canceled) {
return;
}
@ -87,7 +87,7 @@ UpdateProcess.prototype = {
* Cancel the running process. onItem will not be called again,
* and onCancel will be called.
*/
cancel: function() {
cancel: function () {
if (this._timeout) {
clearTimeout(this._timeout);
this._timeout = 0;
@ -96,12 +96,12 @@ UpdateProcess.prototype = {
this.onCancel();
},
_timeoutHandler: function() {
_timeoutHandler: function () {
this._timeout = null;
try {
this._runBatch();
this.schedule();
} catch(e) {
} catch (e) {
if (e instanceof StopIteration) {
this.onBatch();
this.onDone();
@ -112,7 +112,7 @@ UpdateProcess.prototype = {
}
},
_runBatch: function() {
_runBatch: function () {
let time = Date.now();
while (!this.canceled) {
// Continue until iter.next() throws...
@ -223,7 +223,7 @@ function CssComputedView(inspector, document, pageStyle) {
* The key to lookup.
* @returns {String} localized version of the given key.
*/
CssComputedView.l10n = function(name) {
CssComputedView.l10n = function (name) {
try {
return CssComputedView._strings.GetStringFromName(name);
} catch (ex) {
@ -248,7 +248,7 @@ CssComputedView.prototype = {
// Number of visible properties
numVisibleProperties: 0,
setPageStyle: function(pageStyle) {
setPageStyle: function (pageStyle) {
this.pageStyle = pageStyle;
},
@ -256,7 +256,7 @@ CssComputedView.prototype = {
return this.includeBrowserStylesCheckbox.checked;
},
_handlePrefChange: function(event, data) {
_handlePrefChange: function (event, data) {
if (this._computed && (data.pref === "devtools.defaultColorUnit" ||
data.pref === PREF_ORIG_SOURCES)) {
this.refreshPanel();
@ -271,7 +271,7 @@ CssComputedView.prototype = {
* The highlighted node to get styles for.
* @returns a promise that will be resolved when highlighting is complete.
*/
selectElement: function(element) {
selectElement: function (element) {
if (!element) {
this.viewedElement = null;
this.noResults.hidden = false;
@ -307,7 +307,7 @@ CssComputedView.prototype = {
* - value {Object} Depends on the type of the node
* returns null if the node isn't anything we care about
*/
getNodeInfo: function(node) {
getNodeInfo: function (node) {
if (!node) {
return null;
}
@ -387,7 +387,7 @@ CssComputedView.prototype = {
return {type, value};
},
_createPropertyViews: function() {
_createPropertyViews: function () {
if (this._createViewsPromise) {
return this._createViewsPromise;
}
@ -401,27 +401,28 @@ CssComputedView.prototype = {
this._createViewsProcess = new UpdateProcess(
this.styleWindow, CssComputedView.propertyNames, {
onItem: (propertyName) => {
// Per-item callback.
let propView = new PropertyView(this, propertyName);
fragment.appendChild(propView.buildMain());
fragment.appendChild(propView.buildSelectorContainer());
onItem: (propertyName) => {
// Per-item callback.
let propView = new PropertyView(this, propertyName);
fragment.appendChild(propView.buildMain());
fragment.appendChild(propView.buildSelectorContainer());
if (propView.visible) {
this.numVisibleProperties++;
if (propView.visible) {
this.numVisibleProperties++;
}
this.propertyViews.push(propView);
},
onCancel: () => {
deferred.reject("_createPropertyViews cancelled");
},
onDone: () => {
// Completed callback.
this.element.appendChild(fragment);
this.noResults.hidden = this.numVisibleProperties > 0;
deferred.resolve(undefined);
}
this.propertyViews.push(propView);
},
onCancel: () => {
deferred.reject("_createPropertyViews cancelled");
},
onDone: () => {
// Completed callback.
this.element.appendChild(fragment);
this.noResults.hidden = this.numVisibleProperties > 0;
deferred.resolve(undefined);
}
});
);
this._createViewsProcess.schedule();
return deferred.promise;
@ -430,7 +431,7 @@ CssComputedView.prototype = {
/**
* Refresh the panel content.
*/
refreshPanel: function() {
refreshPanel: function () {
if (!this.viewedElement) {
return promise.resolve();
}
@ -474,24 +475,27 @@ CssComputedView.prototype = {
let deferred = promise.defer();
this._refreshProcess = new UpdateProcess(
this.styleWindow, this.propertyViews, {
onItem: (propView) => {
propView.refresh();
},
onDone: () => {
this._refreshProcess = null;
this.noResults.hidden = this.numVisibleProperties > 0;
onItem: (propView) => {
propView.refresh();
},
onDone: () => {
this._refreshProcess = null;
this.noResults.hidden = this.numVisibleProperties > 0;
if (this.searchField.value.length > 0 && !this.numVisibleProperties) {
this.searchField.classList.add("devtools-style-searchbox-no-match");
} else {
this.searchField.classList
.remove("devtools-style-searchbox-no-match");
if (this.searchField.value.length > 0 &&
!this.numVisibleProperties) {
this.searchField.classList
.add("devtools-style-searchbox-no-match");
} else {
this.searchField.classList
.remove("devtools-style-searchbox-no-match");
}
this.inspector.emit("computed-view-refreshed");
deferred.resolve(undefined);
}
this.inspector.emit("computed-view-refreshed");
deferred.resolve(undefined);
}
});
);
this._refreshProcess.schedule();
return deferred.promise;
}).then(null, (err) => console.error(err));
@ -500,7 +504,7 @@ CssComputedView.prototype = {
/**
* Handle the keypress event in the computed view.
*/
_onKeypress: function(event) {
_onKeypress: function (event) {
if (!event.target.closest("#sidebar-panel-computedview")) {
return;
}
@ -519,7 +523,7 @@ CssComputedView.prototype = {
* @param {String} value
* The search value.
*/
setFilterStyles: function(value="") {
setFilterStyles: function (value = "") {
this.searchField.value = value;
this.searchField.focus();
this._onFilterStyles();
@ -528,7 +532,7 @@ CssComputedView.prototype = {
/**
* Called when the user enters a search term in the filter style search box.
*/
_onFilterStyles: function() {
_onFilterStyles: function () {
if (this._filterChangedTimeout) {
clearTimeout(this._filterChangedTimeout);
}
@ -553,7 +557,7 @@ CssComputedView.prototype = {
* Handle the search box's keypress event. If the escape key is pressed,
* clear the search box field.
*/
_onFilterKeyPress: function(event) {
_onFilterKeyPress: function (event) {
if (event.keyCode === Ci.nsIDOMKeyEvent.DOM_VK_ESCAPE &&
this._onClearSearch()) {
event.preventDefault();
@ -564,12 +568,12 @@ CssComputedView.prototype = {
/**
* Context menu handler for filter style search box.
*/
_onFilterTextboxContextMenu: function(event) {
_onFilterTextboxContextMenu: function (event) {
try {
this.styleDocument.defaultView.focus();
let contextmenu = this.inspector.toolbox.textboxContextMenuPopup;
contextmenu.openPopupAtScreen(event.screenX, event.screenY, true);
} catch(e) {
} catch (e) {
console.error(e);
}
},
@ -578,7 +582,7 @@ CssComputedView.prototype = {
* Called when the user clicks on the clear button in the filter style search
* box. Returns true if the search box is cleared and false otherwise.
*/
_onClearSearch: function() {
_onClearSearch: function () {
if (this.searchField.value) {
this.setFilterStyles("");
return true;
@ -590,7 +594,7 @@ CssComputedView.prototype = {
/**
* The change event handler for the includeBrowserStyles checkbox.
*/
_onIncludeBrowserStyles: function() {
_onIncludeBrowserStyles: function () {
this.refreshSourceFilter();
this.refreshPanel();
},
@ -601,14 +605,14 @@ CssComputedView.prototype = {
* document or one of thedocument's stylesheets. If .checked is false we
* display all properties including those that come from UA stylesheets.
*/
refreshSourceFilter: function() {
refreshSourceFilter: function () {
this._matchedProperties = null;
this._sourceFilter = this.includeBrowserStyles ?
CssLogic.FILTER.UA :
CssLogic.FILTER.USER;
},
_onSourcePrefChanged: function() {
_onSourcePrefChanged: function () {
for (let propView of this.propertyViews) {
propView.updateSourceLinks();
}
@ -618,7 +622,7 @@ CssComputedView.prototype = {
/**
* The CSS as displayed by the UI.
*/
createStyleViews: function() {
createStyleViews: function () {
if (CssComputedView.propertyNames) {
return;
}
@ -668,7 +672,7 @@ CssComputedView.prototype = {
/**
* Focus the window on mousedown.
*/
focusWindow: function() {
focusWindow: function () {
let win = this.styleDocument.defaultView;
win.focus();
},
@ -676,11 +680,11 @@ CssComputedView.prototype = {
/**
* Context menu handler.
*/
_onContextMenu: function(event) {
_onContextMenu: function (event) {
this._contextmenu.show(event);
},
_onClick: function(event) {
_onClick: function (event) {
let target = event.target;
if (target.nodeName === "a") {
@ -697,7 +701,7 @@ CssComputedView.prototype = {
* @param {Event} event
* copy event object.
*/
_onCopy: function(event) {
_onCopy: function (event) {
this.copySelection();
event.preventDefault();
},
@ -705,7 +709,7 @@ CssComputedView.prototype = {
/**
* Copy the current selection to the clipboard
*/
copySelection: function() {
copySelection: function () {
try {
let win = this.styleDocument.defaultView;
let text = win.getSelection().toString().trim();
@ -732,7 +736,7 @@ CssComputedView.prototype = {
}
clipboardHelper.copyString(result);
} catch(e) {
} catch (e) {
console.error(e);
}
},
@ -740,7 +744,7 @@ CssComputedView.prototype = {
/**
* Destructor for CssComputedView.
*/
destroy: function() {
destroy: function () {
this.viewedElement = null;
this._outputParser = null;
@ -812,6 +816,7 @@ PropertyInfo.prototype = {
let value = this.tree._computed[this.name].value;
return value;
}
return null;
}
};
@ -941,7 +946,7 @@ PropertyView.prototype = {
*
* @return {Element}
*/
buildMain: function() {
buildMain: function () {
let doc = this.tree.styleDocument;
// Build the container element
@ -1005,7 +1010,7 @@ PropertyView.prototype = {
return this.element;
},
buildSelectorContainer: function() {
buildSelectorContainer: function () {
let doc = this.tree.styleDocument;
let element = doc.createElementNS(HTML_NS, "div");
element.setAttribute("class", this.propertyContentClassName);
@ -1019,7 +1024,7 @@ PropertyView.prototype = {
/**
* Refresh the panel's CSS property value.
*/
refresh: function() {
refresh: function () {
this.element.className = this.propertyHeaderClassName;
this.element.nextElementSibling.className = this.propertyContentClassName;
@ -1056,7 +1061,7 @@ PropertyView.prototype = {
/**
* Refresh the panel matched rules.
*/
refreshMatchedSelectors: function() {
refreshMatchedSelectors: function () {
let hasMatchedSelectors = this.hasMatchedSelectors;
this.matchedSelectorsContainer.parentNode.hidden = !hasMatchedSelectors;
@ -1093,7 +1098,7 @@ PropertyView.prototype = {
return this._matchedSelectorResponse;
},
_buildMatchedSelectors: function() {
_buildMatchedSelectors: function () {
let promises = [];
let frag = this.element.ownerDocument.createDocumentFragment();
@ -1138,11 +1143,10 @@ PropertyView.prototype = {
get matchedSelectorViews() {
if (!this._matchedSelectorViews) {
this._matchedSelectorViews = [];
this._matchedSelectorResponse.forEach(
function(selectorInfo) {
let selectorView = new SelectorView(this.tree, selectorInfo);
this._matchedSelectorViews.push(selectorView);
}, this);
this._matchedSelectorResponse.forEach(selectorInfo => {
let selectorView = new SelectorView(this.tree, selectorInfo);
this._matchedSelectorViews.push(selectorView);
}, this);
}
return this._matchedSelectorViews;
},
@ -1151,7 +1155,7 @@ PropertyView.prototype = {
* Update all the selector source links to reflect whether we're linking to
* original sources (e.g. Sass files).
*/
updateSourceLinks: function() {
updateSourceLinks: function () {
if (!this._matchedSelectorViews) {
return;
}
@ -1167,7 +1171,7 @@ PropertyView.prototype = {
* Used to determine the class name of the targets click
* event.
*/
onMatchedToggle: function(event) {
onMatchedToggle: function (event) {
if (event.shiftKey) {
return;
}
@ -1179,7 +1183,7 @@ PropertyView.prototype = {
/**
* The action when a user clicks on the MDN help link for a property.
*/
mdnLinkClick: function(event) {
mdnLinkClick: function (event) {
let inspector = this.tree.inspector;
if (inspector.target.tab) {
@ -1192,7 +1196,7 @@ PropertyView.prototype = {
/**
* Destroy this property view, removing event listeners
*/
destroy: function() {
destroy: function () {
this.element.removeEventListener("dblclick", this.onMatchedToggle, false);
this.element.removeEventListener("keydown", this.onKeyDown, false);
this.element = null;
@ -1248,7 +1252,7 @@ SelectorView.prototype = {
* bundle.
* @see css-logic.js - the CssLogic.STATUS array.
*/
_cacheStatusNames: function() {
_cacheStatusNames: function () {
if (SelectorView.STATUS_NAMES.length) {
return;
}
@ -1303,11 +1307,12 @@ SelectorView.prototype = {
let frag = outputParser.parseCssProperty(
this.selectorInfo.name,
this.selectorInfo.value, {
colorSwatchClass: "computedview-colorswatch",
colorClass: "computedview-color",
urlClass: "theme-link",
baseURI: this.selectorInfo.rule.href
});
colorSwatchClass: "computedview-colorswatch",
colorClass: "computedview-color",
urlClass: "theme-link",
baseURI: this.selectorInfo.rule.href
}
);
return frag;
},
@ -1315,7 +1320,7 @@ SelectorView.prototype = {
* Update the text of the source link to reflect whether we're showing
* original sources or not.
*/
updateSourceLink: function() {
updateSourceLink: function () {
return this.updateSource().then((oldSource) => {
if (oldSource !== this.source && this.tree.element) {
let selector = '[sourcelocation="' + oldSource + '"]';
@ -1331,7 +1336,7 @@ SelectorView.prototype = {
/**
* Update the 'source' store based on our original sources preference.
*/
updateSource: function() {
updateSource: function () {
let rule = this.selectorInfo.rule;
this.sheet = rule.parentStyleSheet;
@ -1366,7 +1371,7 @@ SelectorView.prototype = {
/**
* Open the style editor if the RETURN key was pressed.
*/
maybeOpenStyleEditor: function(event) {
maybeOpenStyleEditor: function (event) {
let keyEvent = Ci.nsIDOMKeyEvent;
if (event.keyCode === keyEvent.DOM_VK_RETURN) {
this.openStyleEditor();
@ -1381,7 +1386,7 @@ SelectorView.prototype = {
* We can only view stylesheets contained in document.styleSheets inside the
* style editor.
*/
openStyleEditor: function() {
openStyleEditor: function () {
let inspector = this.tree.inspector;
let rule = this.selectorInfo.rule;
@ -1405,7 +1410,7 @@ SelectorView.prototype = {
location.then(({source, href, line, column}) => {
let target = inspector.target;
if (ToolDefinitions.styleEditor.isTargetSupported(target)) {
gDevTools.showToolbox(target, "styleeditor").then(function(toolbox) {
gDevTools.showToolbox(target, "styleeditor").then(function (toolbox) {
let sheet = source || href;
toolbox.getCurrentPanel().selectStyleSheet(sheet, line, column);
});
@ -1441,14 +1446,14 @@ function ComputedViewTool(inspector, window) {
}
ComputedViewTool.prototype = {
isSidebarActive: function() {
isSidebarActive: function () {
if (!this.view) {
return false;
}
return this.inspector.sidebar.getCurrentTabID() == "computedview";
},
onSelected: function(event) {
onSelected: function (event) {
// Ignore the event if the view has been destroyed, or if it's inactive.
// But only if the current selection isn't null. If it's been set to null,
// let the update go through as this is needed to empty the view on
@ -1479,13 +1484,13 @@ ComputedViewTool.prototype = {
}
},
refresh: function() {
refresh: function () {
if (this.isSidebarActive()) {
this.view.refreshPanel();
}
},
onPanelSelected: function() {
onPanelSelected: function () {
if (this.inspector.selection.nodeFront === this.view.viewedElement) {
this.refresh();
} else {
@ -1497,7 +1502,7 @@ ComputedViewTool.prototype = {
* When markup mutations occur, if an attribute of the selected node changes,
* we need to refresh the view as that might change the node's styles.
*/
onMutations: function(mutations) {
onMutations: function (mutations) {
for (let {type, target} of mutations) {
if (target === this.inspector.selection.nodeFront &&
type === "attributes") {
@ -1511,11 +1516,11 @@ ComputedViewTool.prototype = {
* When the window gets resized, this may cause media-queries to match, and
* therefore, different styles may apply.
*/
onResized: function() {
onResized: function () {
this.refresh();
},
destroy: function() {
destroy: function () {
this.inspector.walker.off("mutations", this.onMutations);
this.inspector.walker.off("resize", this.onResized);
this.inspector.sidebar.off("computedview-selected", this.refresh);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);

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

@ -49,28 +49,28 @@ const TEST_URI = `
const TEST_DATA = [
{
desc: "Testing a null node",
getHoveredNode: function*() {
getHoveredNode: function* () {
return null;
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo, null);
}
},
{
desc: "Testing a useless node",
getHoveredNode: function*(view) {
getHoveredNode: function* (view) {
return view.element;
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo, null);
}
},
{
desc: "Testing a property name",
getHoveredNode: function*(view) {
getHoveredNode: function* (view) {
return getComputedViewProperty(view, "color").nameSpan;
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_PROPERTY_TYPE);
ok("property" in nodeInfo.value);
ok("value" in nodeInfo.value);
@ -80,10 +80,10 @@ const TEST_DATA = [
},
{
desc: "Testing a property value",
getHoveredNode: function*(view) {
getHoveredNode: function* (view) {
return getComputedViewProperty(view, "color").valueSpan;
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_VALUE_TYPE);
ok("property" in nodeInfo.value);
ok("value" in nodeInfo.value);
@ -93,11 +93,11 @@ const TEST_DATA = [
},
{
desc: "Testing an image url",
getHoveredNode: function*(view) {
getHoveredNode: function* (view) {
let {valueSpan} = getComputedViewProperty(view, "background-image");
return valueSpan.querySelector(".theme-link");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_IMAGE_URL_TYPE);
ok("property" in nodeInfo.value);
ok("value" in nodeInfo.value);
@ -109,44 +109,44 @@ const TEST_DATA = [
},
{
desc: "Testing a matched rule selector (bestmatch)",
getHoveredNode: function*(view) {
let content = yield getComputedViewMatchedRules(view, "background-color");
return content.querySelector(".bestmatch");
getHoveredNode: function* (view) {
let el = yield getComputedViewMatchedRules(view, "background-color");
return el.querySelector(".bestmatch");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_SELECTOR_TYPE);
is(nodeInfo.value, "div div");
}
},
{
desc: "Testing a matched rule selector (matched)",
getHoveredNode: function*(view) {
let content = yield getComputedViewMatchedRules(view, "background-color");
return content.querySelector(".matched");
getHoveredNode: function* (view) {
let el = yield getComputedViewMatchedRules(view, "background-color");
return el.querySelector(".matched");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_SELECTOR_TYPE);
is(nodeInfo.value, "div");
}
},
{
desc: "Testing a matched rule selector (parentmatch)",
getHoveredNode: function*(view) {
let content = yield getComputedViewMatchedRules(view, "color");
return content.querySelector(".parentmatch");
getHoveredNode: function* (view) {
let el = yield getComputedViewMatchedRules(view, "color");
return el.querySelector(".parentmatch");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_SELECTOR_TYPE);
is(nodeInfo.value, "body");
}
},
{
desc: "Testing a matched rule value",
getHoveredNode: function*(view) {
let content = yield getComputedViewMatchedRules(view, "color");
return content.querySelector(".other-property-value");
getHoveredNode: function* (view) {
let el = yield getComputedViewMatchedRules(view, "color");
return el.querySelector(".other-property-value");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo.type, VIEW_NODE_VALUE_TYPE);
is(nodeInfo.value.property, "color");
is(nodeInfo.value.value, "red");
@ -154,17 +154,17 @@ const TEST_DATA = [
},
{
desc: "Testing a matched rule stylesheet link",
getHoveredNode: function*(view) {
let content = yield getComputedViewMatchedRules(view, "color");
return content.querySelector(".rule-link .theme-link");
getHoveredNode: function* (view) {
let el = yield getComputedViewMatchedRules(view, "color");
return el.querySelector(".rule-link .theme-link");
},
assertNodeInfo: function(nodeInfo) {
assertNodeInfo: function (nodeInfo) {
is(nodeInfo, null);
}
}
];
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#testElement", inspector);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode(".matches", inspector);
@ -72,7 +72,7 @@ function checkHelpLinkKeybinding(view) {
let def = promise.defer();
let propView = getFirstVisiblePropertyView(view);
propView.mdnLinkClick = function() {
propView.mdnLinkClick = function () {
ok(true, "Pressing F1 opened the MDN link");
def.resolve();
};

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

@ -32,7 +32,7 @@ const TEST_URI = `
</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("span", inspector);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<h1>Some header text</h1>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("h1", inspector);

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

@ -10,7 +10,7 @@ const {PropertyView} =
require("devtools/client/inspector/computed/computed");
const TEST_URI = URL_ROOT + "doc_matched_selectors.html";
add_task(function*() {
add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openComputedView();

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

@ -6,7 +6,7 @@
// Tests for matched selector texts in the computed view.
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8,<div style='color:blue;'></div>");
let {inspector, view} = yield openComputedView();
yield selectNode("div", inspector);
@ -30,7 +30,7 @@ add_task(function*() {
function getPropertyView(computedView, name) {
let propertyView = null;
computedView.propertyViews.some(function(view) {
computedView.propertyViews.some(function (view) {
if (view.name == name) {
propertyView = view;
return true;

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

@ -10,9 +10,8 @@
const TEST_URI = URL_ROOT + "doc_media_queries.html";
var {PropertyView} = require("devtools/client/inspector/computed/computed");
var {CssLogic} = require("devtools/shared/inspector/css-logic");
add_task(function*() {
add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openComputedView();
yield selectNode("div", inspector);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);

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

@ -12,7 +12,7 @@ const PREF = "devtools.styleeditor.source-maps-enabled";
const SCSS_LOC = "doc_sourcemaps.scss:4";
const CSS_LOC = "doc_sourcemaps.css:1";
add_task(function*() {
add_task(function* () {
info("Turning the pref " + PREF + " on");
Services.prefs.setBoolPref(PREF, true);

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

@ -8,7 +8,7 @@
const TEST_URI = URL_ROOT + "doc_pseudoelement.html";
add_task(function*() {
add_task(function* () {
yield addTab(TEST_URI);
let {inspector, view} = yield openComputedView();
yield testTopLeft(inspector, view);

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

@ -9,9 +9,9 @@
const TEST_URI = "<div id='testdiv' style='font-size:10px;'>Test div!</div>";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
let {inspector, view, testActor} = yield openComputedView();
yield selectNode("#testdiv", inspector);
let fontSize = getComputedViewPropertyValue(view, "font-size");
@ -19,9 +19,8 @@ add_task(function*() {
info("Changing the node's style and waiting for the update");
let onUpdated = inspector.once("computed-view-refreshed");
// FIXME: use the testActor to set style on the node.
content.document.querySelector("#testdiv")
.style.cssText = "font-size: 15px; color: red;";
yield testActor.setAttribute("#testdiv", "style",
"font-size: 15px; color: red;");
yield onUpdated;
fontSize = getComputedViewPropertyValue(view, "font-size");

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);
@ -37,11 +37,12 @@ function* testAddTextInFilter(inspector, computedView) {
let onRefreshed = inspector.once("computed-view-refreshed");
let win = computedView.styleWindow;
// First check to make sure that accel + F doesn't focus search if the container
// isn't focused
// First check to make sure that accel + F doesn't focus search if the
// container isn't focused
inspector.panelWin.focus();
EventUtils.synthesizeKey("f", { accelKey: true });
isnot(inspector.panelDoc.activeElement, searchField, "Search field isn't focused");
isnot(inspector.panelDoc.activeElement, searchField,
"Search field isn't focused");
computedView.element.focus();
EventUtils.synthesizeKey("f", { accelKey: true });
@ -53,7 +54,7 @@ function* testAddTextInFilter(inspector, computedView) {
info("check that the correct properties are visible");
let propertyViews = computedView.propertyViews;
propertyViews.forEach(function(propView) {
propertyViews.forEach(propView => {
let name = propView.name;
is(propView.visible, name.indexOf("color") > -1,
"span " + name + " property visibility check");

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

@ -17,7 +17,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);

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

@ -10,7 +10,7 @@ const TEST_INPUT = "h1";
const TEST_URI = "<h1>test filter context menu</h1>";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {toolbox, inspector, view} = yield openComputedView();
yield selectNode("h1", inspector);

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

@ -15,7 +15,7 @@ const TEST_URI = `
<span id="matches" class="matches">Some styled text</span>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("#matches", inspector);

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

@ -6,7 +6,7 @@
// Tests that properties can be selected and copied from the computed view.
XPCOMUtils.defineLazyGetter(this, "osString", function() {
XPCOMUtils.defineLazyGetter(this, "osString", function () {
return Cc["@mozilla.org/xre/app-info;1"].getService(Ci.nsIXULRuntime).OS;
});
@ -36,7 +36,7 @@ const TEST_URI = `
</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openComputedView();
yield selectNode("span", inspector);

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

@ -4,61 +4,56 @@
"use strict";
///////////////////
//
// Whitelisting this test.
// As part of bug 1077403, the leaking uncaught rejection should be fixed.
//
thisTestLeaksUncaughtRejectionsAndShouldBeFixed("Error: Unknown sheet source");
// Tests the links from the computed view to the style editor.
const STYLESHEET_URL = "data:text/css," + encodeURIComponent(
[".highlight {",
"color: blue",
"}"].join("\n"));
".highlight {color: blue}");
const DOCUMENT_URL = "data:text/html;charset=utf-8," + encodeURIComponent(
['<html>' +
'<head>' +
'<title>Computed view style editor link test</title>',
'<style type="text/css"> ',
'html { color: #000000; } ',
'span { font-variant: small-caps; color: #000000; } ',
'.nomatches {color: #ff0000;}</style> <div id="first" style="margin: 10em; ',
'font-size: 14pt; font-family: helvetica, sans-serif; color: #AAA">',
'</style>',
'<style>',
'div { color: #f06; }',
'</style>',
'<link rel="stylesheet" type="text/css" href="' + STYLESHEET_URL + '">',
'</head>',
'<body>',
'<h1>Some header text</h1>',
'<p id="salutation" style="font-size: 12pt">hi.</p>',
'<p id="body" style="font-size: 12pt">I am a test-case. This text exists ',
'solely to provide some things to ',
'<span style="color: yellow" class="highlight">',
'highlight</span> and <span style="font-weight: bold">count</span> ',
'style list-items in the box at right. If you are reading this, ',
'you should go do something else instead. Maybe read a book. Or better ',
'yet, write some test-cases for another bit of code. ',
'<span style="font-style: italic">some text</span></p>',
'<p id="closing">more text</p>',
'<p>even more text</p>',
'</div>',
'</body>',
'</html>'].join("\n"));
`<html>
<head>
<title>Computed view style editor link test</title>
<style type="text/css">
html { color: #000000; }
span { font-variant: small-caps; color: #000000; }
.nomatches {color: #ff0000;}</style> <div id="first" style="margin: 10em;
font-size: 14pt; font-family: helvetica, sans-serif; color: #AAA">
</style>
<style>
div { color: #f06; }
</style>
<link rel="stylesheet" type="text/css" href="${STYLESHEET_URL}">
</head>
<body>
<h1>Some header text</h1>
<p id="salutation" style="font-size: 12pt">hi.</p>
<p id="body" style="font-size: 12pt">I am a test-case. This text exists
solely to provide some things to
<span style="color: yellow" class="highlight">
highlight</span> and <span style="font-weight: bold">count</span>
style list-items in the box at right. If you are reading this,
you should go do something else instead. Maybe read a book. Or better
yet, write some test-cases for another bit of code.
<span style="font-style: italic">some text</span></p>
<p id="closing">more text</p>
<p>even more text</p>
</div>
</body>
</html>`);
add_task(function*() {
add_task(function* () {
yield addTab(DOCUMENT_URL);
let {toolbox, inspector, view} = yield openComputedView();
let {toolbox, inspector, view, testActor} = yield openComputedView();
yield selectNode("span", inspector);
yield testInlineStyle(view);
yield testFirstInlineStyleSheet(view, toolbox);
yield testSecondInlineStyleSheet(view, toolbox);
yield testExternalStyleSheet(view, toolbox);
yield testFirstInlineStyleSheet(view, toolbox, testActor);
yield testSecondInlineStyleSheet(view, toolbox, testActor);
yield testExternalStyleSheet(view, toolbox, testActor);
});
function* testInlineStyle(view) {
@ -78,7 +73,7 @@ function* testInlineStyle(view) {
gBrowser.removeTab(tab);
}
function* testFirstInlineStyleSheet(view, toolbox) {
function* testFirstInlineStyleSheet(view, toolbox, testActor) {
info("Testing inline stylesheet");
info("Listening for toolbox switch to the styleeditor");
@ -90,10 +85,10 @@ function* testFirstInlineStyleSheet(view, toolbox) {
ok(true, "Switched to the style-editor panel in the toolbox");
validateStyleEditorSheet(editor, 0);
yield validateStyleEditorSheet(editor, 0, testActor);
}
function* testSecondInlineStyleSheet(view, toolbox) {
function* testSecondInlineStyleSheet(view, toolbox, testActor) {
info("Testing second inline stylesheet");
info("Waiting for the stylesheet editor to be selected");
@ -109,10 +104,10 @@ function* testSecondInlineStyleSheet(view, toolbox) {
is(toolbox.currentToolId, "styleeditor",
"The style editor is selected again");
validateStyleEditorSheet(editor, 1);
yield validateStyleEditorSheet(editor, 1, testActor);
}
function* testExternalStyleSheet(view, toolbox) {
function* testExternalStyleSheet(view, toolbox, testActor) {
info("Testing external stylesheet");
info("Waiting for the stylesheet editor to be selected");
@ -128,13 +123,15 @@ function* testExternalStyleSheet(view, toolbox) {
is(toolbox.currentToolId, "styleeditor",
"The style editor is selected again");
validateStyleEditorSheet(editor, 2);
yield validateStyleEditorSheet(editor, 2, testActor);
}
function validateStyleEditorSheet(editor, expectedSheetIndex) {
function* validateStyleEditorSheet(editor, expectedSheetIndex, testActor) {
info("Validating style editor stylesheet");
let sheet = content.document.styleSheets[expectedSheetIndex];
is(editor.styleSheet.href, sheet.href,
let expectedHref = yield testActor.eval(`
document.styleSheets[${expectedSheetIndex}].href;
`);
is(editor.styleSheet.href, expectedHref,
"loaded stylesheet matches document stylesheet");
}

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

@ -1,9 +1,6 @@
<html>
<head>
<title>test</title>
<script type="application/javascript;version=1.7">
</script>
<style>
div {
width: 1000px;

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

@ -1,6 +1,8 @@
/* 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/ */
/* eslint no-unused-vars: [2, {"vars": "local"}] */
/* import-globals-from ../../test/head.js */
"use strict";
// Import the inspector's head.js first (which itself imports shared-head.js).
@ -80,7 +82,7 @@ function getComputedViewPropertyView(view, name) {
* @return {Promise} A promise that resolves to the property matched rules
* container
*/
var getComputedViewMatchedRules = Task.async(function*(view, name) {
var getComputedViewMatchedRules = Task.async(function* (view, name) {
let expander;
let propertyContent;
for (let property of view.styleDocument.querySelectorAll(".property-view")) {

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

@ -11,28 +11,25 @@ const TEST_DATA_URI = "data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACwAAAAAAQA
// Invalid URL still needs to be reachable otherwise getImageDataUrl will
// timeout. DevTools chrome:// URLs aren't content accessible, so use some
// random resource:// URL here.
const INVALID_IMAGE_URI =
"resource://devtools/client/definitions.js";
const INVALID_IMAGE_URI = "resource://devtools/client/definitions.js";
const ERROR_MESSAGE = Services.strings
.createBundle(PROPERTIES_URL)
.GetStringFromName("styleinspector.copyImageDataUrlError");
add_task(function*() {
const PAGE_CONTENT = [
"<style type=\"text/css\">",
" .valid-background {",
" background-image: url(" + TEST_DATA_URI + ");",
" }",
" .invalid-background {",
" background-image: url(" + INVALID_IMAGE_URI + ");",
" }",
"</style>",
"<div class=\"valid-background\">Valid background image</div>",
"<div class=\"invalid-background\">Invalid background image</div>"
].join("\n");
add_task(function* () {
const TEST_URI = `<style type="text/css">
.valid-background {
background-image: url(${TEST_DATA_URI});
}
.invalid-background {
background-image: url(${INVALID_IMAGE_URI});
}
</style>
<div class="valid-background">Valid background image</div>
<div class="invalid-background">Invalid background image</div>`;
yield addTab("data:text/html;charset=utf8," + encodeURIComponent(PAGE_CONTENT));
yield addTab("data:text/html;charset=utf8," + encodeURIComponent(TEST_URI));
yield startTest();
});
@ -42,28 +39,39 @@ function* startTest() {
let {inspector, view} = yield openRuleView();
info("Test valid background image URL in rule view");
yield testCopyUrlToClipboard({view, inspector}, "data-uri", ".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "url", ".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "data-uri",
".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "url",
".valid-background", TEST_DATA_URI);
info("Test invalid background image URL in rue view");
yield testCopyUrlToClipboard({view, inspector}, "data-uri", ".invalid-background", ERROR_MESSAGE);
yield testCopyUrlToClipboard({view, inspector}, "url", ".invalid-background", INVALID_IMAGE_URI);
yield testCopyUrlToClipboard({view, inspector}, "data-uri",
".invalid-background", ERROR_MESSAGE);
yield testCopyUrlToClipboard({view, inspector}, "url",
".invalid-background", INVALID_IMAGE_URI);
info("Opening computed view");
view = selectComputedView(inspector);
info("Test valid background image URL in computed view");
yield testCopyUrlToClipboard({view, inspector}, "data-uri", ".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "url", ".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "data-uri",
".valid-background", TEST_DATA_URI);
yield testCopyUrlToClipboard({view, inspector}, "url",
".valid-background", TEST_DATA_URI);
info("Test invalid background image URL in computed view");
yield testCopyUrlToClipboard({view, inspector}, "data-uri", ".invalid-background", ERROR_MESSAGE);
yield testCopyUrlToClipboard({view, inspector}, "url", ".invalid-background", INVALID_IMAGE_URI);
yield testCopyUrlToClipboard({view, inspector}, "data-uri",
".invalid-background", ERROR_MESSAGE);
yield testCopyUrlToClipboard({view, inspector}, "url",
".invalid-background", INVALID_IMAGE_URI);
}
function* testCopyUrlToClipboard({view, inspector}, type, selector, expected) {
info("Select node in inspector panel");
yield selectNode(selector, inspector);
info("Retrieve background-image link for selected node in current styleinspector view");
info("Retrieve background-image link for selected node in current " +
"styleinspector view");
let property = getBackgroundImageProperty(view, selector);
let imageLink = property.valueSpan.querySelector(".theme-link");
ok(imageLink, "Background-image link element found");
@ -71,26 +79,36 @@ function* testCopyUrlToClipboard({view, inspector}, type, selector, expected) {
info("Simulate right click on the background-image URL");
let popup = once(view._contextmenu._menupopup, "popupshown");
// Cannot rely on synthesizeMouseAtCenter here. The image URL can be displayed on several lines.
// A click simulated at the exact center may click between the lines and miss the target
// Instead, using the top-left corner of first client rect, with an offset of 2 pixels.
// Cannot rely on synthesizeMouseAtCenter here. The image URL can be displayed
// on several lines. A click simulated at the exact center may click between
// the lines and miss the target. Instead, using the top-left corner of first
// client rect, with an offset of 2 pixels.
let rect = imageLink.getClientRects()[0];
let x = rect.left + 2;
let y = rect.top + 2;
EventUtils.synthesizeMouseAtPoint(x, y, {button: 2, type: "contextmenu"}, getViewWindow(view));
EventUtils.synthesizeMouseAtPoint(x, y, {
button: 2,
type: "contextmenu"
}, getViewWindow(view));
yield popup;
info("Context menu is displayed");
ok(!view._contextmenu.menuitemCopyUrl.hidden, "\"Copy URL\" menu entry is displayed");
ok(!view._contextmenu.menuitemCopyImageDataUrl.hidden, "\"Copy Image Data-URL\" menu entry is displayed");
ok(!view._contextmenu.menuitemCopyUrl.hidden,
"\"Copy URL\" menu entry is displayed");
ok(!view._contextmenu.menuitemCopyImageDataUrl.hidden,
"\"Copy Image Data-URL\" menu entry is displayed");
if (type == "data-uri") {
info("Click Copy Data URI and wait for clipboard");
yield waitForClipboard(() => view._contextmenu.menuitemCopyImageDataUrl.click(), expected);
yield waitForClipboard(() => {
return view._contextmenu.menuitemCopyImageDataUrl.click();
}, expected);
} else {
info("Click Copy URL and wait for clipboard");
yield waitForClipboard(() => view._contextmenu.menuitemCopyUrl.click(), expected);
yield waitForClipboard(() => {
return view._contextmenu.menuitemCopyUrl.click();
}, expected);
}
info("Hide context menu");
@ -101,9 +119,8 @@ function getBackgroundImageProperty(view, selector) {
let isRuleView = view instanceof CssRuleView;
if (isRuleView) {
return getRuleViewProperty(view, selector, "background-image");
} else {
return getComputedViewProperty(view, "background-image");
}
return getComputedViewProperty(view, "background-image");
}
/**

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

@ -20,7 +20,7 @@ var ssm = Components.classes["@mozilla.org/scriptsecuritymanager;1"]
.getService(Ci.nsIScriptSecurityManager);
const XUL_PRINCIPAL = ssm.createCodebasePrincipal(XUL_URI, {});
add_task(function*() {
add_task(function* () {
requestLongerTimeout(2);
info("Checking stylesheets on HTML document");

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

@ -145,7 +145,9 @@ const TEST_DATA = [
},
{
name: "background",
value: "linear-gradient(to right, rgba(183,222,237,1) 0%, rgba(33,180,226,1) 30%, rgba(31,170,217,.5) 44%, #F06 75%, red 100%)",
value: "linear-gradient(to right, rgba(183,222,237,1) 0%, " +
"rgba(33,180,226,1) 30%, rgba(31,170,217,.5) 44%, " +
"#F06 75%, red 100%)",
test: fragment => {
is(countAll(fragment), 10);
let allSwatches = fragment.querySelectorAll("." + COLOR_CLASS);
@ -159,7 +161,8 @@ const TEST_DATA = [
},
{
name: "background",
value: "-moz-radial-gradient(center 45deg, circle closest-side, orange 0%, red 100%)",
value: "-moz-radial-gradient(center 45deg, circle closest-side, " +
"orange 0%, red 100%)",
test: fragment => {
is(countAll(fragment), 6);
let colorSwatches = fragment.querySelectorAll("." + COLOR_CLASS);
@ -207,10 +210,12 @@ const TEST_DATA = [
},
{
name: "background-image",
value: "url(../../../look/at/this/folder/structure/../../red.blue.green.svg )",
value: "url(../../../look/at/this/folder/structure/../" +
"../red.blue.green.svg )",
test: fragment => {
is(countAll(fragment), 1);
is(getUrl(fragment), "../../../look/at/this/folder/structure/../../red.blue.green.svg");
is(getUrl(fragment), "../../../look/at/this/folder/structure/../" +
"../red.blue.green.svg");
}
},
{
@ -290,7 +295,7 @@ const TEST_DATA = [
}
];
add_task(function*() {
add_task(function* () {
let parser = new OutputParser(document);
for (let i = 0; i < TEST_DATA.length; i++) {
let data = TEST_DATA[i];

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

@ -11,7 +11,7 @@ const TEST_URI = `
<div id="two" style="color:blue;">two</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();

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

@ -25,7 +25,7 @@ const TEST_URI = `
<div class="test-element">test element</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();

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

@ -8,7 +8,7 @@
const TEST_URI = "<div class='one'>el 1</div><div class='two'>el 2</div>";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".one", inspector);

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

@ -17,7 +17,7 @@ const TEST_URI = `
<div id="testElement">test element</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("#testElement", inspector);
@ -109,7 +109,7 @@ function* testExpandedComputedViewProperty(computedView, nodeFront) {
function getPropertyView(computedView, name) {
let propertyView = null;
computedView.propertyViews.some(function(view) {
computedView.propertyViews.some(function (view) {
if (view.name == name) {
propertyView = view;
return true;

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

@ -6,26 +6,15 @@
// Test for bug 1026921: Ensure the URL of hovered url() node is used instead
// of the first found from the declaration as there might be multiple urls.
var YELLOW_DOT = "data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAACX" +
"BIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYcDCwCr0o5ngAAABl0RVh0Q29tbWVudABDcmVh" +
"dGVkIHdpdGggR0lNUFeBDhcAAAANSURBVAjXY/j/n6EeAAd9An7Z55GEAAAAAElFTkSuQmCC";
var BLUE_DOT = "data:image/png;base64," +
"iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAACX" +
"BIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYcDCwlCkCM9QAAABl0RVh0Q29tbWVudABDcmVh" +
"dGVkIHdpdGggR0lNUFeBDhcAAAANSURBVAjXY2Bg+F8PAAKCAX/tPkrkAAAAAElFTkSuQmCC";
const YELLOW_DOT = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYcDCwCr0o5ngAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAANSURBVAjXY/j/n6EeAAd9An7Z55GEAAAAAElFTkSuQmCC";
const BLUE_DOT = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAABmJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH3gYcDCwlCkCM9QAAABl0RVh0Q29tbWVudABDcmVhdGVkIHdpdGggR0lNUFeBDhcAAAANSURBVAjXY2Bg+F8PAAKCAX/tPkrkAAAAAElFTkSuQmCC";
const TEST_STYLE = `h1 {background: url(${YELLOW_DOT}), url(${BLUE_DOT});}`;
const TEST_URI = `<style>${TEST_STYLE}</style><h1>test element</h1>`;
add_task(function* () {
let TEST_STYLE = "h1 {background: url(" + YELLOW_DOT + "), url(" + BLUE_DOT + ");}";
let PAGE_CONTENT = "<style>" + TEST_STYLE + "</style>" +
"<h1>browser_styleinspector_tooltip-multiple-background-images.js</h1>";
yield addTab("data:text/html;charset=utf-8,background image tooltip test");
content.document.body.innerHTML = PAGE_CONTENT;
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector} = yield openInspector();
yield testRuleViewUrls(inspector);
yield testComputedViewUrls(inspector);
});

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

@ -15,7 +15,7 @@ const TEST_URI = `
<div id="testElement">test element</div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();

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

@ -17,7 +17,7 @@ const TEST_URI = `
<div></div>
`;
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode("div", inspector);

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

@ -17,7 +17,7 @@ const TEST_URI = `
const TYPE = "CssTransformHighlighter";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();

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

@ -19,7 +19,7 @@ const TEST_URI = `
var TYPE = "CssTransformHighlighter";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
let hs = view.highlighters;

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

@ -25,7 +25,7 @@ const TEST_URI = `
const TYPE = "CssTransformHighlighter";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
@ -34,18 +34,18 @@ add_task(function*() {
isShown: false,
nodeFront: null,
nbOfTimesShown: 0,
show: function(nodeFront) {
show: function (nodeFront) {
this.nodeFront = nodeFront;
this.isShown = true;
this.nbOfTimesShown ++;
return promise.resolve(true);
},
hide: function() {
hide: function () {
this.nodeFront = null;
this.isShown = false;
return promise.resolve();
},
finalize: function() {}
finalize: function () {}
};
// Inject the mock highlighter in the rule-view

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

@ -27,7 +27,7 @@ const TEST_URI = `
const TYPE = "CssTransformHighlighter";
add_task(function*() {
add_task(function* () {
yield addTab("data:text/html;charset=utf-8," + encodeURIComponent(TEST_URI));
let {inspector, view} = yield openRuleView();
yield selectNode(".test", inspector);

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

@ -3,30 +3,26 @@
<html>
<head>
<title>authored sheet test</title>
<style>
#target {
color: chartreuse;
}
</style>
<script>
var gIOService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(SpecialPowers.Ci.nsIIOService)
var style = "data:text/css,div { background-color: seagreen; }";
var uri = gIOService.newURI(style, null, null);
var windowUtils = SpecialPowers.wrap(window)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
windowUtils.loadSheet(uri, windowUtils.AUTHOR_SHEET);
"use strict";
var gIOService = SpecialPowers.Cc["@mozilla.org/network/io-service;1"]
.getService(SpecialPowers.Ci.nsIIOService);
var style = "data:text/css,div { background-color: seagreen; }";
var uri = gIOService.newURI(style, null, null);
var windowUtils = SpecialPowers.wrap(window)
.QueryInterface(SpecialPowers.Ci.nsIInterfaceRequestor)
.getInterface(SpecialPowers.Ci.nsIDOMWindowUtils);
windowUtils.loadSheet(uri, windowUtils.AUTHOR_SHEET);
</script>
</head>
<body>
<div id="target"> the ocean </div>
<input type=text placeholder=test></input>
<input type=color></input>
<input type=range></input>

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

@ -1,20 +1,19 @@
<html>
<head>
<title>test</title>
<link href="./doc_content_stylesheet_linked.css" rel="stylesheet" type="text/css">
<script>
/* exported loadCSS */
"use strict";
// Load script.css
function loadCSS() {
var link = document.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
let link = document.createElement("link");
link.rel = "stylesheet";
link.type = "text/css";
link.href = "./doc_content_stylesheet_script.css";
document.getElementsByTagName('head')[0].appendChild(link);
document.getElementsByTagName("head")[0].appendChild(link);
}
</script>
<style>
table {
border: 1px solid #000;

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

@ -1,6 +1,7 @@
/* 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/ */
/* globals addMessageListener, sendAsyncMessage */
"use strict";
@ -10,12 +11,12 @@
// then execute code upon receiving, and immediately send back a message.
// This is so that chrome test code can execute code in content and wait for a
// response this way:
// let response = yield executeInContent(browser, "Test:MessageName", data, true);
// The response message should have the same name "Test:MessageName"
// let response = yield executeInContent(browser, "Test:MsgName", data, true);
// The response message should have the same name "Test:MsgName"
//
// Some listeners do not send a response message back.
var {classes: Cc, interfaces: Ci, utils: Cu, results: Cr} = Components;
var {classes: Cc, interfaces: Ci, utils: Cu} = Components;
var {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
var {CssLogic} = require("devtools/shared/inspector/css-logic");
@ -30,7 +31,7 @@ var promise = require("promise");
* - {String} name
* @return {String} The value, if found, null otherwise
*/
addMessageListener("Test:GetRulePropertyValue", function(msg) {
addMessageListener("Test:GetRulePropertyValue", function (msg) {
let {name, styleSheetIndex, ruleIndex} = msg.data;
let value = null;
@ -55,7 +56,7 @@ addMessageListener("Test:GetRulePropertyValue", function(msg) {
* @param {Object} objects Expects a 'target' CPOW object
* @return {Array} A list of stylesheet info objects
*/
addMessageListener("Test:GetStyleSheetsInfoForNode", function(msg) {
addMessageListener("Test:GetStyleSheetsInfoForNode", function (msg) {
let target = msg.objects.target;
let sheets = [];
@ -82,10 +83,12 @@ addMessageListener("Test:GetStyleSheetsInfoForNode", function(msg) {
* - {String} name: name of the property
* @return {String} The value, if found, null otherwise
*/
addMessageListener("Test:GetComputedStylePropertyValue", function(msg) {
addMessageListener("Test:GetComputedStylePropertyValue", function (msg) {
let {selector, pseudo, name} = msg.data;
let element = content.document.querySelector(selector);
let value = content.document.defaultView.getComputedStyle(element, pseudo).getPropertyValue(name);
let doc = content.document;
let element = doc.querySelector(selector);
let value = content.getComputedStyle(element, pseudo).getPropertyValue(name);
sendAsyncMessage("Test:GetComputedStylePropertyValue", value);
});
@ -98,7 +101,7 @@ addMessageListener("Test:GetComputedStylePropertyValue", function(msg) {
* - {String} name: name of the property
* - {String} expected: the expected value for property
*/
addMessageListener("Test:WaitForComputedStylePropertyValue", function(msg) {
addMessageListener("Test:WaitForComputedStylePropertyValue", function (msg) {
let {selector, pseudo, name, expected} = msg.data;
let element = content.document.querySelector(selector);
waitForSuccess(() => {
@ -108,10 +111,9 @@ addMessageListener("Test:WaitForComputedStylePropertyValue", function(msg) {
return value === expected;
}).then(() => {
sendAsyncMessage("Test:WaitForComputedStylePropertyValue");
})
});
});
var dumpn = msg => dump(msg + "\n");
/**
@ -125,14 +127,14 @@ var dumpn = msg => dump(msg + "\n");
* @return a promise that resolves when the function returned true or rejects
* if the timeout is reached
*/
function waitForSuccess(validatorFn, name="untitled") {
function waitForSuccess(validatorFn, name = "untitled") {
let def = promise.defer();
function wait(validatorFn) {
if (validatorFn()) {
function wait(fn) {
if (fn()) {
def.resolve();
} else {
setTimeout(() => wait(validatorFn), 200);
setTimeout(() => wait(fn), 200);
}
}
wait(validatorFn);

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

@ -1,6 +1,7 @@
/* 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/ */
/* eslint no-unused-vars: [2, {"vars": "local"}] */
/* import-globals-from ../../test/head.js */
"use strict";
@ -77,7 +78,7 @@ registerCleanupFunction(() => {
* script, so they can run on remote targets too.
*/
var _addTab = addTab;
addTab = function(url) {
addTab = function (url) {
return _addTab(url).then(tab => {
info("Loading the helper frame script " + FRAME_SCRIPT_URL);
let browser = tab.linkedBrowser;
@ -125,7 +126,8 @@ function waitForContentMessage(name) {
* @return {Promise} Resolves to the response data if a response is expected,
* immediately resolves otherwise
*/
function executeInContent(name, data={}, objects={}, expectResponse=true) {
function executeInContent(name, data = {}, objects = {},
expectResponse = true) {
info("Sending message " + name + " to content");
let mm = gBrowser.selectedBrowser.messageManager;
@ -184,8 +186,8 @@ function* waitForComputedStyleProperty(selector, pseudo, name, expected) {
*
* @return a promise that resolves to the inplace-editor element when ready
*/
var focusEditableField = Task.async(function*(ruleView, editable, xOffset=1,
yOffset=1, options={}) {
var focusEditableField = Task.async(function* (ruleView, editable, xOffset = 1,
yOffset = 1, options = {}) {
let onFocus = once(editable.parentNode, "focus", true);
info("Clicking on editable field to turn to edit mode");
EventUtils.synthesizeMouse(editable, xOffset, yOffset, options,
@ -211,7 +213,7 @@ var focusEditableField = Task.async(function*(ruleView, editable, xOffset=1,
* @return a promise that resolves when the function returned true or rejects
* if the timeout is reached
*/
function waitForSuccess(validatorFn, name="untitled") {
function waitForSuccess(validatorFn, name = "untitled") {
let def = promise.defer();
function wait(validator) {
@ -236,7 +238,7 @@ function waitForSuccess(validatorFn, name="untitled") {
* The NodeActor that will used to retrieve the dataURL for the
* font family tooltip contents.
*/
var getFontFamilyDataURL = Task.async(function*(font, nodeFront) {
var getFontFamilyDataURL = Task.async(function* (font, nodeFront) {
let fillStyle = (Services.prefs.getCharPref("devtools.theme") === "light") ?
"black" : "white";
@ -372,7 +374,7 @@ function getRuleViewSelectorHighlighterIcon(view, selectorText) {
* - {String} value The expected style value
* The style will be checked like so: getComputedStyle(element)[name] === value
*/
var simulateColorPickerChange = Task.async(function*(ruleView, colorPicker,
var simulateColorPickerChange = Task.async(function* (ruleView, colorPicker,
newRgba, expectedChange) {
let onRuleViewChanged = ruleView.once("ruleview-changed");
info("Getting the spectrum colorpicker object");
@ -447,7 +449,7 @@ function getRuleViewRuleEditor(view, childrenIndex, nodeIndex) {
* @return a promise that resolves to the newly created editor when ready and
* focused
*/
var focusNewRuleViewProperty = Task.async(function*(ruleEditor) {
var focusNewRuleViewProperty = Task.async(function* (ruleEditor) {
info("Clicking on a close ruleEditor brace to start editing a new property");
ruleEditor.closeBrace.scrollIntoView();
let editor = yield focusEditableField(ruleEditor.ruleView,
@ -472,7 +474,7 @@ var focusNewRuleViewProperty = Task.async(function*(ruleEditor) {
* @return a promise that resolves when the new property name has been entered
* and once the value field is focused
*/
var createNewRuleViewProperty = Task.async(function*(ruleEditor, inputValue) {
var createNewRuleViewProperty = Task.async(function* (ruleEditor, inputValue) {
info("Creating a new property editor");
let editor = yield focusNewRuleViewProperty(ruleEditor);
@ -496,7 +498,7 @@ var createNewRuleViewProperty = Task.async(function*(ruleEditor, inputValue) {
* @return a promise that resolves when the rule-view is filtered for the
* search term
*/
var setSearchFilter = Task.async(function*(view, searchValue) {
var setSearchFilter = Task.async(function* (view, searchValue) {
info("Setting filter text to \"" + searchValue + "\"");
let win = view.styleWindow;
let searchField = view.searchField;

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

@ -1,7 +1,9 @@
[DEFAULT]
tags = devtools
subsuite = devtools
skip-if = (!e10s && debug) # Bug 1262416 - Intermittent crash at MessageLoop::DeletePendingTasks
# !e10s debug: Bug 1262416 - Intermittent crash at MessageLoop::DeletePendingTasks
# OSX debug e10s: Bug 1268319 - Leaking the world
skip-if = (!e10s && debug) || (os == 'mac' && e10s && debug)
support-files =
devices.json
head.js

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

@ -8,67 +8,63 @@
const TEST_URI = "http://example.com/browser/devtools/client/" +
"webconsole/test/test-bug-585956-console-trace.html";
function test() {
Task.spawn(runner).then(finishTest);
add_task(function* () {
let {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
let hud = yield openConsole(tab);
function* runner() {
let {tab} = yield loadTab("data:text/html;charset=utf8,<p>hello");
let hud = yield openConsole(tab);
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, TEST_URI);
content.location = TEST_URI;
let [result] = yield waitForMessages({
webconsole: hud,
messages: [{
name: "console.trace output",
consoleTrace: {
file: "test-bug-585956-console-trace.html",
fn: "window.foobar585956c",
},
}],
});
let node = [...result.matched][0];
ok(node, "found trace log node");
let obj = node._messageObject;
ok(obj, "console.trace message object");
// The expected stack trace object.
let stacktrace = [
{
columnNumber: 3,
filename: TEST_URI,
functionName: "window.foobar585956c",
language: 2,
lineNumber: 9
let [result] = yield waitForMessages({
webconsole: hud,
messages: [{
name: "console.trace output",
consoleTrace: {
file: "test-bug-585956-console-trace.html",
fn: "window.foobar585956c",
},
{
columnNumber: 10,
filename: TEST_URI,
functionName: "foobar585956b",
language: 2,
lineNumber: 14
},
{
columnNumber: 10,
filename: TEST_URI,
functionName: "foobar585956a",
language: 2,
lineNumber: 18
},
{
columnNumber: 1,
filename: TEST_URI,
functionName: "",
language: 2,
lineNumber: 21
}
];
}],
});
ok(obj._stacktrace, "found stacktrace object");
is(obj._stacktrace.toSource(), stacktrace.toSource(),
"stacktrace is correct");
isnot(node.textContent.indexOf("bug-585956"), -1, "found file name");
}
}
let node = [...result.matched][0];
ok(node, "found trace log node");
let obj = node._messageObject;
ok(obj, "console.trace message object");
// The expected stack trace object.
let stacktrace = [
{
columnNumber: 3,
filename: TEST_URI,
functionName: "window.foobar585956c",
language: 2,
lineNumber: 9
},
{
columnNumber: 10,
filename: TEST_URI,
functionName: "foobar585956b",
language: 2,
lineNumber: 14
},
{
columnNumber: 10,
filename: TEST_URI,
functionName: "foobar585956a",
language: 2,
lineNumber: 18
},
{
columnNumber: 1,
filename: TEST_URI,
functionName: "",
language: 2,
lineNumber: 21
}
];
ok(obj._stacktrace, "found stacktrace object");
is(obj._stacktrace.toSource(), stacktrace.toSource(),
"stacktrace is correct");
isnot(node.textContent.indexOf("bug-585956"), -1, "found file name");
});

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

@ -12,32 +12,28 @@ const TEST_URI = "data:text/html;charset=utf-8,<div style='font-size:3em;" +
* Unit test for bug 589162:
* CSS filtering on the console does not work
*/
function test() {
Task.spawn(runner).then(finishTest);
add_task(function* () {
let {tab} = yield loadTab(TEST_URI);
let hud = yield openConsole(tab);
function* runner() {
let {tab} = yield loadTab(TEST_URI);
let hud = yield openConsole(tab);
// CSS warnings are disabled by default.
hud.setFilterState("cssparser", true);
hud.jsterm.clearOutput();
// CSS warnings are disabled by default.
hud.setFilterState("cssparser", true);
hud.jsterm.clearOutput();
BrowserReload();
content.location.reload();
yield waitForMessages({
webconsole: hud,
messages: [{
text: "foobarCssParser",
category: CATEGORY_CSS,
severity: SEVERITY_WARNING,
}],
});
yield waitForMessages({
webconsole: hud,
messages: [{
text: "foobarCssParser",
category: CATEGORY_CSS,
severity: SEVERITY_WARNING,
}],
});
hud.setFilterState("cssparser", false);
hud.setFilterState("cssparser", false);
let msg = "the unknown CSS property warning is not displayed, " +
"after filtering";
testLogEntry(hud.outputNode, "foobarCssParser", msg, true, true);
}
}
let msg = "the unknown CSS property warning is not displayed, " +
"after filtering";
testLogEntry(hud.outputNode, "foobarCssParser", msg, true, true);
});

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

@ -100,7 +100,7 @@ add_task(function* () {
function* checkForMessage(curTest, hud) {
hud.jsterm.clearOutput();
content.location = curTest.url;
BrowserTestUtils.loadURI(gBrowser.selectedBrowser, curTest.url);
let results = yield waitForMessages({
webconsole: hud,

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

@ -1567,14 +1567,17 @@ function checkOutputForInputs(hud, inputTests) {
function onTabOpen(entry, {resolve, reject}, event) {
container.removeEventListener("TabOpen", entry._onTabOpen, true);
entry._onTabOpen = null;
let tab = event.target;
let browser = gBrowser.getBrowserForTab(tab);
loadBrowser(browser).then(() => {
let uri = content.location.href;
Task.spawn(function* () {
yield loadBrowser(browser);
let uri = yield ContentTask.spawn(browser, {}, function* () {
return content.location.href;
});
ok(entry.expectedTab && entry.expectedTab == uri,
"opened tab '" + uri + "', expected tab '" + entry.expectedTab + "'");
return closeTab(tab);
yield closeTab(tab);
}).then(resolve, reject);
}

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

@ -504,6 +504,7 @@ class RefTest(object):
# TODO: bug 913975 : _processOutput should call self.processOutputLine
# one more time one timeout (I think)
self.log.error("%s | application timed out after %d seconds with no output" % (self.lastTestSeen, int(timeout)))
self.log.warning("Force-terminating active process(es).");
self.killAndGetStack(
proc, utilityPath, debuggerInfo, dump_screen=not debuggerInfo)

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

@ -162,6 +162,7 @@ class MuletReftest(RefTest):
def _on_timeout(self):
msg = "%s | application timed out after %s seconds with no output"
self.log.testFail(msg % (self.last_test, self.timeout))
self.log.warning("Force-terminating active process(es).");
# kill process to get a stack
self.runner.stop(sig=signal.SIGABRT)

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

@ -2447,6 +2447,7 @@ class MochitestDesktop(MochitestBase):
self.message_logger.dump_buffered()
self.message_logger.buffering = False
self.log.info(error_message)
self.log.warning("Force-terminating active process(es).");
browser_pid = browser_pid or proc.pid
child_pids = self.extract_child_pids(processLog, browser_pid)