forked from mirrors/gecko-dev
Bug 1596056 - Format reftest harness files with Prettier. r=tnikkel
Depends on D189056 Differential Revision: https://phabricator.services.mozilla.com/D189057
This commit is contained in:
parent
3dd3f97545
commit
b8dcda2dd2
16 changed files with 6189 additions and 5213 deletions
|
|
@ -1000,6 +1000,8 @@ uriloader/exthandler/tests/mochitest/save_filenames.html
|
|||
# Also ignore reftest - specially crafted to produce expected output.
|
||||
**/reftest/
|
||||
**/reftests/
|
||||
# Don't ignore the reftest harness files.
|
||||
!/layout/tools/reftest/
|
||||
|
||||
# Exclude expected objdirs.
|
||||
obj*/
|
||||
|
|
|
|||
|
|
@ -1,20 +1,28 @@
|
|||
var EXPORTED_SYMBOLS = ["ReftestFissionChild"];
|
||||
|
||||
class ReftestFissionChild extends JSWindowActorChild {
|
||||
|
||||
forwardAfterPaintEventToParent(rects, originalTargetUri, dispatchToSelfAsWell) {
|
||||
forwardAfterPaintEventToParent(
|
||||
rects,
|
||||
originalTargetUri,
|
||||
dispatchToSelfAsWell
|
||||
) {
|
||||
if (dispatchToSelfAsWell) {
|
||||
let event = new this.contentWindow.CustomEvent("Reftest:MozAfterPaintFromChild",
|
||||
{bubbles: true, detail: {rects, originalTargetUri}});
|
||||
let event = new this.contentWindow.CustomEvent(
|
||||
"Reftest:MozAfterPaintFromChild",
|
||||
{ bubbles: true, detail: { rects, originalTargetUri } }
|
||||
);
|
||||
this.contentWindow.dispatchEvent(event);
|
||||
}
|
||||
|
||||
let parentContext = this.browsingContext.parent;
|
||||
if (parentContext) {
|
||||
try {
|
||||
this.sendAsyncMessage("ForwardAfterPaintEvent",
|
||||
{toBrowsingContext: parentContext, fromBrowsingContext: this.browsingContext,
|
||||
rects, originalTargetUri});
|
||||
this.sendAsyncMessage("ForwardAfterPaintEvent", {
|
||||
toBrowsingContext: parentContext,
|
||||
fromBrowsingContext: this.browsingContext,
|
||||
rects,
|
||||
originalTargetUri,
|
||||
});
|
||||
} catch (e) {
|
||||
// |this| can be destroyed here and unable to send messages, which is
|
||||
// not a problem, the reftest harness probably torn down the page and
|
||||
|
|
@ -32,24 +40,33 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
// code (reftest-content.js) will process it and update the canvas.
|
||||
var rects = [];
|
||||
for (let r of evt.clientRects) {
|
||||
rects.push({ left: r.left, top: r.top, right: r.right, bottom: r.bottom });
|
||||
rects.push({
|
||||
left: r.left,
|
||||
top: r.top,
|
||||
right: r.right,
|
||||
bottom: r.bottom,
|
||||
});
|
||||
}
|
||||
this.forwardAfterPaintEventToParent(rects, this.document.documentURI, /* dispatchToSelfAsWell */ false);
|
||||
this.forwardAfterPaintEventToParent(
|
||||
rects,
|
||||
this.document.documentURI,
|
||||
/* dispatchToSelfAsWell */ false
|
||||
);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
transformRect(transform, rect) {
|
||||
let p1 = transform.transformPoint({x: rect.left, y: rect.top});
|
||||
let p2 = transform.transformPoint({x: rect.right, y: rect.top});
|
||||
let p3 = transform.transformPoint({x: rect.left, y: rect.bottom});
|
||||
let p4 = transform.transformPoint({x: rect.right, y: rect.bottom});
|
||||
let p1 = transform.transformPoint({ x: rect.left, y: rect.top });
|
||||
let p2 = transform.transformPoint({ x: rect.right, y: rect.top });
|
||||
let p3 = transform.transformPoint({ x: rect.left, y: rect.bottom });
|
||||
let p4 = transform.transformPoint({ x: rect.right, y: rect.bottom });
|
||||
let quad = new DOMQuad(p1, p2, p3, p4);
|
||||
return quad.getBounds();
|
||||
}
|
||||
|
||||
SetupDisplayportRoot() {
|
||||
let returnStrings = {infoStrings: [], errorStrings: []};
|
||||
let returnStrings = { infoStrings: [], errorStrings: [] };
|
||||
|
||||
let contentRootElement = this.contentWindow.document.documentElement;
|
||||
if (!contentRootElement) {
|
||||
|
|
@ -60,15 +77,22 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
// the root element for potential display ports to set.
|
||||
if (!contentRootElement.hasAttribute("reftest-async-scroll")) {
|
||||
let winUtils = this.contentWindow.windowUtils;
|
||||
this.setupDisplayportForElement(contentRootElement, winUtils, returnStrings);
|
||||
this.setupDisplayportForElement(
|
||||
contentRootElement,
|
||||
winUtils,
|
||||
returnStrings
|
||||
);
|
||||
return Promise.resolve(returnStrings);
|
||||
}
|
||||
|
||||
// Send a msg to the parent side to get the parent side to tell all
|
||||
// process roots to do the displayport setting.
|
||||
let browsingContext = this.browsingContext;
|
||||
let promise = this.sendQuery("TellChildrenToSetupDisplayport", {browsingContext});
|
||||
return promise.then(function(result) {
|
||||
let promise = this.sendQuery("TellChildrenToSetupDisplayport", {
|
||||
browsingContext,
|
||||
});
|
||||
return promise.then(
|
||||
function (result) {
|
||||
for (let errorString of result.errorStrings) {
|
||||
returnStrings.errorStrings.push(errorString);
|
||||
}
|
||||
|
|
@ -77,14 +101,19 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
}
|
||||
return returnStrings;
|
||||
},
|
||||
function(reason) {
|
||||
returnStrings.errorStrings.push("SetupDisplayport SendQuery to parent promise rejected: " + reason);
|
||||
function (reason) {
|
||||
returnStrings.errorStrings.push(
|
||||
"SetupDisplayport SendQuery to parent promise rejected: " + reason
|
||||
);
|
||||
return returnStrings;
|
||||
});
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
attrOrDefault(element, attr, def) {
|
||||
return element.hasAttribute(attr) ? Number(element.getAttribute(attr)) : def;
|
||||
return element.hasAttribute(attr)
|
||||
? Number(element.getAttribute(attr))
|
||||
: def;
|
||||
}
|
||||
|
||||
setupDisplayportForElement(element, winUtils, returnStrings) {
|
||||
|
|
@ -93,7 +122,17 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
var dpx = this.attrOrDefault(element, "reftest-displayport-x", 0);
|
||||
var dpy = this.attrOrDefault(element, "reftest-displayport-y", 0);
|
||||
if (dpw !== 0 || dph !== 0 || dpx != 0 || dpy != 0) {
|
||||
returnStrings.infoStrings.push("Setting displayport to <x="+ dpx +", y="+ dpy +", w="+ dpw +", h="+ dph +">");
|
||||
returnStrings.infoStrings.push(
|
||||
"Setting displayport to <x=" +
|
||||
dpx +
|
||||
", y=" +
|
||||
dpy +
|
||||
", w=" +
|
||||
dpw +
|
||||
", h=" +
|
||||
dph +
|
||||
">"
|
||||
);
|
||||
winUtils.setDisplayPortForElement(dpx, dpy, dpw, dph, element, 1);
|
||||
}
|
||||
}
|
||||
|
|
@ -103,15 +142,27 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
for (let c = element.firstElementChild; c; c = c.nextElementSibling) {
|
||||
this.setupDisplayportForElementSubtree(c, winUtils, returnStrings);
|
||||
}
|
||||
if (typeof element.contentDocument !== "undefined" &&
|
||||
element.contentDocument) {
|
||||
returnStrings.infoStrings.push("setupDisplayportForElementSubtree descending into subdocument");
|
||||
this.setupDisplayportForElementSubtree(element.contentDocument.documentElement,
|
||||
element.contentWindow.windowUtils, returnStrings);
|
||||
if (
|
||||
typeof element.contentDocument !== "undefined" &&
|
||||
element.contentDocument
|
||||
) {
|
||||
returnStrings.infoStrings.push(
|
||||
"setupDisplayportForElementSubtree descending into subdocument"
|
||||
);
|
||||
this.setupDisplayportForElementSubtree(
|
||||
element.contentDocument.documentElement,
|
||||
element.contentWindow.windowUtils,
|
||||
returnStrings
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
setupAsyncScrollOffsetsForElement(element, winUtils, allowFailure, returnStrings) {
|
||||
setupAsyncScrollOffsetsForElement(
|
||||
element,
|
||||
winUtils,
|
||||
allowFailure,
|
||||
returnStrings
|
||||
) {
|
||||
let sx = this.attrOrDefault(element, "reftest-async-scroll-x", 0);
|
||||
let sy = this.attrOrDefault(element, "reftest-async-scroll-y", 0);
|
||||
if (sx != 0 || sy != 0) {
|
||||
|
|
@ -122,27 +173,59 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
return true;
|
||||
} catch (e) {
|
||||
if (allowFailure) {
|
||||
returnStrings.infoStrings.push("setupAsyncScrollOffsetsForElement error calling setAsyncScrollOffset: " + e);
|
||||
returnStrings.infoStrings.push(
|
||||
"setupAsyncScrollOffsetsForElement error calling setAsyncScrollOffset: " +
|
||||
e
|
||||
);
|
||||
} else {
|
||||
returnStrings.errorStrings.push("setupAsyncScrollOffsetsForElement error calling setAsyncScrollOffset: " + e);
|
||||
returnStrings.errorStrings.push(
|
||||
"setupAsyncScrollOffsetsForElement error calling setAsyncScrollOffset: " +
|
||||
e
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
setupAsyncScrollOffsetsForElementSubtree(element, winUtils, allowFailure, returnStrings) {
|
||||
let updatedAny = this.setupAsyncScrollOffsetsForElement(element, winUtils, returnStrings);
|
||||
setupAsyncScrollOffsetsForElementSubtree(
|
||||
element,
|
||||
winUtils,
|
||||
allowFailure,
|
||||
returnStrings
|
||||
) {
|
||||
let updatedAny = this.setupAsyncScrollOffsetsForElement(
|
||||
element,
|
||||
winUtils,
|
||||
returnStrings
|
||||
);
|
||||
for (let c = element.firstElementChild; c; c = c.nextElementSibling) {
|
||||
if (this.setupAsyncScrollOffsetsForElementSubtree(c, winUtils, allowFailure, returnStrings)) {
|
||||
if (
|
||||
this.setupAsyncScrollOffsetsForElementSubtree(
|
||||
c,
|
||||
winUtils,
|
||||
allowFailure,
|
||||
returnStrings
|
||||
)
|
||||
) {
|
||||
updatedAny = true;
|
||||
}
|
||||
}
|
||||
if (typeof element.contentDocument !== "undefined" &&
|
||||
element.contentDocument) {
|
||||
returnStrings.infoStrings.push("setupAsyncScrollOffsetsForElementSubtree Descending into subdocument");
|
||||
if (this.setupAsyncScrollOffsetsForElementSubtree(element.contentDocument.documentElement,
|
||||
element.contentWindow.windowUtils, allowFailure, returnStrings)) {
|
||||
if (
|
||||
typeof element.contentDocument !== "undefined" &&
|
||||
element.contentDocument
|
||||
) {
|
||||
returnStrings.infoStrings.push(
|
||||
"setupAsyncScrollOffsetsForElementSubtree Descending into subdocument"
|
||||
);
|
||||
if (
|
||||
this.setupAsyncScrollOffsetsForElementSubtree(
|
||||
element.contentDocument.documentElement,
|
||||
element.contentWindow.windowUtils,
|
||||
allowFailure,
|
||||
returnStrings
|
||||
)
|
||||
) {
|
||||
updatedAny = true;
|
||||
}
|
||||
}
|
||||
|
|
@ -151,39 +234,48 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
|
||||
async receiveMessage(msg) {
|
||||
switch (msg.name) {
|
||||
case "ForwardAfterPaintEventToSelfAndParent":
|
||||
{
|
||||
case "ForwardAfterPaintEventToSelfAndParent": {
|
||||
// The embedderElement can be null if the child we got this from was removed.
|
||||
// Not much we can do to transform the rects, but it doesn't matter, the rects
|
||||
// won't reach reftest-content.js.
|
||||
if (msg.data.fromBrowsingContext.embedderElement == null) {
|
||||
this.forwardAfterPaintEventToParent(msg.data.rects, msg.data.originalTargetUri,
|
||||
/* dispatchToSelfAsWell */ true);
|
||||
this.forwardAfterPaintEventToParent(
|
||||
msg.data.rects,
|
||||
msg.data.originalTargetUri,
|
||||
/* dispatchToSelfAsWell */ true
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
// Transform the rects from fromBrowsingContext to us.
|
||||
// We first translate from the content rect to the border rect of the iframe.
|
||||
let style = this.contentWindow.getComputedStyle(msg.data.fromBrowsingContext.embedderElement);
|
||||
let style = this.contentWindow.getComputedStyle(
|
||||
msg.data.fromBrowsingContext.embedderElement
|
||||
);
|
||||
let translate = new DOMMatrixReadOnly().translate(
|
||||
parseFloat(style.paddingLeft) + parseFloat(style.borderLeftWidth),
|
||||
parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth));
|
||||
parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth)
|
||||
);
|
||||
|
||||
// Then we transform from the iframe to our root frame.
|
||||
// We are guaranteed to be the process with the embedderElement for fromBrowsingContext.
|
||||
let transform = msg.data.fromBrowsingContext.embedderElement.getTransformToViewport();
|
||||
let transform =
|
||||
msg.data.fromBrowsingContext.embedderElement.getTransformToViewport();
|
||||
let combined = translate.multiply(transform);
|
||||
|
||||
let newrects = msg.data.rects.map(r => this.transformRect(combined, r))
|
||||
let newrects = msg.data.rects.map(r => this.transformRect(combined, r));
|
||||
|
||||
this.forwardAfterPaintEventToParent(newrects, msg.data.originalTargetUri, /* dispatchToSelfAsWell */ true);
|
||||
this.forwardAfterPaintEventToParent(
|
||||
newrects,
|
||||
msg.data.originalTargetUri,
|
||||
/* dispatchToSelfAsWell */ true
|
||||
);
|
||||
break;
|
||||
}
|
||||
|
||||
case "EmptyMessage":
|
||||
return undefined;
|
||||
case "UpdateLayerTree":
|
||||
{
|
||||
case "UpdateLayerTree": {
|
||||
let errorStrings = [];
|
||||
try {
|
||||
if (this.manager.isProcessRoot) {
|
||||
|
|
@ -192,22 +284,23 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
} catch (e) {
|
||||
errorStrings.push("updateLayerTree failed: " + e);
|
||||
}
|
||||
return {errorStrings};
|
||||
return { errorStrings };
|
||||
}
|
||||
case "FlushRendering":
|
||||
{
|
||||
case "FlushRendering": {
|
||||
let errorStrings = [];
|
||||
let warningStrings = [];
|
||||
let infoStrings = [];
|
||||
|
||||
try {
|
||||
let {ignoreThrottledAnimations, needsAnimationFrame} = msg.data;
|
||||
let { ignoreThrottledAnimations, needsAnimationFrame } = msg.data;
|
||||
|
||||
if (this.manager.isProcessRoot) {
|
||||
var anyPendingPaintsGeneratedInDescendants = false;
|
||||
|
||||
if (needsAnimationFrame) {
|
||||
await new Promise(resolve => this.contentWindow.requestAnimationFrame(resolve));
|
||||
await new Promise(resolve =>
|
||||
this.contentWindow.requestAnimationFrame(resolve)
|
||||
);
|
||||
}
|
||||
|
||||
function flushWindow(win) {
|
||||
|
|
@ -228,7 +321,10 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
}
|
||||
|
||||
if (!afterPaintWasPending && utils.isMozAfterPaintPending) {
|
||||
infoStrings.push("FlushRendering generated paint for window " + win.location.href);
|
||||
infoStrings.push(
|
||||
"FlushRendering generated paint for window " +
|
||||
win.location.href
|
||||
);
|
||||
anyPendingPaintsGeneratedInDescendants = true;
|
||||
}
|
||||
|
||||
|
|
@ -249,32 +345,37 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
flushWindow(this.contentWindow);
|
||||
}
|
||||
|
||||
if (anyPendingPaintsGeneratedInDescendants &&
|
||||
!this.contentWindow.windowUtils.isMozAfterPaintPending) {
|
||||
warningStrings.push("Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!");
|
||||
if (
|
||||
anyPendingPaintsGeneratedInDescendants &&
|
||||
!this.contentWindow.windowUtils.isMozAfterPaintPending
|
||||
) {
|
||||
warningStrings.push(
|
||||
"Internal error: descendant frame generated a MozAfterPaint event, but the root document doesn't have one!"
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
errorStrings.push("flushWindow failed: " + e);
|
||||
}
|
||||
return {errorStrings, warningStrings, infoStrings};
|
||||
return { errorStrings, warningStrings, infoStrings };
|
||||
}
|
||||
|
||||
case "SetupDisplayport":
|
||||
{
|
||||
case "SetupDisplayport": {
|
||||
let contentRootElement = this.document.documentElement;
|
||||
let winUtils = this.contentWindow.windowUtils;
|
||||
let returnStrings = {infoStrings: [], errorStrings: []};
|
||||
let returnStrings = { infoStrings: [], errorStrings: [] };
|
||||
if (contentRootElement) {
|
||||
this.setupDisplayportForElementSubtree(contentRootElement, winUtils, returnStrings);
|
||||
this.setupDisplayportForElementSubtree(
|
||||
contentRootElement,
|
||||
winUtils,
|
||||
returnStrings
|
||||
);
|
||||
}
|
||||
return returnStrings;
|
||||
}
|
||||
|
||||
case "SetupAsyncScrollOffsets":
|
||||
{
|
||||
let returns = {infoStrings: [], errorStrings: [], updatedAny: false};
|
||||
case "SetupAsyncScrollOffsets": {
|
||||
let returns = { infoStrings: [], errorStrings: [], updatedAny: false };
|
||||
let contentRootElement = this.document.documentElement;
|
||||
|
||||
if (!contentRootElement) {
|
||||
|
|
@ -283,10 +384,14 @@ class ReftestFissionChild extends JSWindowActorChild {
|
|||
|
||||
let winUtils = this.contentWindow.windowUtils;
|
||||
|
||||
returns.updatedAny = this.setupAsyncScrollOffsetsForElementSubtree(contentRootElement, winUtils, msg.data.allowFailure, returns);
|
||||
returns.updatedAny = this.setupAsyncScrollOffsetsForElementSubtree(
|
||||
contentRootElement,
|
||||
winUtils,
|
||||
msg.data.allowFailure,
|
||||
returns
|
||||
);
|
||||
return returns;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,25 +1,46 @@
|
|||
var EXPORTED_SYMBOLS = ["ReftestFissionParent"];
|
||||
|
||||
class ReftestFissionParent extends JSWindowActorParent {
|
||||
|
||||
tellChildrenToFlushRendering(browsingContext, ignoreThrottledAnimations, needsAnimationFrame) {
|
||||
tellChildrenToFlushRendering(
|
||||
browsingContext,
|
||||
ignoreThrottledAnimations,
|
||||
needsAnimationFrame
|
||||
) {
|
||||
let promises = [];
|
||||
this.tellChildrenToFlushRenderingRecursive(browsingContext, ignoreThrottledAnimations, needsAnimationFrame, promises);
|
||||
this.tellChildrenToFlushRenderingRecursive(
|
||||
browsingContext,
|
||||
ignoreThrottledAnimations,
|
||||
needsAnimationFrame,
|
||||
promises
|
||||
);
|
||||
return Promise.allSettled(promises);
|
||||
}
|
||||
|
||||
tellChildrenToFlushRenderingRecursive(browsingContext, ignoreThrottledAnimations, needsAnimationFrame, promises) {
|
||||
tellChildrenToFlushRenderingRecursive(
|
||||
browsingContext,
|
||||
ignoreThrottledAnimations,
|
||||
needsAnimationFrame,
|
||||
promises
|
||||
) {
|
||||
let cwg = browsingContext.currentWindowGlobal;
|
||||
if (cwg && cwg.isProcessRoot) {
|
||||
let a = cwg.getActor("ReftestFission");
|
||||
if (a) {
|
||||
let responsePromise = a.sendQuery("FlushRendering", {ignoreThrottledAnimations, needsAnimationFrame});
|
||||
let responsePromise = a.sendQuery("FlushRendering", {
|
||||
ignoreThrottledAnimations,
|
||||
needsAnimationFrame,
|
||||
});
|
||||
promises.push(responsePromise);
|
||||
}
|
||||
}
|
||||
|
||||
for (let context of browsingContext.children) {
|
||||
this.tellChildrenToFlushRenderingRecursive(context, ignoreThrottledAnimations, needsAnimationFrame, promises);
|
||||
this.tellChildrenToFlushRenderingRecursive(
|
||||
context,
|
||||
ignoreThrottledAnimations,
|
||||
needsAnimationFrame,
|
||||
promises
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -51,14 +72,16 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
let cwg = browsingContext.currentWindowGlobal;
|
||||
if (!cwg || !cwg.isProcessRoot) {
|
||||
if (cwg) {
|
||||
errorStrings.push("tellChildrenToUpdateLayerTree called on a non process root?");
|
||||
errorStrings.push(
|
||||
"tellChildrenToUpdateLayerTree called on a non process root?"
|
||||
);
|
||||
}
|
||||
return {errorStrings, infoStrings};
|
||||
return { errorStrings, infoStrings };
|
||||
}
|
||||
|
||||
let actor = cwg.getActor("ReftestFission");
|
||||
if (!actor) {
|
||||
return {errorStrings, infoStrings};
|
||||
return { errorStrings, infoStrings };
|
||||
}
|
||||
|
||||
// When we paint a document we also update the EffectsInfo visible rect in
|
||||
|
|
@ -77,22 +100,31 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
let result = await actor.sendQuery("UpdateLayerTree");
|
||||
errorStrings.push(...result.errorStrings);
|
||||
} catch (e) {
|
||||
infoStrings.push("tellChildrenToUpdateLayerTree UpdateLayerTree msg to child rejected: " + e);
|
||||
infoStrings.push(
|
||||
"tellChildrenToUpdateLayerTree UpdateLayerTree msg to child rejected: " +
|
||||
e
|
||||
);
|
||||
}
|
||||
|
||||
let descendants = actor.getNearestProcessRootProperDescendants(browsingContext);
|
||||
let descendants =
|
||||
actor.getNearestProcessRootProperDescendants(browsingContext);
|
||||
for (let context of descendants) {
|
||||
let cwg2 = context.currentWindowGlobal;
|
||||
if (cwg2) {
|
||||
if (!cwg2.isProcessRoot) {
|
||||
errorStrings.push("getNearestProcessRootProperDescendants returned a non process root?");
|
||||
errorStrings.push(
|
||||
"getNearestProcessRootProperDescendants returned a non process root?"
|
||||
);
|
||||
}
|
||||
let actor2 = cwg2.getActor("ReftestFission");
|
||||
if (actor2) {
|
||||
try {
|
||||
await actor2.sendQuery("EmptyMessage");
|
||||
} catch(e) {
|
||||
infoStrings.push("tellChildrenToUpdateLayerTree EmptyMessage msg to child rejected: " + e);
|
||||
} catch (e) {
|
||||
infoStrings.push(
|
||||
"tellChildrenToUpdateLayerTree EmptyMessage msg to child rejected: " +
|
||||
e
|
||||
);
|
||||
}
|
||||
|
||||
try {
|
||||
|
|
@ -100,14 +132,16 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
errorStrings.push(...result2.errorStrings);
|
||||
infoStrings.push(...result2.infoStrings);
|
||||
} catch (e) {
|
||||
errorStrings.push("tellChildrenToUpdateLayerTree recursive tellChildrenToUpdateLayerTree call rejected: " + e);
|
||||
errorStrings.push(
|
||||
"tellChildrenToUpdateLayerTree recursive tellChildrenToUpdateLayerTree call rejected: " +
|
||||
e
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return {errorStrings, infoStrings};
|
||||
return { errorStrings, infoStrings };
|
||||
}
|
||||
|
||||
tellChildrenToSetupDisplayport(browsingContext, promises) {
|
||||
|
|
@ -125,38 +159,52 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
}
|
||||
}
|
||||
|
||||
tellChildrenToSetupAsyncScrollOffsets(browsingContext, allowFailure, promises) {
|
||||
tellChildrenToSetupAsyncScrollOffsets(
|
||||
browsingContext,
|
||||
allowFailure,
|
||||
promises
|
||||
) {
|
||||
let cwg = browsingContext.currentWindowGlobal;
|
||||
if (cwg && cwg.isProcessRoot) {
|
||||
let a = cwg.getActor("ReftestFission");
|
||||
if (a) {
|
||||
let responsePromise = a.sendQuery("SetupAsyncScrollOffsets", {allowFailure});
|
||||
let responsePromise = a.sendQuery("SetupAsyncScrollOffsets", {
|
||||
allowFailure,
|
||||
});
|
||||
promises.push(responsePromise);
|
||||
}
|
||||
}
|
||||
|
||||
for (let context of browsingContext.children) {
|
||||
this.tellChildrenToSetupAsyncScrollOffsets(context, allowFailure, promises);
|
||||
this.tellChildrenToSetupAsyncScrollOffsets(
|
||||
context,
|
||||
allowFailure,
|
||||
promises
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
receiveMessage(msg) {
|
||||
switch (msg.name) {
|
||||
case "ForwardAfterPaintEvent":
|
||||
{
|
||||
case "ForwardAfterPaintEvent": {
|
||||
let cwg = msg.data.toBrowsingContext.currentWindowGlobal;
|
||||
if (cwg) {
|
||||
let a = cwg.getActor("ReftestFission");
|
||||
if (a) {
|
||||
a.sendAsyncMessage("ForwardAfterPaintEventToSelfAndParent", msg.data);
|
||||
a.sendAsyncMessage(
|
||||
"ForwardAfterPaintEventToSelfAndParent",
|
||||
msg.data
|
||||
);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case "FlushRendering":
|
||||
{
|
||||
let promise = this.tellChildrenToFlushRendering(msg.data.browsingContext, msg.data.ignoreThrottledAnimations, msg.data.needsAnimationFrame);
|
||||
case "FlushRendering": {
|
||||
let promise = this.tellChildrenToFlushRendering(
|
||||
msg.data.browsingContext,
|
||||
msg.data.ignoreThrottledAnimations,
|
||||
msg.data.needsAnimationFrame
|
||||
);
|
||||
return promise.then(function (results) {
|
||||
let errorStrings = [];
|
||||
let warningStrings = [];
|
||||
|
|
@ -164,11 +212,16 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
for (let r of results) {
|
||||
if (r.status != "fulfilled") {
|
||||
if (r.status == "pending") {
|
||||
errorStrings.push("FlushRendering sendQuery to child promise still pending?");
|
||||
errorStrings.push(
|
||||
"FlushRendering sendQuery to child promise still pending?"
|
||||
);
|
||||
} else {
|
||||
// We expect actors to go away causing sendQuery's to fail, so
|
||||
// just note it.
|
||||
infoStrings.push("FlushRendering sendQuery to child promise rejected: " + r.reason);
|
||||
infoStrings.push(
|
||||
"FlushRendering sendQuery to child promise rejected: " +
|
||||
r.reason
|
||||
);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
|
@ -177,15 +230,13 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
warningStrings.push(...r.value.warningStrings);
|
||||
infoStrings.push(...r.value.infoStrings);
|
||||
}
|
||||
return {errorStrings, warningStrings, infoStrings};
|
||||
return { errorStrings, warningStrings, infoStrings };
|
||||
});
|
||||
}
|
||||
case "UpdateLayerTree":
|
||||
{
|
||||
case "UpdateLayerTree": {
|
||||
return this.tellChildrenToUpdateLayerTree(msg.data.browsingContext);
|
||||
}
|
||||
case "TellChildrenToSetupDisplayport":
|
||||
{
|
||||
case "TellChildrenToSetupDisplayport": {
|
||||
let promises = [];
|
||||
this.tellChildrenToSetupDisplayport(msg.data.browsingContext, promises);
|
||||
return Promise.allSettled(promises).then(function (results) {
|
||||
|
|
@ -195,21 +246,27 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
if (r.status != "fulfilled") {
|
||||
// We expect actors to go away causing sendQuery's to fail, so
|
||||
// just note it.
|
||||
infoStrings.push("SetupDisplayport sendQuery to child promise rejected: " + r.reason);
|
||||
infoStrings.push(
|
||||
"SetupDisplayport sendQuery to child promise rejected: " +
|
||||
r.reason
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
errorStrings.push(...r.value.errorStrings);
|
||||
infoStrings.push(...r.value.infoStrings);
|
||||
}
|
||||
return {errorStrings, infoStrings}
|
||||
return { errorStrings, infoStrings };
|
||||
});
|
||||
}
|
||||
|
||||
case "SetupAsyncScrollOffsets":
|
||||
{
|
||||
case "SetupAsyncScrollOffsets": {
|
||||
let promises = [];
|
||||
this.tellChildrenToSetupAsyncScrollOffsets(this.manager.browsingContext, msg.data.allowFailure, promises);
|
||||
this.tellChildrenToSetupAsyncScrollOffsets(
|
||||
this.manager.browsingContext,
|
||||
msg.data.allowFailure,
|
||||
promises
|
||||
);
|
||||
return Promise.allSettled(promises).then(function (results) {
|
||||
let errorStrings = [];
|
||||
let infoStrings = [];
|
||||
|
|
@ -218,7 +275,10 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
if (r.status != "fulfilled") {
|
||||
// We expect actors to go away causing sendQuery's to fail, so
|
||||
// just note it.
|
||||
infoStrings.push("SetupAsyncScrollOffsets sendQuery to child promise rejected: " + r.reason);
|
||||
infoStrings.push(
|
||||
"SetupAsyncScrollOffsets sendQuery to child promise rejected: " +
|
||||
r.reason
|
||||
);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
|
@ -228,11 +288,9 @@ class ReftestFissionParent extends JSWindowActorParent {
|
|||
updatedAny = true;
|
||||
}
|
||||
}
|
||||
return {errorStrings, infoStrings, updatedAny};
|
||||
return { errorStrings, infoStrings, updatedAny };
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ function processTerminated() {
|
|||
|
||||
function startAndroid(win) {
|
||||
// Add setTimeout here because windows.innerWidth/Height are not set yet.
|
||||
win.setTimeout(function() {
|
||||
win.setTimeout(function () {
|
||||
OnRefTestLoad(win);
|
||||
}, 0);
|
||||
}
|
||||
|
|
@ -125,7 +125,7 @@ this.reftest = class extends ExtensionAPI {
|
|||
"chrome,dialog=no,left=800,height=200,width=200,all",
|
||||
null
|
||||
);
|
||||
dummy.onload = async function() {
|
||||
dummy.onload = async function () {
|
||||
// Close pre-existing window
|
||||
win.close();
|
||||
|
||||
|
|
|
|||
|
|
@ -17,12 +17,12 @@ for (let [key, val] of Object.entries({
|
|||
NS_DIRECTORY_SERVICE_CONTRACTID: "@mozilla.org/file/directory_service;1",
|
||||
NS_OBSERVER_SERVICE_CONTRACTID: "@mozilla.org/observer-service;1",
|
||||
|
||||
TYPE_REFTEST_EQUAL: '==',
|
||||
TYPE_REFTEST_NOTEQUAL: '!=',
|
||||
TYPE_LOAD: 'load', // test without a reference (just test that it does
|
||||
TYPE_REFTEST_EQUAL: "==",
|
||||
TYPE_REFTEST_NOTEQUAL: "!=",
|
||||
TYPE_LOAD: "load", // test without a reference (just test that it does
|
||||
// not assert, crash, hang, or leak)
|
||||
TYPE_SCRIPT: 'script', // test contains individual test results
|
||||
TYPE_PRINT: 'print', // test and reference will be printed to PDF's and
|
||||
TYPE_SCRIPT: "script", // test contains individual test results
|
||||
TYPE_PRINT: "print", // test and reference will be printed to PDF's and
|
||||
// compared structurally
|
||||
|
||||
// keep this in sync with reftest-content.js
|
||||
|
|
@ -50,7 +50,8 @@ for (let [key, val] of Object.entries({
|
|||
FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS: "non-needs-focus",
|
||||
|
||||
// "<!--CLEAR-->"
|
||||
BLANK_URL_FOR_CLEARING: "data:text/html;charset=UTF-8,%3C%21%2D%2DCLEAR%2D%2D%3E",
|
||||
BLANK_URL_FOR_CLEARING:
|
||||
"data:text/html;charset=UTF-8,%3C%21%2D%2DCLEAR%2D%2D%3E",
|
||||
|
||||
/* Globals */
|
||||
g: {
|
||||
|
|
@ -100,9 +101,9 @@ for (let [key, val] of Object.entries({
|
|||
AssertionUnexpected: 0,
|
||||
AssertionUnexpectedFixed: 0,
|
||||
// Known problems...
|
||||
KnownFail : 0,
|
||||
KnownFail: 0,
|
||||
AssertionKnown: 0,
|
||||
Random : 0,
|
||||
Random: 0,
|
||||
Skip: 0,
|
||||
Slow: 0,
|
||||
},
|
||||
|
|
@ -159,7 +160,7 @@ for (let [key, val] of Object.entries({
|
|||
// Only dump the sandbox once, because it doesn't depend on the
|
||||
// manifest URL (yet!).
|
||||
dumpedConditionSandbox: false,
|
||||
}
|
||||
},
|
||||
})) {
|
||||
this[key] = val;
|
||||
EXPORTED_SYMBOLS.push(key);
|
||||
|
|
|
|||
|
|
@ -28,24 +28,25 @@ const {
|
|||
|
||||
g,
|
||||
} = ChromeUtils.import("resource://reftest/globals.jsm");
|
||||
const { NetUtil } = ChromeUtils.importESModule("resource://gre/modules/NetUtil.sys.mjs");
|
||||
const { NetUtil } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/NetUtil.sys.mjs"
|
||||
);
|
||||
const { AppConstants } = ChromeUtils.importESModule(
|
||||
"resource://gre/modules/AppConstants.sys.mjs"
|
||||
);
|
||||
|
||||
const NS_SCRIPTSECURITYMANAGER_CONTRACTID = "@mozilla.org/scriptsecuritymanager;1";
|
||||
const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX = "@mozilla.org/network/protocol;1?name=";
|
||||
const NS_SCRIPTSECURITYMANAGER_CONTRACTID =
|
||||
"@mozilla.org/scriptsecuritymanager;1";
|
||||
const NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX =
|
||||
"@mozilla.org/network/protocol;1?name=";
|
||||
const NS_XREAPPINFO_CONTRACTID = "@mozilla.org/xre/app-info;1";
|
||||
|
||||
const RE_PROTOCOL = /^\w+:/;
|
||||
const RE_PREF_ITEM = /^(|test-|ref-)pref\((.+?),(.*)\)$/;
|
||||
|
||||
|
||||
function ReadTopManifest(aFileURL, aFilter, aManifestID)
|
||||
{
|
||||
function ReadTopManifest(aFileURL, aFilter, aManifestID) {
|
||||
var url = g.ioService.newURI(aFileURL);
|
||||
if (!url)
|
||||
throw "Expected a file or http URL for the manifest.";
|
||||
if (!url) throw "Expected a file or http URL for the manifest.";
|
||||
|
||||
g.manifestsLoaded = {};
|
||||
ReadManifest(url, aFilter, aManifestID);
|
||||
|
|
@ -53,33 +54,32 @@ function ReadTopManifest(aFileURL, aFilter, aManifestID)
|
|||
|
||||
// Note: If you materially change the reftest manifest parsing,
|
||||
// please keep the parser in layout/tools/reftest/__init__.py in sync.
|
||||
function ReadManifest(aURL, aFilter, aManifestID)
|
||||
{
|
||||
function ReadManifest(aURL, aFilter, aManifestID) {
|
||||
// Ensure each manifest is only read once. This assumes that manifests that
|
||||
// are included with filters will be read via their include before they are
|
||||
// read directly in the case of a duplicate
|
||||
if (g.manifestsLoaded.hasOwnProperty(aURL.spec)) {
|
||||
if (g.manifestsLoaded[aURL.spec] === null)
|
||||
return;
|
||||
else
|
||||
aFilter = [aFilter[0], aFilter[1], true];
|
||||
if (g.manifestsLoaded[aURL.spec] === null) return;
|
||||
else aFilter = [aFilter[0], aFilter[1], true];
|
||||
}
|
||||
g.manifestsLoaded[aURL.spec] = aFilter[1];
|
||||
|
||||
var secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
|
||||
.getService(Ci.nsIScriptSecurityManager);
|
||||
var secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID].getService(
|
||||
Ci.nsIScriptSecurityManager
|
||||
);
|
||||
|
||||
var listURL = aURL;
|
||||
var channel = NetUtil.newChannel({uri: aURL,
|
||||
loadUsingSystemPrincipal: true});
|
||||
var channel = NetUtil.newChannel({
|
||||
uri: aURL,
|
||||
loadUsingSystemPrincipal: true,
|
||||
});
|
||||
try {
|
||||
var inputStream = channel.open();
|
||||
} catch (e) {
|
||||
g.logger.error("failed to open manifest at : " + aURL.spec);
|
||||
throw e;
|
||||
}
|
||||
if (channel instanceof Ci.nsIHttpChannel
|
||||
&& channel.responseStatus != 200) {
|
||||
if (channel instanceof Ci.nsIHttpChannel && channel.responseStatus != 200) {
|
||||
g.logger.error("HTTP ERROR : " + channel.responseStatus);
|
||||
}
|
||||
var streamBuf = getStreamContent(inputStream);
|
||||
|
|
@ -99,27 +99,33 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
var lineNo = 0;
|
||||
var urlprefix = "";
|
||||
var defaults = [];
|
||||
var defaultTestPrefSettings = [], defaultRefPrefSettings = [];
|
||||
var defaultTestPrefSettings = [],
|
||||
defaultRefPrefSettings = [];
|
||||
if (g.compareRetainedDisplayLists) {
|
||||
AddRetainedDisplayListTestPrefs(GetOrCreateSandbox(), defaultTestPrefSettings,
|
||||
defaultRefPrefSettings);
|
||||
AddRetainedDisplayListTestPrefs(
|
||||
GetOrCreateSandbox(),
|
||||
defaultTestPrefSettings,
|
||||
defaultRefPrefSettings
|
||||
);
|
||||
}
|
||||
for (var str of lines) {
|
||||
++lineNo;
|
||||
if (str.charAt(0) == "#")
|
||||
continue; // entire line was a comment
|
||||
if (str.charAt(0) == "#") continue; // entire line was a comment
|
||||
var i = str.search(/\s+#/);
|
||||
if (i >= 0)
|
||||
str = str.substring(0, i);
|
||||
if (i >= 0) str = str.substring(0, i);
|
||||
// strip leading and trailing whitespace
|
||||
str = str.replace(/^\s*/, '').replace(/\s*$/, '');
|
||||
if (!str || str == "")
|
||||
continue;
|
||||
str = str.replace(/^\s*/, "").replace(/\s*$/, "");
|
||||
if (!str || str == "") continue;
|
||||
var items = str.split(/\s+/); // split on whitespace
|
||||
|
||||
if (items[0] == "url-prefix") {
|
||||
if (items.length != 2)
|
||||
throw "url-prefix requires one url in manifest file " + aURL.spec + " line " + lineNo;
|
||||
throw (
|
||||
"url-prefix requires one url in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo
|
||||
);
|
||||
urlprefix = items[1];
|
||||
continue;
|
||||
}
|
||||
|
|
@ -148,7 +154,11 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
|
||||
var origLength = items.length;
|
||||
items = defaults.concat(items);
|
||||
while (items[0].match(/^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail|pref|test-pref|ref-pref|fuzzy|chaos-mode|wr-capture|wr-capture-ref|noautofuzz)/)) {
|
||||
while (
|
||||
items[0].match(
|
||||
/^(fails|needs-focus|random|skip|asserts|slow|require-or|silentfail|pref|test-pref|ref-pref|fuzzy|chaos-mode|wr-capture|wr-capture-ref|noautofuzz)/
|
||||
)
|
||||
) {
|
||||
var item = items.shift();
|
||||
var stat;
|
||||
var cond;
|
||||
|
|
@ -166,15 +176,13 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
} else if ((m = item.match(/^asserts\((\d+)(-\d+)?\)$/))) {
|
||||
cond = false;
|
||||
minAsserts = Number(m[1]);
|
||||
maxAsserts = (m[2] == undefined) ? minAsserts
|
||||
: Number(m[2].substring(1));
|
||||
maxAsserts = m[2] == undefined ? minAsserts : Number(m[2].substring(1));
|
||||
} else if ((m = item.match(/^asserts-if\((.*?),(\d+)(-\d+)?\)$/))) {
|
||||
cond = false;
|
||||
if (Cu.evalInSandbox("(" + m[1] + ")", GetOrCreateSandbox())) {
|
||||
minAsserts = Number(m[2]);
|
||||
maxAsserts =
|
||||
(m[3] == undefined) ? minAsserts
|
||||
: Number(m[3].substring(1));
|
||||
m[3] == undefined ? minAsserts : Number(m[3].substring(1));
|
||||
}
|
||||
} else if (item == "slow") {
|
||||
cond = false;
|
||||
|
|
@ -182,7 +190,13 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
} else if ((m = item.match(/^require-or\((.*?)\)$/))) {
|
||||
var args = m[1].split(/,/);
|
||||
if (args.length != 2) {
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": wrong number of args to require-or";
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": wrong number of args to require-or"
|
||||
);
|
||||
}
|
||||
var [precondition_str, fallback_action] = args;
|
||||
var preconditions = precondition_str.split(/&&/);
|
||||
|
|
@ -212,16 +226,31 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
allow_silent_fail = true;
|
||||
} else if ((m = item.match(RE_PREF_ITEM))) {
|
||||
cond = false;
|
||||
if (!AddPrefSettings(m[1], m[2], m[3], GetOrCreateSandbox(),
|
||||
testPrefSettings, refPrefSettings)) {
|
||||
throw "Error in pref value in manifest file " + aURL.spec + " line " + lineNo;
|
||||
if (
|
||||
!AddPrefSettings(
|
||||
m[1],
|
||||
m[2],
|
||||
m[3],
|
||||
GetOrCreateSandbox(),
|
||||
testPrefSettings,
|
||||
refPrefSettings
|
||||
)
|
||||
) {
|
||||
throw (
|
||||
"Error in pref value in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo
|
||||
);
|
||||
}
|
||||
} else if ((m = item.match(/^fuzzy\((\d+)-(\d+),(\d+)-(\d+)\)$/))) {
|
||||
cond = false;
|
||||
expected_status = EXPECTED_FUZZY;
|
||||
fuzzy_delta = ExtractRange(m, 1);
|
||||
fuzzy_pixels = ExtractRange(m, 3);
|
||||
} else if ((m = item.match(/^fuzzy-if\((.*?),(\d+)-(\d+),(\d+)-(\d+)\)$/))) {
|
||||
} else if (
|
||||
(m = item.match(/^fuzzy-if\((.*?),(\d+)-(\d+),(\d+)-(\d+)\)$/))
|
||||
) {
|
||||
cond = false;
|
||||
if (Cu.evalInSandbox("(" + m[1] + ")", GetOrCreateSandbox())) {
|
||||
expected_status = EXPECTED_FUZZY;
|
||||
|
|
@ -241,7 +270,14 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
cond = false;
|
||||
noAutoFuzz = true;
|
||||
} else {
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": unexpected item " + item;
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": unexpected item " +
|
||||
item
|
||||
);
|
||||
}
|
||||
|
||||
if (stat != "skip") {
|
||||
|
|
@ -264,7 +300,15 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
if (items.length > origLength) {
|
||||
// Implies we broke out of the loop before we finished processing
|
||||
// defaults. This means defaults contained an invalid token.
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": invalid defaults token '" + items[0] + "'";
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": invalid defaults token '" +
|
||||
items[0] +
|
||||
"'"
|
||||
);
|
||||
}
|
||||
|
||||
if (minAsserts > maxAsserts) {
|
||||
|
|
@ -274,13 +318,13 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
var runHttp = false;
|
||||
var httpDepth;
|
||||
if (items[0] == "HTTP") {
|
||||
runHttp = (aURL.scheme == "file"); // We can't yet run the local HTTP server
|
||||
runHttp = aURL.scheme == "file"; // We can't yet run the local HTTP server
|
||||
// for non-local reftests.
|
||||
httpDepth = 0;
|
||||
items.shift();
|
||||
} else if (items[0].match(/HTTP\(\.\.(\/\.\.)*\)/)) {
|
||||
// Accept HTTP(..), HTTP(../..), HTTP(../../..), etc.
|
||||
runHttp = (aURL.scheme == "file"); // We can't yet run the local HTTP server
|
||||
runHttp = aURL.scheme == "file"; // We can't yet run the local HTTP server
|
||||
// for non-local reftests.
|
||||
httpDepth = (items[0].length - 5) / 3;
|
||||
items.shift();
|
||||
|
|
@ -301,9 +345,21 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
|
||||
if (items[0] == "include") {
|
||||
if (items.length != 2)
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": incorrect number of arguments to include";
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": incorrect number of arguments to include"
|
||||
);
|
||||
if (runHttp)
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": use of include with http";
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": use of include with http"
|
||||
);
|
||||
|
||||
// If the expected_status is EXPECTED_PASS (the default) then allow
|
||||
// the include. If 'skip' is true, that means there was a skip
|
||||
|
|
@ -312,18 +368,41 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
// is disallowed since it's nonintuitive as to what the intended
|
||||
// effect is.
|
||||
if (nonSkipUsed) {
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": include statement with annotation other than 'skip' or 'skip-if'";
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": include statement with annotation other than 'skip' or 'skip-if'"
|
||||
);
|
||||
} else if (skip) {
|
||||
g.logger.info("Skipping included manifest at " + aURL.spec + " line " + lineNo + " due to matching skip condition");
|
||||
g.logger.info(
|
||||
"Skipping included manifest at " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
" due to matching skip condition"
|
||||
);
|
||||
} else {
|
||||
// poor man's assertion
|
||||
if (expected_status != EXPECTED_PASS) {
|
||||
throw "Error in manifest file parsing code: we should never get expected_status=" + expected_status + " when nonSkipUsed=false (from " + aURL.spec + " line " + lineNo + ")";
|
||||
throw (
|
||||
"Error in manifest file parsing code: we should never get expected_status=" +
|
||||
expected_status +
|
||||
" when nonSkipUsed=false (from " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
")"
|
||||
);
|
||||
}
|
||||
|
||||
var incURI = g.ioService.newURI(items[1], null, listURL);
|
||||
secMan.checkLoadURIWithPrincipal(principal, incURI,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
secMan.checkLoadURIWithPrincipal(
|
||||
principal,
|
||||
incURI,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT
|
||||
);
|
||||
|
||||
// Cannot use nsIFile or similar to manipulate the manifest ID; although it appears
|
||||
// path-like, it does not refer to an actual path in the filesystem.
|
||||
|
|
@ -361,10 +440,25 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
} else if (items[0] == TYPE_LOAD || items[0] == TYPE_SCRIPT) {
|
||||
var type = items[0];
|
||||
if (items.length != 2)
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": incorrect number of arguments to " + type;
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": incorrect number of arguments to " +
|
||||
type
|
||||
);
|
||||
if (type == TYPE_LOAD && expected_status != EXPECTED_PASS)
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": incorrect known failure type for load test";
|
||||
AddTestItem({ type: type,
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": incorrect known failure type for load test"
|
||||
);
|
||||
AddTestItem(
|
||||
{
|
||||
type: type,
|
||||
expected: expected_status,
|
||||
manifest: aURL.spec,
|
||||
manifestID: TestIdentifier(aURL.spec, aManifestID),
|
||||
|
|
@ -386,15 +480,39 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
url2: null,
|
||||
chaosMode: chaosMode,
|
||||
wrCapture: wrCapture,
|
||||
noAutoFuzz: noAutoFuzz }, aFilter, aManifestID);
|
||||
} else if (items[0] == TYPE_REFTEST_EQUAL || items[0] == TYPE_REFTEST_NOTEQUAL || items[0] == TYPE_PRINT) {
|
||||
noAutoFuzz: noAutoFuzz,
|
||||
},
|
||||
aFilter,
|
||||
aManifestID
|
||||
);
|
||||
} else if (
|
||||
items[0] == TYPE_REFTEST_EQUAL ||
|
||||
items[0] == TYPE_REFTEST_NOTEQUAL ||
|
||||
items[0] == TYPE_PRINT
|
||||
) {
|
||||
if (items.length != 3)
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": incorrect number of arguments to " + items[0];
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": incorrect number of arguments to " +
|
||||
items[0]
|
||||
);
|
||||
|
||||
if (items[0] == TYPE_REFTEST_NOTEQUAL &&
|
||||
if (
|
||||
items[0] == TYPE_REFTEST_NOTEQUAL &&
|
||||
expected_status == EXPECTED_FUZZY &&
|
||||
(fuzzy_delta.min > 0 || fuzzy_pixels.min > 0)) {
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": minimum fuzz must be zero for tests of type " + items[0];
|
||||
(fuzzy_delta.min > 0 || fuzzy_pixels.min > 0)
|
||||
) {
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": minimum fuzz must be zero for tests of type " +
|
||||
items[0]
|
||||
);
|
||||
}
|
||||
|
||||
var type = items[0];
|
||||
|
|
@ -409,13 +527,17 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
// Skip the test if it is expected to fail in both modes.
|
||||
// It would unexpectedly "pass" in comparison mode mode when
|
||||
// comparing the two failures, which is not a useful result.
|
||||
if (expected_status === EXPECTED_FAIL ||
|
||||
expected_status === EXPECTED_RANDOM) {
|
||||
if (
|
||||
expected_status === EXPECTED_FAIL ||
|
||||
expected_status === EXPECTED_RANDOM
|
||||
) {
|
||||
skip = true;
|
||||
}
|
||||
}
|
||||
|
||||
AddTestItem({ type: type,
|
||||
AddTestItem(
|
||||
{
|
||||
type: type,
|
||||
expected: expected_status,
|
||||
manifest: aURL.spec,
|
||||
manifestID: TestIdentifier(aURL.spec, aManifestID),
|
||||
|
|
@ -437,20 +559,31 @@ function ReadManifest(aURL, aFilter, aManifestID)
|
|||
url2: items[2],
|
||||
chaosMode: chaosMode,
|
||||
wrCapture: wrCapture,
|
||||
noAutoFuzz: noAutoFuzz }, aFilter, aManifestID);
|
||||
noAutoFuzz: noAutoFuzz,
|
||||
},
|
||||
aFilter,
|
||||
aManifestID
|
||||
);
|
||||
} else {
|
||||
throw "Error in manifest file " + aURL.spec + " line " + lineNo + ": unknown test type " + items[0];
|
||||
throw (
|
||||
"Error in manifest file " +
|
||||
aURL.spec +
|
||||
" line " +
|
||||
lineNo +
|
||||
": unknown test type " +
|
||||
items[0]
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Read all available data from an input stream and return it
|
||||
// as a string.
|
||||
function getStreamContent(inputStream)
|
||||
{
|
||||
function getStreamContent(inputStream) {
|
||||
var streamBuf = "";
|
||||
var sis = Cc["@mozilla.org/scriptableinputstream;1"].
|
||||
createInstance(Ci.nsIScriptableInputStream);
|
||||
var sis = Cc["@mozilla.org/scriptableinputstream;1"].createInstance(
|
||||
Ci.nsIScriptableInputStream
|
||||
);
|
||||
sis.init(inputStream);
|
||||
|
||||
var available;
|
||||
|
|
@ -468,29 +601,41 @@ function BuildConditionSandbox(aURL) {
|
|||
var appInfo = Cc[NS_XREAPPINFO_CONTRACTID].getService(Ci.nsIXULAppInfo);
|
||||
sandbox.isDebugBuild = g.debug.isDebugBuild;
|
||||
sandbox.isCoverageBuild = g.isCoverageBuild;
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].
|
||||
getService(Ci.nsIPrefBranch);
|
||||
var prefs = Cc["@mozilla.org/preferences-service;1"].getService(
|
||||
Ci.nsIPrefBranch
|
||||
);
|
||||
|
||||
sandbox.xulRuntime = Cu.cloneInto({widgetToolkit: xr.widgetToolkit, OS: xr.OS, XPCOMABI: xr.XPCOMABI}, sandbox);
|
||||
sandbox.xulRuntime = Cu.cloneInto(
|
||||
{ widgetToolkit: xr.widgetToolkit, OS: xr.OS, XPCOMABI: xr.XPCOMABI },
|
||||
sandbox
|
||||
);
|
||||
|
||||
var testRect = g.browser.getBoundingClientRect();
|
||||
sandbox.smallScreen = false;
|
||||
if (g.containingWindow.innerWidth < 800 || g.containingWindow.innerHeight < 1000) {
|
||||
if (
|
||||
g.containingWindow.innerWidth < 800 ||
|
||||
g.containingWindow.innerHeight < 1000
|
||||
) {
|
||||
sandbox.smallScreen = true;
|
||||
}
|
||||
|
||||
var gfxInfo = (NS_GFXINFO_CONTRACTID in Cc) && Cc[NS_GFXINFO_CONTRACTID].getService(Ci.nsIGfxInfo);
|
||||
var gfxInfo =
|
||||
NS_GFXINFO_CONTRACTID in Cc &&
|
||||
Cc[NS_GFXINFO_CONTRACTID].getService(Ci.nsIGfxInfo);
|
||||
let readGfxInfo = function (obj, key) {
|
||||
if (g.contentGfxInfo && (key in g.contentGfxInfo)) {
|
||||
if (g.contentGfxInfo && key in g.contentGfxInfo) {
|
||||
return g.contentGfxInfo[key];
|
||||
}
|
||||
return obj[key];
|
||||
}
|
||||
};
|
||||
|
||||
try {
|
||||
sandbox.d2d = readGfxInfo(gfxInfo, "D2DEnabled");
|
||||
sandbox.dwrite = readGfxInfo(gfxInfo, "DWriteEnabled");
|
||||
sandbox.embeddedInFirefoxReality = readGfxInfo(gfxInfo, "EmbeddedInFirefoxReality");
|
||||
sandbox.embeddedInFirefoxReality = readGfxInfo(
|
||||
gfxInfo,
|
||||
"EmbeddedInFirefoxReality"
|
||||
);
|
||||
} catch (e) {
|
||||
sandbox.d2d = false;
|
||||
sandbox.dwrite = false;
|
||||
|
|
@ -506,23 +651,21 @@ function BuildConditionSandbox(aURL) {
|
|||
sandbox.skiaContent = contentBackend == "skia";
|
||||
sandbox.azureSkiaGL = false;
|
||||
// true if we are using the same Azure backend for rendering canvas and content
|
||||
sandbox.contentSameGfxBackendAsCanvas = contentBackend == canvasBackend
|
||||
|| (contentBackend == "none" && canvasBackend == "cairo");
|
||||
sandbox.contentSameGfxBackendAsCanvas =
|
||||
contentBackend == canvasBackend ||
|
||||
(contentBackend == "none" && canvasBackend == "cairo");
|
||||
|
||||
sandbox.remoteCanvas = prefs.getBoolPref("gfx.canvas.remote") && sandbox.d2d && sandbox.gpuProcess;
|
||||
sandbox.remoteCanvas =
|
||||
prefs.getBoolPref("gfx.canvas.remote") && sandbox.d2d && sandbox.gpuProcess;
|
||||
|
||||
sandbox.layersGPUAccelerated =
|
||||
g.windowUtils.layerManagerType != "Basic";
|
||||
sandbox.d3d11 =
|
||||
g.windowUtils.layerManagerType == "Direct3D 11";
|
||||
sandbox.d3d9 =
|
||||
g.windowUtils.layerManagerType == "Direct3D 9";
|
||||
sandbox.layersOpenGL =
|
||||
g.windowUtils.layerManagerType == "OpenGL";
|
||||
sandbox.swgl =
|
||||
g.windowUtils.layerManagerType.startsWith("WebRender (Software");
|
||||
sandbox.layersOMTC =
|
||||
g.windowUtils.layerManagerRemote == true;
|
||||
sandbox.layersGPUAccelerated = g.windowUtils.layerManagerType != "Basic";
|
||||
sandbox.d3d11 = g.windowUtils.layerManagerType == "Direct3D 11";
|
||||
sandbox.d3d9 = g.windowUtils.layerManagerType == "Direct3D 9";
|
||||
sandbox.layersOpenGL = g.windowUtils.layerManagerType == "OpenGL";
|
||||
sandbox.swgl = g.windowUtils.layerManagerType.startsWith(
|
||||
"WebRender (Software"
|
||||
);
|
||||
sandbox.layersOMTC = g.windowUtils.layerManagerRemote == true;
|
||||
|
||||
// Shortcuts for widget toolkits.
|
||||
sandbox.Android = xr.OS == "Android";
|
||||
|
|
@ -546,11 +689,12 @@ function BuildConditionSandbox(aURL) {
|
|||
|
||||
// Needed to specifically test the new and old behavior. This will eventually be removed.
|
||||
sandbox.retainedDisplayListNew =
|
||||
sandbox.retainedDisplayList && prefs.getBoolPref("layout.display-list.retain.sc");
|
||||
sandbox.retainedDisplayList &&
|
||||
prefs.getBoolPref("layout.display-list.retain.sc");
|
||||
|
||||
// GeckoView is currently uniquely identified by "android + e10s" but
|
||||
// we might want to make this condition more precise in the future.
|
||||
sandbox.geckoview = (sandbox.Android && g.browserIsRemote);
|
||||
sandbox.geckoview = sandbox.Android && g.browserIsRemote;
|
||||
|
||||
// Scrollbars that are semi-transparent. See bug 1169666.
|
||||
sandbox.transparentScrollbars = xr.widgetToolkit == "gtk";
|
||||
|
|
@ -561,7 +705,9 @@ function BuildConditionSandbox(aURL) {
|
|||
// and later from Android 2.x
|
||||
sandbox.AndroidVersion = sysInfo.getPropertyAsInt32("version");
|
||||
|
||||
sandbox.emulator = readGfxInfo(gfxInfo, "adapterDeviceID").includes("Android Emulator");
|
||||
sandbox.emulator = readGfxInfo(gfxInfo, "adapterDeviceID").includes(
|
||||
"Android Emulator"
|
||||
);
|
||||
sandbox.device = !sandbox.emulator;
|
||||
}
|
||||
|
||||
|
|
@ -576,33 +722,58 @@ function BuildConditionSandbox(aURL) {
|
|||
|
||||
sandbox.release_or_beta = AppConstants.RELEASE_OR_BETA;
|
||||
|
||||
var hh = Cc[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].
|
||||
getService(Ci.nsIHttpProtocolHandler);
|
||||
var httpProps = ["userAgent", "appName", "appVersion", "vendor",
|
||||
"vendorSub", "product", "productSub", "platform",
|
||||
"oscpu", "language", "misc"];
|
||||
var hh = Cc[NS_NETWORK_PROTOCOL_CONTRACTID_PREFIX + "http"].getService(
|
||||
Ci.nsIHttpProtocolHandler
|
||||
);
|
||||
var httpProps = [
|
||||
"userAgent",
|
||||
"appName",
|
||||
"appVersion",
|
||||
"vendor",
|
||||
"vendorSub",
|
||||
"product",
|
||||
"productSub",
|
||||
"platform",
|
||||
"oscpu",
|
||||
"language",
|
||||
"misc",
|
||||
];
|
||||
sandbox.http = new sandbox.Object();
|
||||
httpProps.forEach((x) => sandbox.http[x] = hh[x]);
|
||||
httpProps.forEach(x => (sandbox.http[x] = hh[x]));
|
||||
|
||||
// set to specific Android13 version (Pixel 5 in CI)
|
||||
sandbox.Android13 = sandbox.Android && (sandbox.http["platform"] == "Android 13");
|
||||
sandbox.Android13 =
|
||||
sandbox.Android && sandbox.http["platform"] == "Android 13";
|
||||
|
||||
// Set OSX to be the Mac OS X version, as an integer, or undefined
|
||||
// for other platforms. The integer is formed by 100 times the
|
||||
// major version plus the minor version, so 1006 for 10.6, 1010 for
|
||||
// 10.10, etc.
|
||||
var osxmatch = /Mac OS X (\d+).(\d+)$/.exec(hh.oscpu);
|
||||
sandbox.OSX = osxmatch ? parseInt(osxmatch[1]) * 100 + parseInt(osxmatch[2]) : undefined;
|
||||
sandbox.OSX = osxmatch
|
||||
? parseInt(osxmatch[1]) * 100 + parseInt(osxmatch[2])
|
||||
: undefined;
|
||||
|
||||
// config specific prefs
|
||||
sandbox.appleSilicon = prefs.getBoolPref("sandbox.apple_silicon", false);
|
||||
|
||||
sandbox.gpuProcessForceEnabled = prefs.getBoolPref("layers.gpu-process.force-enabled", false);
|
||||
sandbox.gpuProcessForceEnabled = prefs.getBoolPref(
|
||||
"layers.gpu-process.force-enabled",
|
||||
false
|
||||
);
|
||||
|
||||
sandbox.prefs = Cu.cloneInto({
|
||||
getBoolPref: function(p) { return prefs.getBoolPref(p); },
|
||||
getIntPref: function(p) { return prefs.getIntPref(p); }
|
||||
}, sandbox, { cloneFunctions: true });
|
||||
sandbox.prefs = Cu.cloneInto(
|
||||
{
|
||||
getBoolPref: function (p) {
|
||||
return prefs.getBoolPref(p);
|
||||
},
|
||||
getIntPref: function (p) {
|
||||
return prefs.getIntPref(p);
|
||||
},
|
||||
},
|
||||
sandbox,
|
||||
{ cloneFunctions: true }
|
||||
);
|
||||
|
||||
// Tests shouldn't care about this except for when they need to
|
||||
// crash the content process
|
||||
|
|
@ -610,7 +781,9 @@ function BuildConditionSandbox(aURL) {
|
|||
sandbox.browserIsFission = g.browserIsFission;
|
||||
|
||||
try {
|
||||
sandbox.asyncPan = g.containingWindow.docShell.asyncPanZoomEnabled && !sandbox.useDrawSnapshot;
|
||||
sandbox.asyncPan =
|
||||
g.containingWindow.docShell.asyncPanZoomEnabled &&
|
||||
!sandbox.useDrawSnapshot;
|
||||
} catch (e) {
|
||||
sandbox.asyncPan = false;
|
||||
}
|
||||
|
|
@ -626,9 +799,14 @@ function BuildConditionSandbox(aURL) {
|
|||
sandbox.serviceWorkerE10s = true;
|
||||
|
||||
if (!g.dumpedConditionSandbox) {
|
||||
g.logger.info("Dumping representation of sandbox which can be used for expectation annotations");
|
||||
for (let entry of Object.entries(Cu.waiveXrays(sandbox)).sort((a, b) => a[0].localeCompare(b[0]))) {
|
||||
let value = typeof entry[1] === "object" ? JSON.stringify(entry[1]) : entry[1];
|
||||
g.logger.info(
|
||||
"Dumping representation of sandbox which can be used for expectation annotations"
|
||||
);
|
||||
for (let entry of Object.entries(Cu.waiveXrays(sandbox)).sort((a, b) =>
|
||||
a[0].localeCompare(b[0])
|
||||
)) {
|
||||
let value =
|
||||
typeof entry[1] === "object" ? JSON.stringify(entry[1]) : entry[1];
|
||||
g.logger.info(` ${entry[0]}: ${value}`);
|
||||
}
|
||||
g.dumpedConditionSandbox = true;
|
||||
|
|
@ -637,32 +815,55 @@ function BuildConditionSandbox(aURL) {
|
|||
return sandbox;
|
||||
}
|
||||
|
||||
function AddRetainedDisplayListTestPrefs(aSandbox, aTestPrefSettings,
|
||||
aRefPrefSettings) {
|
||||
AddPrefSettings("test-", "layout.display-list.retain", "true", aSandbox,
|
||||
aTestPrefSettings, aRefPrefSettings);
|
||||
AddPrefSettings("ref-", "layout.display-list.retain", "false", aSandbox,
|
||||
aTestPrefSettings, aRefPrefSettings);
|
||||
function AddRetainedDisplayListTestPrefs(
|
||||
aSandbox,
|
||||
aTestPrefSettings,
|
||||
aRefPrefSettings
|
||||
) {
|
||||
AddPrefSettings(
|
||||
"test-",
|
||||
"layout.display-list.retain",
|
||||
"true",
|
||||
aSandbox,
|
||||
aTestPrefSettings,
|
||||
aRefPrefSettings
|
||||
);
|
||||
AddPrefSettings(
|
||||
"ref-",
|
||||
"layout.display-list.retain",
|
||||
"false",
|
||||
aSandbox,
|
||||
aTestPrefSettings,
|
||||
aRefPrefSettings
|
||||
);
|
||||
}
|
||||
|
||||
function AddPrefSettings(aWhere, aPrefName, aPrefValExpression, aSandbox, aTestPrefSettings, aRefPrefSettings) {
|
||||
function AddPrefSettings(
|
||||
aWhere,
|
||||
aPrefName,
|
||||
aPrefValExpression,
|
||||
aSandbox,
|
||||
aTestPrefSettings,
|
||||
aRefPrefSettings
|
||||
) {
|
||||
var prefVal = Cu.evalInSandbox("(" + aPrefValExpression + ")", aSandbox);
|
||||
var prefType;
|
||||
var valType = typeof(prefVal);
|
||||
var valType = typeof prefVal;
|
||||
if (valType == "boolean") {
|
||||
prefType = PREF_BOOLEAN;
|
||||
} else if (valType == "string") {
|
||||
prefType = PREF_STRING;
|
||||
} else if (valType == "number" && (parseInt(prefVal) == prefVal)) {
|
||||
} else if (valType == "number" && parseInt(prefVal) == prefVal) {
|
||||
prefType = PREF_INTEGER;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
var setting = { name: aPrefName,
|
||||
type: prefType,
|
||||
value: prefVal };
|
||||
var setting = { name: aPrefName, type: prefType, value: prefVal };
|
||||
|
||||
if (g.compareRetainedDisplayLists && aPrefName != "layout.display-list.retain") {
|
||||
if (
|
||||
g.compareRetainedDisplayLists &&
|
||||
aPrefName != "layout.display-list.retain"
|
||||
) {
|
||||
// ref-pref() is ignored, test-pref() and pref() are added to both
|
||||
if (aWhere != "ref-") {
|
||||
aTestPrefSettings.push(setting);
|
||||
|
|
@ -682,7 +883,7 @@ function AddPrefSettings(aWhere, aPrefName, aPrefValExpression, aSandbox, aTestP
|
|||
function ExtractRange(matches, startIndex) {
|
||||
return {
|
||||
min: Number(matches[startIndex]),
|
||||
max: Number(matches[startIndex + 1])
|
||||
max: Number(matches[startIndex + 1]),
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -705,34 +906,44 @@ function ServeTestBase(aURL, depth) {
|
|||
// this one is needed so tests can use example.org urls for cross origin testing
|
||||
g.server.registerDirectory("/", directory);
|
||||
|
||||
return g.ioService.newURI("http://localhost:" + g.httpServerPort + path + dirPath);
|
||||
return g.ioService.newURI(
|
||||
"http://localhost:" + g.httpServerPort + path + dirPath
|
||||
);
|
||||
}
|
||||
|
||||
function CreateUrls(test) {
|
||||
let secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID]
|
||||
.getService(Ci.nsIScriptSecurityManager);
|
||||
let secMan = Cc[NS_SCRIPTSECURITYMANAGER_CONTRACTID].getService(
|
||||
Ci.nsIScriptSecurityManager
|
||||
);
|
||||
|
||||
let manifestURL = g.ioService.newURI(test.manifest);
|
||||
|
||||
let testbase = manifestURL;
|
||||
if (test.runHttp) {
|
||||
testbase = ServeTestBase(manifestURL, test.httpDepth)
|
||||
testbase = ServeTestBase(manifestURL, test.httpDepth);
|
||||
}
|
||||
|
||||
let testbasePrincipal = secMan.createContentPrincipal(testbase, {});
|
||||
Services.perms.addFromPrincipal(testbasePrincipal, "allowXULXBL", Services.perms.ALLOW_ACTION);
|
||||
Services.perms.addFromPrincipal(
|
||||
testbasePrincipal,
|
||||
"allowXULXBL",
|
||||
Services.perms.ALLOW_ACTION
|
||||
);
|
||||
|
||||
function FileToURI(file)
|
||||
{
|
||||
if (file === null)
|
||||
return file;
|
||||
function FileToURI(file) {
|
||||
if (file === null) return file;
|
||||
|
||||
var testURI = g.ioService.newURI(file, null, testbase);
|
||||
let isChromeOrViewSource = testURI.scheme == "chrome" || testURI.scheme == "view-source";
|
||||
let principal = isChromeOrViewSource ? secMan.getSystemPrincipal() :
|
||||
secMan.createContentPrincipal(manifestURL, {});
|
||||
secMan.checkLoadURIWithPrincipal(principal, testURI,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT);
|
||||
let isChromeOrViewSource =
|
||||
testURI.scheme == "chrome" || testURI.scheme == "view-source";
|
||||
let principal = isChromeOrViewSource
|
||||
? secMan.getSystemPrincipal()
|
||||
: secMan.createContentPrincipal(manifestURL, {});
|
||||
secMan.checkLoadURIWithPrincipal(
|
||||
principal,
|
||||
testURI,
|
||||
Ci.nsIScriptSecurityManager.DISALLOW_SCRIPT
|
||||
);
|
||||
return testURI;
|
||||
}
|
||||
|
||||
|
|
@ -751,41 +962,42 @@ function TestIdentifier(aUrl, aManifestID) {
|
|||
return aUrl;
|
||||
}
|
||||
var pos = aUrl.lastIndexOf("/");
|
||||
var url = (pos < 0) ? aUrl : aUrl.substring(pos + 1);
|
||||
return (aManifestID + "/" + url);
|
||||
var url = pos < 0 ? aUrl : aUrl.substring(pos + 1);
|
||||
return aManifestID + "/" + url;
|
||||
}
|
||||
|
||||
function AddTestItem(aTest, aFilter, aManifestID) {
|
||||
if (!aFilter)
|
||||
aFilter = [null, [], false];
|
||||
if (!aFilter) aFilter = [null, [], false];
|
||||
|
||||
var identifier = TestIdentifier(aTest.url1, aManifestID);
|
||||
if (aTest.url2 !== null) {
|
||||
identifier = [identifier, aTest.type, TestIdentifier(aTest.url2, aManifestID)];
|
||||
identifier = [
|
||||
identifier,
|
||||
aTest.type,
|
||||
TestIdentifier(aTest.url2, aManifestID),
|
||||
];
|
||||
}
|
||||
|
||||
var {url1, url2} = CreateUrls(Object.assign({}, aTest));
|
||||
var { url1, url2 } = CreateUrls(Object.assign({}, aTest));
|
||||
|
||||
var globalFilter = aFilter[0];
|
||||
var manifestFilter = aFilter[1];
|
||||
var invertManifest = aFilter[2];
|
||||
if (globalFilter && !globalFilter.test(url1.spec)) {
|
||||
if (url2 === null)
|
||||
return;
|
||||
if (globalFilter && !globalFilter.test(url2.spec))
|
||||
return;
|
||||
if (url2 === null) return;
|
||||
if (globalFilter && !globalFilter.test(url2.spec)) return;
|
||||
}
|
||||
if (manifestFilter && !(invertManifest ^ manifestFilter.test(url1.spec))) {
|
||||
if (url2 === null)
|
||||
return;
|
||||
if (url2 === null) return;
|
||||
if (manifestFilter && !(invertManifest ^ manifestFilter.test(url2.spec)))
|
||||
return;
|
||||
}
|
||||
if (g.focusFilterMode == FOCUS_FILTER_NEEDS_FOCUS_TESTS &&
|
||||
!aTest.needsFocus)
|
||||
if (g.focusFilterMode == FOCUS_FILTER_NEEDS_FOCUS_TESTS && !aTest.needsFocus)
|
||||
return;
|
||||
if (g.focusFilterMode == FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS &&
|
||||
aTest.needsFocus)
|
||||
if (
|
||||
g.focusFilterMode == FOCUS_FILTER_NON_NEEDS_FOCUS_TESTS &&
|
||||
aTest.needsFocus
|
||||
)
|
||||
return;
|
||||
|
||||
aTest.identifier = identifier;
|
||||
|
|
@ -794,6 +1006,6 @@ function AddTestItem(aTest, aFilter, aManifestID) {
|
|||
// No-output timeouts during manifest parsing have been a problem for
|
||||
// jsreftests on Android/debug. Any logging resets the no-output timer,
|
||||
// even debug logging which is normally not displayed.
|
||||
if ((g.urls.length % 5000) == 0)
|
||||
if (g.urls.length % 5000 == 0)
|
||||
g.logger.debug(g.urls.length + " tests found...");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ Features to add:
|
|||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<head>
|
||||
<title>Reftest analyzer</title>
|
||||
<style type="text/css"><![CDATA[
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
|
||||
html, body { margin: 0; }
|
||||
html { padding: 0; }
|
||||
|
|
@ -62,33 +63,35 @@ Features to add:
|
|||
#pixelhint p { margin: 0; }
|
||||
#pixelhint p + p { margin-top: 1em; }
|
||||
|
||||
]]></style>
|
||||
<script type="text/javascript"><![CDATA[
|
||||
]]>
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<![CDATA[
|
||||
|
||||
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||
var IMAGE_NOT_AVAILABLE = "data:image/png;base64,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";
|
||||
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||
var IMAGE_NOT_AVAILABLE = "data:image/png;base64,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";
|
||||
|
||||
var gPhases = null;
|
||||
var gPhases = null;
|
||||
|
||||
var gIDCache = {};
|
||||
var gIDCache = {};
|
||||
|
||||
var gMagPixPaths = []; // 2D array of array-of-two <path> objects used in the pixel magnifier
|
||||
var gMagWidth = 5; // number of zoomed in pixels to show horizontally
|
||||
var gMagHeight = 5; // number of zoomed in pixels to show vertically
|
||||
var gMagZoom = 16; // size of the zoomed in pixels
|
||||
var gImage1Data; // ImageData object for the reference image
|
||||
var gImage2Data; // ImageData object for the test output image
|
||||
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
||||
var gParams;
|
||||
var gMagPixPaths = []; // 2D array of array-of-two <path> objects used in the pixel magnifier
|
||||
var gMagWidth = 5; // number of zoomed in pixels to show horizontally
|
||||
var gMagHeight = 5; // number of zoomed in pixels to show vertically
|
||||
var gMagZoom = 16; // size of the zoomed in pixels
|
||||
var gImage1Data; // ImageData object for the reference image
|
||||
var gImage2Data; // ImageData object for the test output image
|
||||
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
||||
var gParams;
|
||||
|
||||
function ID(id) {
|
||||
function ID(id) {
|
||||
if (!(id in gIDCache))
|
||||
gIDCache[id] = document.getElementById(id);
|
||||
return gIDCache[id];
|
||||
}
|
||||
}
|
||||
|
||||
function hash_parameters() {
|
||||
function hash_parameters() {
|
||||
var result = { };
|
||||
var params = window.location.hash.substr(1).split(/[&;]/);
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
|
|
@ -96,9 +99,9 @@ function hash_parameters() {
|
|||
result[parts[0]] = unescape(unescape(parts[1]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function load() {
|
||||
function load() {
|
||||
gPhases = [ ID("entry"), ID("loading"), ID("viewer") ];
|
||||
build_mag();
|
||||
gParams = hash_parameters();
|
||||
|
|
@ -119,13 +122,13 @@ function load() {
|
|||
window.addEventListener('keypress', handle_keyboard_shortcut);
|
||||
ID("image1").addEventListener('error', image_load_error);
|
||||
ID("image2").addEventListener('error', image_load_error);
|
||||
}
|
||||
}
|
||||
|
||||
function image_load_error(e) {
|
||||
function image_load_error(e) {
|
||||
e.target.setAttributeNS(XLINK_NS, "xlink:href", IMAGE_NOT_AVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
function build_mag() {
|
||||
function build_mag() {
|
||||
var mag = ID("mag");
|
||||
|
||||
var r = document.createElementNS(SVG_NS, "rect");
|
||||
|
|
@ -163,9 +166,9 @@ function build_mag() {
|
|||
flashedOn = !flashedOn;
|
||||
flash_pixels(flashedOn);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function show_phase(phaseid) {
|
||||
function show_phase(phaseid) {
|
||||
for (var i in gPhases) {
|
||||
var phase = gPhases[i];
|
||||
phase.style.display = (phase.id == phaseid) ? "" : "none";
|
||||
|
|
@ -173,9 +176,9 @@ function show_phase(phaseid) {
|
|||
|
||||
if (phase == "viewer")
|
||||
ID("images").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function fileentry_changed() {
|
||||
function fileentry_changed() {
|
||||
show_phase("loading");
|
||||
var input = ID("fileentry");
|
||||
var files = input.files;
|
||||
|
|
@ -201,19 +204,19 @@ function fileentry_changed() {
|
|||
// overwriting the log), clear the value on the form input so we
|
||||
// will always get an onchange event.
|
||||
input.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
function log_pasted() {
|
||||
function log_pasted() {
|
||||
show_phase("loading");
|
||||
var entry = ID("logentry");
|
||||
var log = entry.value;
|
||||
entry.value = "";
|
||||
process_log(log);
|
||||
}
|
||||
}
|
||||
|
||||
var gTestItems;
|
||||
var gTestItems;
|
||||
|
||||
function process_log(contents) {
|
||||
function process_log(contents) {
|
||||
var lines = contents.split(/[\r\n]+/);
|
||||
gTestItems = [];
|
||||
for (var j in lines) {
|
||||
|
|
@ -255,9 +258,9 @@ function process_log(contents) {
|
|||
}
|
||||
}
|
||||
build_viewer();
|
||||
}
|
||||
}
|
||||
|
||||
function build_viewer() {
|
||||
function build_viewer() {
|
||||
if (gTestItems.length == 0) {
|
||||
show_phase("entry");
|
||||
return;
|
||||
|
|
@ -317,9 +320,9 @@ function build_viewer() {
|
|||
cell.appendChild(table);
|
||||
|
||||
show_phase("viewer");
|
||||
}
|
||||
}
|
||||
|
||||
function get_image_data(src, whenReady) {
|
||||
function get_image_data(src, whenReady) {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
var canvas = document.createElement("canvas");
|
||||
|
|
@ -332,17 +335,17 @@ function get_image_data(src, whenReady) {
|
|||
whenReady(ctx.getImageData(0, 0, img.naturalWidth, img.naturalHeight));
|
||||
};
|
||||
img.src = src;
|
||||
}
|
||||
}
|
||||
|
||||
function sync_svg_size(imageData) {
|
||||
function sync_svg_size(imageData) {
|
||||
// We need the size of the 'svg' and its 'image' elements to match the size
|
||||
// of the ImageData objects that we're going to read pixels from or else our
|
||||
// magnify() function will be very broken.
|
||||
ID("svg").setAttribute("width", imageData.width);
|
||||
ID("svg").setAttribute("height", imageData.height);
|
||||
}
|
||||
}
|
||||
|
||||
function show_images(i) {
|
||||
function show_images(i) {
|
||||
var item = gTestItems[i];
|
||||
var cell = ID("images");
|
||||
|
||||
|
|
@ -378,9 +381,9 @@ function show_images(i) {
|
|||
|
||||
get_image_data(item.images[0], function(data) { gImage1Data = data; sync_svg_size(gImage1Data); });
|
||||
get_image_data(item.images[1], function(data) { gImage2Data = data });
|
||||
}
|
||||
}
|
||||
|
||||
function show_image(i) {
|
||||
function show_image(i) {
|
||||
if (i == 1) {
|
||||
ID("image1").style.display = "";
|
||||
ID("image2").style.display = "none";
|
||||
|
|
@ -388,9 +391,9 @@ function show_image(i) {
|
|||
ID("image1").style.display = "none";
|
||||
ID("image2").style.display = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handle_keyboard_shortcut(event) {
|
||||
function handle_keyboard_shortcut(event) {
|
||||
switch (event.charCode) {
|
||||
case 49: // "1" key
|
||||
document.getElementById("radio1").checked = true;
|
||||
|
|
@ -410,9 +413,9 @@ function handle_keyboard_shortcut(event) {
|
|||
shift_images(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function shift_images(dir) {
|
||||
function shift_images(dir) {
|
||||
var activeItem = document.querySelector(".activeitem");
|
||||
if (!activeItem) {
|
||||
return;
|
||||
|
|
@ -427,47 +430,47 @@ function shift_images(dir) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show_differences(cb) {
|
||||
function show_differences(cb) {
|
||||
ID("diffrect").style.display = cb.checked ? "" : "none";
|
||||
}
|
||||
}
|
||||
|
||||
function flash_pixels(on) {
|
||||
function flash_pixels(on) {
|
||||
var stroke = on ? "red" : "black";
|
||||
var strokeWidth = on ? "2px" : "1px";
|
||||
for (var i = 0; i < gFlashingPixels.length; i++) {
|
||||
gFlashingPixels[i].setAttribute("stroke", stroke);
|
||||
gFlashingPixels[i].setAttribute("stroke-width", strokeWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cursor_point(evt) {
|
||||
function cursor_point(evt) {
|
||||
var m = evt.target.getScreenCTM().inverse();
|
||||
var p = ID("svg").createSVGPoint();
|
||||
p.x = evt.clientX;
|
||||
p.y = evt.clientY;
|
||||
p = p.matrixTransform(m);
|
||||
return { x: Math.floor(p.x), y: Math.floor(p.y) };
|
||||
}
|
||||
}
|
||||
|
||||
function hex2(i) {
|
||||
function hex2(i) {
|
||||
return (i < 16 ? "0" : "") + i.toString(16);
|
||||
}
|
||||
}
|
||||
|
||||
function canvas_pixel_as_hex(data, x, y) {
|
||||
function canvas_pixel_as_hex(data, x, y) {
|
||||
var offset = (y * data.width + x) * 4;
|
||||
var r = data.data[offset];
|
||||
var g = data.data[offset + 1];
|
||||
var b = data.data[offset + 2];
|
||||
return "#" + hex2(r) + hex2(g) + hex2(b);
|
||||
}
|
||||
}
|
||||
|
||||
function hex_as_rgb(hex) {
|
||||
function hex_as_rgb(hex) {
|
||||
return "rgb(" + [parseInt(hex.substring(1, 3), 16), parseInt(hex.substring(3, 5), 16), parseInt(hex.substring(5, 7), 16)] + ")";
|
||||
}
|
||||
}
|
||||
|
||||
function magnify(evt) {
|
||||
function magnify(evt) {
|
||||
var { x: x, y: y } = cursor_point(evt);
|
||||
var centerPixelColor1, centerPixelColor2;
|
||||
|
||||
|
|
@ -508,77 +511,135 @@ function magnify(evt) {
|
|||
}
|
||||
flash_pixels(true);
|
||||
show_pixelinfo(x, y, centerPixelColor1, hex_as_rgb(centerPixelColor1), centerPixelColor2, hex_as_rgb(centerPixelColor2));
|
||||
}
|
||||
}
|
||||
|
||||
function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
||||
function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
||||
var pixelinfo = ID("pixelinfo");
|
||||
ID("coords").textContent = [x, y];
|
||||
ID("pix1hex").textContent = pix1hex;
|
||||
ID("pix1rgb").textContent = pix1rgb;
|
||||
ID("pix2hex").textContent = pix2hex;
|
||||
ID("pix2rgb").textContent = pix2rgb;
|
||||
}
|
||||
}
|
||||
|
||||
]]></script>
|
||||
]]>
|
||||
</script>
|
||||
</head>
|
||||
<body onload="load()">
|
||||
<div id="entry">
|
||||
<h1>Reftest analyzer: load raw structured log</h1>
|
||||
|
||||
</head>
|
||||
<body onload="load()">
|
||||
<p>
|
||||
Either paste your log into this textarea:<br />
|
||||
<textarea cols="80" rows="10" id="logentry" /><br />
|
||||
<input
|
||||
type="button"
|
||||
value="Process pasted log"
|
||||
onclick="log_pasted()"
|
||||
/>
|
||||
</p>
|
||||
|
||||
<div id="entry">
|
||||
<p>
|
||||
... or load it from a file:<br />
|
||||
<input type="file" id="fileentry" onchange="fileentry_changed()" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h1>Reftest analyzer: load raw structured log</h1>
|
||||
<div id="loading" style="display: none">Loading log...</div>
|
||||
|
||||
<p>Either paste your log into this textarea:<br />
|
||||
<textarea cols="80" rows="10" id="logentry"/><br/>
|
||||
<input type="button" value="Process pasted log" onclick="log_pasted()" /></p>
|
||||
|
||||
<p>... or load it from a file:<br/>
|
||||
<input type="file" id="fileentry" onchange="fileentry_changed()" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="loading" style="display:none">Loading log...</div>
|
||||
|
||||
<div id="viewer" style="display:none">
|
||||
<div id="viewer" style="display: none">
|
||||
<div id="pixelarea">
|
||||
<div id="pixelinfo">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Pixel at:</th><td colspan="2" id="coords"/></tr>
|
||||
<tr><th>Image 1:</th><td id="pix1rgb"></td><td id="pix1hex"></td></tr>
|
||||
<tr><th>Image 2:</th><td id="pix2rgb"></td><td id="pix2hex"></td></tr>
|
||||
<tr>
|
||||
<th>Pixel at:</th>
|
||||
<td colspan="2" id="coords" />
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image 1:</th>
|
||||
<td id="pix1rgb"></td>
|
||||
<td id="pix1hex"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image 2:</th>
|
||||
<td id="pix2rgb"></td>
|
||||
<td id="pix2hex"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<div id="pixelhint">★
|
||||
<div id="pixelhint">
|
||||
★
|
||||
<div>
|
||||
<p>Move the mouse over the reftest image on the right to show
|
||||
magnified pixels on the left. The color information above is for
|
||||
the pixel centered in the magnified view.</p>
|
||||
<p>Image 1 is shown in the upper triangle of each pixel and Image 2
|
||||
is shown in the lower triangle.</p>
|
||||
<p>
|
||||
Move the mouse over the reftest image on the right to show
|
||||
magnified pixels on the left. The color information above is
|
||||
for the pixel centered in the magnified view.
|
||||
</p>
|
||||
<p>
|
||||
Image 1 is shown in the upper triangle of each pixel and Image
|
||||
2 is shown in the lower triangle.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="magnification">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="84" shape-rendering="optimizeSpeed">
|
||||
<g id="mag"/>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="84"
|
||||
height="84"
|
||||
shape-rendering="optimizeSpeed"
|
||||
>
|
||||
<g id="mag" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div id="itemlist"></div>
|
||||
<div id="images" style="display:none">
|
||||
<div id="images" style="display: none">
|
||||
<form id="imgcontrols">
|
||||
<input id="radio1" type="radio" name="which" value="0" onchange="show_image(1)" checked="checked" /><label id="label1" title="1" for="radio1">Image 1</label>
|
||||
<input id="radio2" type="radio" name="which" value="1" onchange="show_image(2)" /><label id="label2" title="2" for="radio2">Image 2</label>
|
||||
<label><input id="differences" type="checkbox" onchange="show_differences(this)" />Circle differences</label>
|
||||
<input
|
||||
id="radio1"
|
||||
type="radio"
|
||||
name="which"
|
||||
value="0"
|
||||
onchange="show_image(1)"
|
||||
checked="checked"
|
||||
/><label id="label1" title="1" for="radio1">Image 1</label>
|
||||
<input
|
||||
id="radio2"
|
||||
type="radio"
|
||||
name="which"
|
||||
value="1"
|
||||
onchange="show_image(2)"
|
||||
/><label id="label2" title="2" for="radio2">Image 2</label>
|
||||
<label
|
||||
><input
|
||||
id="differences"
|
||||
type="checkbox"
|
||||
onchange="show_differences(this)"
|
||||
/>Circle differences</label
|
||||
>
|
||||
</form>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="800" height="1000" id="svg">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
width="800"
|
||||
height="1000"
|
||||
id="svg"
|
||||
>
|
||||
<defs>
|
||||
<!-- use sRGB to avoid loss of data -->
|
||||
<filter id="showDifferences" x="0%" y="0%" width="100%" height="100%"
|
||||
style="color-interpolation-filters: sRGB">
|
||||
<filter
|
||||
id="showDifferences"
|
||||
x="0%"
|
||||
y="0%"
|
||||
width="100%"
|
||||
height="100%"
|
||||
style="color-interpolation-filters: sRGB"
|
||||
>
|
||||
<feImage id="feimage1" result="img1" xlink:href="#image1" />
|
||||
<feImage id="feimage2" result="img2" xlink:href="#image2" />
|
||||
<!-- inv1 and inv2 are the images with RGB inverted -->
|
||||
|
|
@ -598,8 +659,22 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
|||
intermediate states, but feComposite
|
||||
type="arithmetic" can't transform the RGB channels
|
||||
and leave the alpha channel untouched. -->
|
||||
<feComposite result="w1" in="img1" in2="inv2" operator="arithmetic" k2="1" k3="1" />
|
||||
<feComposite result="w2" in="img2" in2="inv1" operator="arithmetic" k2="1" k3="1" />
|
||||
<feComposite
|
||||
result="w1"
|
||||
in="img1"
|
||||
in2="inv2"
|
||||
operator="arithmetic"
|
||||
k2="1"
|
||||
k3="1"
|
||||
/>
|
||||
<feComposite
|
||||
result="w2"
|
||||
in="img2"
|
||||
in2="inv1"
|
||||
operator="arithmetic"
|
||||
k2="1"
|
||||
k3="1"
|
||||
/>
|
||||
<!-- c1 will have non-black pixels anywhere that img2
|
||||
is brighter than img1, and c2 for the reverse -->
|
||||
<feComponentTransfer result="c1" in="w1">
|
||||
|
|
@ -613,20 +688,51 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
|||
<feFuncB type="linear" slope="-1" intercept="1" />
|
||||
</feComponentTransfer>
|
||||
<!-- c will be nonblack (and fully on) for every pixel+component where there are differences -->
|
||||
<feComposite result="c" in="c1" in2="c2" operator="arithmetic" k2="255" k3="255" />
|
||||
<feComposite
|
||||
result="c"
|
||||
in="c1"
|
||||
in2="c2"
|
||||
operator="arithmetic"
|
||||
k2="255"
|
||||
k3="255"
|
||||
/>
|
||||
<!-- a will be opaque for every pixel with differences and transparent for all others -->
|
||||
<feColorMatrix result="a" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0" />
|
||||
<feColorMatrix
|
||||
result="a"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0"
|
||||
/>
|
||||
|
||||
<!-- a, dilated by 1 pixel -->
|
||||
<feMorphology result="dila1" in="a" operator="dilate" radius="1" />
|
||||
<feMorphology
|
||||
result="dila1"
|
||||
in="a"
|
||||
operator="dilate"
|
||||
radius="1"
|
||||
/>
|
||||
<!-- a, dilated by 2 pixels -->
|
||||
<feMorphology result="dila2" in="dila1" operator="dilate" radius="1" />
|
||||
<feMorphology
|
||||
result="dila2"
|
||||
in="dila1"
|
||||
operator="dilate"
|
||||
radius="1"
|
||||
/>
|
||||
|
||||
<!-- all the pixels in the 2-pixel dilation of a but not in the 1-pixel dilation, to highlight the diffs -->
|
||||
<feComposite result="highlight" in="dila2" in2="dila1" operator="out" />
|
||||
<feComposite
|
||||
result="highlight"
|
||||
in="dila2"
|
||||
in2="dila1"
|
||||
operator="out"
|
||||
/>
|
||||
|
||||
<feFlood result="red" flood-color="red" />
|
||||
<feComposite result="redhighlight" in="red" in2="highlight" operator="in" />
|
||||
<feComposite
|
||||
result="redhighlight"
|
||||
in="red"
|
||||
in2="highlight"
|
||||
operator="in"
|
||||
/>
|
||||
<feFlood result="black" flood-color="black" flood-opacity="0.5" />
|
||||
<feMerge>
|
||||
<feMergeNode in="black" />
|
||||
|
|
@ -638,10 +744,17 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
|||
<image x="0" y="0" width="100%" height="100%" id="image1" />
|
||||
<image x="0" y="0" width="100%" height="100%" id="image2" />
|
||||
</g>
|
||||
<rect id="diffrect" filter="url(#showDifferences)" pointer-events="none" x="0" y="0" width="100%" height="100%" />
|
||||
<rect
|
||||
id="diffrect"
|
||||
filter="url(#showDifferences)"
|
||||
pointer-events="none"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
/>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -20,9 +20,10 @@ Features to add:
|
|||
-->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<head>
|
||||
<title>Reftest analyzer</title>
|
||||
<style type="text/css"><![CDATA[
|
||||
<style type="text/css">
|
||||
<![CDATA[
|
||||
|
||||
html, body { margin: 0; }
|
||||
html { padding: 0; }
|
||||
|
|
@ -62,33 +63,35 @@ Features to add:
|
|||
#pixelhint p { margin: 0; }
|
||||
#pixelhint p + p { margin-top: 1em; }
|
||||
|
||||
]]></style>
|
||||
<script type="text/javascript"><![CDATA[
|
||||
]]>
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
<![CDATA[
|
||||
|
||||
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||
var IMAGE_NOT_AVAILABLE = "data:image/png;base64,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";
|
||||
var XLINK_NS = "http://www.w3.org/1999/xlink";
|
||||
var SVG_NS = "http://www.w3.org/2000/svg";
|
||||
var IMAGE_NOT_AVAILABLE = "data:image/png;base64,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";
|
||||
|
||||
var gPhases = null;
|
||||
var gPhases = null;
|
||||
|
||||
var gIDCache = {};
|
||||
var gIDCache = {};
|
||||
|
||||
var gMagPixPaths = []; // 2D array of array-of-two <path> objects used in the pixel magnifier
|
||||
var gMagWidth = 5; // number of zoomed in pixels to show horizontally
|
||||
var gMagHeight = 5; // number of zoomed in pixels to show vertically
|
||||
var gMagZoom = 16; // size of the zoomed in pixels
|
||||
var gImage1Data; // ImageData object for the reference image
|
||||
var gImage2Data; // ImageData object for the test output image
|
||||
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
||||
var gParams;
|
||||
var gMagPixPaths = []; // 2D array of array-of-two <path> objects used in the pixel magnifier
|
||||
var gMagWidth = 5; // number of zoomed in pixels to show horizontally
|
||||
var gMagHeight = 5; // number of zoomed in pixels to show vertically
|
||||
var gMagZoom = 16; // size of the zoomed in pixels
|
||||
var gImage1Data; // ImageData object for the reference image
|
||||
var gImage2Data; // ImageData object for the test output image
|
||||
var gFlashingPixels = []; // array of <path> objects that should be flashed due to pixel color mismatch
|
||||
var gParams;
|
||||
|
||||
function ID(id) {
|
||||
function ID(id) {
|
||||
if (!(id in gIDCache))
|
||||
gIDCache[id] = document.getElementById(id);
|
||||
return gIDCache[id];
|
||||
}
|
||||
}
|
||||
|
||||
function hash_parameters() {
|
||||
function hash_parameters() {
|
||||
var result = { };
|
||||
var params = window.location.hash.substr(1).split(/[&;]/);
|
||||
for (var i = 0; i < params.length; i++) {
|
||||
|
|
@ -96,9 +99,9 @@ function hash_parameters() {
|
|||
result[parts[0]] = unescape(unescape(parts[1]));
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
function load() {
|
||||
function load() {
|
||||
gPhases = [ ID("entry"), ID("loading"), ID("viewer") ];
|
||||
build_mag();
|
||||
gParams = hash_parameters();
|
||||
|
|
@ -120,13 +123,13 @@ function load() {
|
|||
window.addEventListener('keydown', handle_keydown);
|
||||
ID("image1").addEventListener('error', image_load_error);
|
||||
ID("image2").addEventListener('error', image_load_error);
|
||||
}
|
||||
}
|
||||
|
||||
function image_load_error(e) {
|
||||
function image_load_error(e) {
|
||||
e.target.setAttributeNS(XLINK_NS, "xlink:href", IMAGE_NOT_AVAILABLE);
|
||||
}
|
||||
}
|
||||
|
||||
function build_mag() {
|
||||
function build_mag() {
|
||||
var mag = ID("mag");
|
||||
|
||||
var r = document.createElementNS(SVG_NS, "rect");
|
||||
|
|
@ -164,9 +167,9 @@ function build_mag() {
|
|||
flashedOn = !flashedOn;
|
||||
flash_pixels(flashedOn);
|
||||
}, 500);
|
||||
}
|
||||
}
|
||||
|
||||
function show_phase(phaseid) {
|
||||
function show_phase(phaseid) {
|
||||
for (var i in gPhases) {
|
||||
var phase = gPhases[i];
|
||||
phase.style.display = (phase.id == phaseid) ? "" : "none";
|
||||
|
|
@ -174,9 +177,9 @@ function show_phase(phaseid) {
|
|||
|
||||
if (phase == "viewer")
|
||||
ID("images").style.display = "none";
|
||||
}
|
||||
}
|
||||
|
||||
function fileentry_changed() {
|
||||
function fileentry_changed() {
|
||||
show_phase("loading");
|
||||
var input = ID("fileentry");
|
||||
var files = input.files;
|
||||
|
|
@ -202,22 +205,22 @@ function fileentry_changed() {
|
|||
// overwriting the log), clear the value on the form input so we
|
||||
// will always get an onchange event.
|
||||
input.value = "";
|
||||
}
|
||||
}
|
||||
|
||||
function log_pasted() {
|
||||
function log_pasted() {
|
||||
show_phase("loading");
|
||||
var entry = ID("logentry");
|
||||
var log = entry.value;
|
||||
entry.value = "";
|
||||
process_log(log);
|
||||
}
|
||||
}
|
||||
|
||||
var gTestItems;
|
||||
var gTestItems;
|
||||
|
||||
// This function is not used in production code, but can be invoked manually
|
||||
// from the devtools console in order to test changes to the parsing regexes
|
||||
// in process_log.
|
||||
function test_parsing() {
|
||||
// This function is not used in production code, but can be invoked manually
|
||||
// from the devtools console in order to test changes to the parsing regexes
|
||||
// in process_log.
|
||||
function test_parsing() {
|
||||
// Note that the logs in these testcases have been manually edited to strip
|
||||
// out stuff for brevity.
|
||||
var testcases = [
|
||||
|
|
@ -228,107 +231,107 @@ function test_parsing() {
|
|||
},
|
||||
{ "name": "android log",
|
||||
"log": `[task 2018-12-28T10:36:45.718Z] 10:36:45 INFO - REFTEST TEST-START | a == b
|
||||
[task 2018-12-28T10:36:45.719Z] 10:36:45 INFO - REFTEST TEST-LOAD | a | 78 / 275 (28%)
|
||||
[task 2018-12-28T10:36:56.138Z] 10:36:56 INFO - REFTEST TEST-LOAD | b | 78 / 275 (28%)
|
||||
[task 2018-12-28T10:37:06.559Z] 10:37:06 INFO - REFTEST TEST-UNEXPECTED-FAIL | a == b | image comparison, max difference: 255, number of differing pixels: 5950
|
||||
[task 2018-12-28T10:37:06.568Z] 10:37:06 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
[task 2018-12-28T10:37:06.577Z] 10:37:06 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
[task 2018-12-28T10:37:06.577Z] 10:37:06 INFO - REFTEST INFO | Saved log: stuff trimmed here
|
||||
[task 2018-12-28T10:37:06.582Z] 10:37:06 INFO - REFTEST TEST-END | a == b
|
||||
[task 2018-12-28T10:37:06.583Z] 10:37:06 INFO - REFTEST TEST-START | a2 == b2
|
||||
[task 2018-12-28T10:37:06.583Z] 10:37:06 INFO - REFTEST TEST-LOAD | a2 | 79 / 275 (28%)
|
||||
[task 2018-12-28T10:37:06.584Z] 10:37:06 INFO - REFTEST TEST-LOAD | b2 | 79 / 275 (28%)
|
||||
[task 2018-12-28T10:37:16.982Z] 10:37:16 INFO - REFTEST TEST-PASS | a2 == b2 | image comparison, max difference: 0, number of differing pixels: 0
|
||||
[task 2018-12-28T10:37:16.982Z] 10:37:16 INFO - REFTEST TEST-END | a2 == b2`,
|
||||
[task 2018-12-28T10:36:45.719Z] 10:36:45 INFO - REFTEST TEST-LOAD | a | 78 / 275 (28%)
|
||||
[task 2018-12-28T10:36:56.138Z] 10:36:56 INFO - REFTEST TEST-LOAD | b | 78 / 275 (28%)
|
||||
[task 2018-12-28T10:37:06.559Z] 10:37:06 INFO - REFTEST TEST-UNEXPECTED-FAIL | a == b | image comparison, max difference: 255, number of differing pixels: 5950
|
||||
[task 2018-12-28T10:37:06.568Z] 10:37:06 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
[task 2018-12-28T10:37:06.577Z] 10:37:06 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
[task 2018-12-28T10:37:06.577Z] 10:37:06 INFO - REFTEST INFO | Saved log: stuff trimmed here
|
||||
[task 2018-12-28T10:37:06.582Z] 10:37:06 INFO - REFTEST TEST-END | a == b
|
||||
[task 2018-12-28T10:37:06.583Z] 10:37:06 INFO - REFTEST TEST-START | a2 == b2
|
||||
[task 2018-12-28T10:37:06.583Z] 10:37:06 INFO - REFTEST TEST-LOAD | a2 | 79 / 275 (28%)
|
||||
[task 2018-12-28T10:37:06.584Z] 10:37:06 INFO - REFTEST TEST-LOAD | b2 | 79 / 275 (28%)
|
||||
[task 2018-12-28T10:37:16.982Z] 10:37:16 INFO - REFTEST TEST-PASS | a2 == b2 | image comparison, max difference: 0, number of differing pixels: 0
|
||||
[task 2018-12-28T10:37:16.982Z] 10:37:16 INFO - REFTEST TEST-END | a2 == b2`,
|
||||
"expected": { "pass": 1, "unexpected": 1, "random": 0, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "local reftest run (Linux)",
|
||||
"log": `REFTEST TEST-START | file:///a == file:///b
|
||||
REFTEST TEST-LOAD | file:///a | 73 / 86 (84%)
|
||||
REFTEST TEST-LOAD | file:///b | 73 / 86 (84%)
|
||||
REFTEST TEST-PASS | file:///a == file:///b | image comparison, max difference: 0, number of differing pixels: 0
|
||||
REFTEST TEST-END | file:///a == file:///b`,
|
||||
REFTEST TEST-LOAD | file:///a | 73 / 86 (84%)
|
||||
REFTEST TEST-LOAD | file:///b | 73 / 86 (84%)
|
||||
REFTEST TEST-PASS | file:///a == file:///b | image comparison, max difference: 0, number of differing pixels: 0
|
||||
REFTEST TEST-END | file:///a == file:///b`,
|
||||
"expected": { "pass": 1, "unexpected": 0, "random": 0, "skip": 0 },
|
||||
"expected_images": 0,
|
||||
},
|
||||
{ "name": "wpt reftests (Linux automation)",
|
||||
"log": `16:50:43 INFO - TEST-START | /a
|
||||
16:50:43 INFO - PID 4276 | 1548694243694 Marionette INFO Testing http://web-platform.test:8000/a == http://web-platform.test:8000/b
|
||||
16:50:43 INFO - PID 4276 | 1548694243963 Marionette INFO No differences allowed
|
||||
16:50:44 INFO - TEST-PASS | /a | took 370ms
|
||||
16:50:44 INFO - TEST-START | /a2
|
||||
16:50:44 INFO - PID 4276 | 1548694244066 Marionette INFO Testing http://web-platform.test:8000/a2 == http://web-platform.test:8000/b2
|
||||
16:50:44 INFO - PID 4276 | 1548694244792 Marionette INFO No differences allowed
|
||||
16:50:44 INFO - PID 4276 | 1548694244792 Marionette INFO Found 28 pixels different, maximum difference per channel 14
|
||||
16:50:44 INFO - TEST-UNEXPECTED-FAIL | /a2 | Testing http://web-platform.test:8000/a2 == http://web-platform.test:8000/b2
|
||||
16:50:44 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
16:50:44 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
16:50:44 INFO - TEST-INFO took 840ms`,
|
||||
16:50:43 INFO - PID 4276 | 1548694243694 Marionette INFO Testing http://web-platform.test:8000/a == http://web-platform.test:8000/b
|
||||
16:50:43 INFO - PID 4276 | 1548694243963 Marionette INFO No differences allowed
|
||||
16:50:44 INFO - TEST-PASS | /a | took 370ms
|
||||
16:50:44 INFO - TEST-START | /a2
|
||||
16:50:44 INFO - PID 4276 | 1548694244066 Marionette INFO Testing http://web-platform.test:8000/a2 == http://web-platform.test:8000/b2
|
||||
16:50:44 INFO - PID 4276 | 1548694244792 Marionette INFO No differences allowed
|
||||
16:50:44 INFO - PID 4276 | 1548694244792 Marionette INFO Found 28 pixels different, maximum difference per channel 14
|
||||
16:50:44 INFO - TEST-UNEXPECTED-FAIL | /a2 | Testing http://web-platform.test:8000/a2 == http://web-platform.test:8000/b2
|
||||
16:50:44 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
16:50:44 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
16:50:44 INFO - TEST-INFO took 840ms`,
|
||||
"expected": { "pass": 1, "unexpected": 1, "random": 0, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "windows log",
|
||||
"log": `12:17:14 INFO - REFTEST TEST-START | a == b
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | a | 1603 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | b | 1603 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-PASS(EXPECTED RANDOM) | a == b | image comparison, max difference: 0, number of differing pixels: 0
|
||||
12:17:14 INFO - REFTEST TEST-END | a == b
|
||||
12:17:14 INFO - REFTEST TEST-START | a2 == b2
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | a2 | 1604 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | b2 | 1604 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-UNEXPECTED-FAIL | a2 == b2 | image comparison, max difference: 255, number of differing pixels: 9976
|
||||
12:17:14 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
12:17:14 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
12:17:14 INFO - REFTEST INFO | Saved log: stuff trimmed here
|
||||
12:17:14 INFO - REFTEST TEST-END | a2 == b2
|
||||
12:01:09 INFO - REFTEST TEST-START | a3 == b3
|
||||
12:01:09 INFO - REFTEST TEST-LOAD | a3 | 66 / 189 (34%)
|
||||
12:01:09 INFO - REFTEST TEST-LOAD | b3 | 66 / 189 (34%)
|
||||
12:01:09 INFO - REFTEST TEST-KNOWN-FAIL | a3 == b3 | image comparison, max difference: 255, number of differing pixels: 9654
|
||||
12:01:09 INFO - REFTEST TEST-END | a3 == b3`,
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | a | 1603 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | b | 1603 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-PASS(EXPECTED RANDOM) | a == b | image comparison, max difference: 0, number of differing pixels: 0
|
||||
12:17:14 INFO - REFTEST TEST-END | a == b
|
||||
12:17:14 INFO - REFTEST TEST-START | a2 == b2
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | a2 | 1604 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-LOAD | b2 | 1604 / 2053 (78%)
|
||||
12:17:14 INFO - REFTEST TEST-UNEXPECTED-FAIL | a2 == b2 | image comparison, max difference: 255, number of differing pixels: 9976
|
||||
12:17:14 INFO - REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
12:17:14 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
12:17:14 INFO - REFTEST INFO | Saved log: stuff trimmed here
|
||||
12:17:14 INFO - REFTEST TEST-END | a2 == b2
|
||||
12:01:09 INFO - REFTEST TEST-START | a3 == b3
|
||||
12:01:09 INFO - REFTEST TEST-LOAD | a3 | 66 / 189 (34%)
|
||||
12:01:09 INFO - REFTEST TEST-LOAD | b3 | 66 / 189 (34%)
|
||||
12:01:09 INFO - REFTEST TEST-KNOWN-FAIL | a3 == b3 | image comparison, max difference: 255, number of differing pixels: 9654
|
||||
12:01:09 INFO - REFTEST TEST-END | a3 == b3`,
|
||||
"expected": { "pass": 1, "unexpected": 1, "random": 1, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "webrender wrench log (windows)",
|
||||
"log": `[task 2018-12-29T04:29:48.800Z] REFTEST a == b
|
||||
[task 2018-12-29T04:29:48.984Z] REFTEST a2 == b2
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST TEST-UNEXPECTED-FAIL | a2 == b2 | image comparison, max difference: 255, number of differing pixels: 3128
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST IMAGE 2 (REFERENCE): data:image/png;
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST TEST-END | a2 == b2`,
|
||||
[task 2018-12-29T04:29:48.984Z] REFTEST a2 == b2
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST TEST-UNEXPECTED-FAIL | a2 == b2 | image comparison, max difference: 255, number of differing pixels: 3128
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST IMAGE 2 (REFERENCE): data:image/png;
|
||||
[task 2018-12-29T04:29:49.053Z] REFTEST TEST-END | a2 == b2`,
|
||||
"expected": { "pass": 0, "unexpected": 1, "random": 0, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "wpt reftests (Linux local; Bug 1530008)",
|
||||
"log": `SUITE-START | Running 1 tests
|
||||
TEST-START | /css/css-backgrounds/border-image-6.html
|
||||
TEST-UNEXPECTED-FAIL | /css/css-backgrounds/border-image-6.html | Testing http://web-platform.test:8000/css/css-backgrounds/border-image-6.html == http://web-platform.test:8000/css/css-backgrounds/border-image-6-ref.html
|
||||
REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
TEST-INFO took 425ms
|
||||
SUITE-END | took 2s`,
|
||||
TEST-START | /css/css-backgrounds/border-image-6.html
|
||||
TEST-UNEXPECTED-FAIL | /css/css-backgrounds/border-image-6.html | Testing http://web-platform.test:8000/css/css-backgrounds/border-image-6.html == http://web-platform.test:8000/css/css-backgrounds/border-image-6-ref.html
|
||||
REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
TEST-INFO took 425ms
|
||||
SUITE-END | took 2s`,
|
||||
"expected": { "pass": 0, "unexpected": 1, "random": 0, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "wpt reftests (taskcluster log from macOS CI)",
|
||||
"log": `[task 2020-06-26T01:35:29.065Z] 01:35:29 INFO - TEST-START | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html
|
||||
[task 2020-06-26T01:35:29.065Z] 01:35:29 INFO - PID 1353 | 1593135329040 Marionette INFO Testing http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html == http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values-ref.html
|
||||
[task 2020-06-26T01:35:29.673Z] 01:35:29 INFO - PID 1353 | 1593135329633 Marionette INFO No differences allowed
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - TEST-KNOWN-INTERMITTENT-FAIL | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html | took 649ms
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;`,
|
||||
[task 2020-06-26T01:35:29.065Z] 01:35:29 INFO - PID 1353 | 1593135329040 Marionette INFO Testing http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html == http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values-ref.html
|
||||
[task 2020-06-26T01:35:29.673Z] 01:35:29 INFO - PID 1353 | 1593135329633 Marionette INFO No differences allowed
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - TEST-KNOWN-INTERMITTENT-FAIL | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html | took 649ms
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2020-06-26T01:35:29.726Z] 01:35:29 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;`,
|
||||
"expected": { "pass": 0, "unexpected": 0, "random": 1, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
{ "name": "wpt reftests (taskcluster log from Windows CI)",
|
||||
"log": `[task 2020-06-26T01:41:19.205Z] 01:41:19 INFO - TEST-START | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html
|
||||
[task 2020-06-26T01:41:19.214Z] 01:41:19 INFO - PID 5920 | 1593135679202 Marionette WARN [24] http://web-platform.test:8000/css/WOFF2/metadatadisplay-schema-license-022-ref.xht overflows viewport (width: 783, height: 731)
|
||||
[task 2020-06-26T01:41:19.214Z] 01:41:19 INFO - PID 9692 | 1593135679208 Marionette INFO Testing http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html == http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values-ref.html
|
||||
[task 2020-06-26T01:41:19.638Z] 01:41:19 INFO - PID 9692 | 1593135679627 Marionette INFO No differences allowed
|
||||
[task 2020-06-26T01:41:19.688Z] 01:41:19 INFO - TEST-KNOWN-INTERMITTENT-PASS | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html | took 474ms
|
||||
[task 2020-06-26T01:41:19.688Z] 01:41:19 INFO - REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2020-06-26T01:41:19.689Z] 01:41:19 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;`,
|
||||
[task 2020-06-26T01:41:19.214Z] 01:41:19 INFO - PID 5920 | 1593135679202 Marionette WARN [24] http://web-platform.test:8000/css/WOFF2/metadatadisplay-schema-license-022-ref.xht overflows viewport (width: 783, height: 731)
|
||||
[task 2020-06-26T01:41:19.214Z] 01:41:19 INFO - PID 9692 | 1593135679208 Marionette INFO Testing http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html == http://web-platform.test:8000/html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values-ref.html
|
||||
[task 2020-06-26T01:41:19.638Z] 01:41:19 INFO - PID 9692 | 1593135679627 Marionette INFO No differences allowed
|
||||
[task 2020-06-26T01:41:19.688Z] 01:41:19 INFO - TEST-KNOWN-INTERMITTENT-PASS | /html/rendering/non-replaced-elements/the-page/iframe-scrolling-attribute-values.html | took 474ms
|
||||
[task 2020-06-26T01:41:19.688Z] 01:41:19 INFO - REFTEST IMAGE 1 (TEST): data:image/png;
|
||||
[task 2020-06-26T01:41:19.689Z] 01:41:19 INFO - REFTEST IMAGE 2 (REFERENCE): data:image/png;`,
|
||||
"expected": { "pass": 1, "unexpected": 0, "random": 1, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
|
|
@ -345,12 +348,12 @@ SUITE-END | took 2s`,
|
|||
},
|
||||
{ "name": "reftest run with whitespace compressed (Treeherder; Bug 1084322)",
|
||||
"log": ` REFTEST TEST-START | a
|
||||
REFTEST TEST-LOAD | a | 0 / 1 (0%)
|
||||
REFTEST TEST-LOAD | b | 0 / 1 (0%)
|
||||
REFTEST TEST-UNEXPECTED-FAIL | a | image comparison (==), max difference: 106, number of differing pixels: 800
|
||||
REFTEST REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
REFTEST REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
REFTEST REFTEST TEST-END | a`,
|
||||
REFTEST TEST-LOAD | a | 0 / 1 (0%)
|
||||
REFTEST TEST-LOAD | b | 0 / 1 (0%)
|
||||
REFTEST TEST-UNEXPECTED-FAIL | a | image comparison (==), max difference: 106, number of differing pixels: 800
|
||||
REFTEST REFTEST IMAGE 1 (TEST): data:image/png;base64,
|
||||
REFTEST REFTEST IMAGE 2 (REFERENCE): data:image/png;base64,
|
||||
REFTEST REFTEST TEST-END | a`,
|
||||
"expected": { "pass": 0, "unexpected": 1, "random": 0, "skip": 0 },
|
||||
"expected_images": 2,
|
||||
},
|
||||
|
|
@ -396,9 +399,9 @@ REFTEST REFTEST TEST-END | a`,
|
|||
process_log(testcases[current_test].log);
|
||||
current_test++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function process_log(contents) {
|
||||
function process_log(contents) {
|
||||
var lines = contents.split(/[\r\n]+/);
|
||||
gTestItems = [];
|
||||
for (var j in lines) {
|
||||
|
|
@ -450,9 +453,9 @@ function process_log(contents) {
|
|||
}
|
||||
|
||||
build_viewer();
|
||||
}
|
||||
}
|
||||
|
||||
function build_viewer() {
|
||||
function build_viewer() {
|
||||
if (gTestItems.length == 0) {
|
||||
show_phase("entry");
|
||||
return;
|
||||
|
|
@ -512,9 +515,9 @@ function build_viewer() {
|
|||
cell.appendChild(table);
|
||||
|
||||
show_phase("viewer");
|
||||
}
|
||||
}
|
||||
|
||||
function get_image_data(src, whenReady) {
|
||||
function get_image_data(src, whenReady) {
|
||||
var img = new Image();
|
||||
img.onload = function() {
|
||||
var canvas = document.createElement("canvas");
|
||||
|
|
@ -527,17 +530,17 @@ function get_image_data(src, whenReady) {
|
|||
whenReady(ctx.getImageData(0, 0, img.naturalWidth, img.naturalHeight));
|
||||
};
|
||||
img.src = src;
|
||||
}
|
||||
}
|
||||
|
||||
function sync_svg_size(imageData) {
|
||||
function sync_svg_size(imageData) {
|
||||
// We need the size of the 'svg' and its 'image' elements to match the size
|
||||
// of the ImageData objects that we're going to read pixels from or else our
|
||||
// magnify() function will be very broken.
|
||||
ID("svg").setAttribute("width", imageData.width);
|
||||
ID("svg").setAttribute("height", imageData.height);
|
||||
}
|
||||
}
|
||||
|
||||
function show_images(i) {
|
||||
function show_images(i) {
|
||||
var item = gTestItems[i];
|
||||
var cell = ID("images");
|
||||
|
||||
|
|
@ -584,9 +587,9 @@ function show_images(i) {
|
|||
get_image_data(item.images[0], function(data) { gImage1Data = data; sync_svg_size(gImage1Data); images_loaded(0)});
|
||||
get_image_data(item.images[1], function(data) { gImage2Data = data; images_loaded(1)});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function update_pixel_difference_text() {
|
||||
function update_pixel_difference_text() {
|
||||
let differenceText;
|
||||
if (gImage1Data.height !== gImage2Data.height ||
|
||||
gImage1Data.width !== gImage2Data.width) {
|
||||
|
|
@ -602,9 +605,9 @@ function update_pixel_difference_text() {
|
|||
// Disable this for now, because per bug 1633504, the numbers may be
|
||||
// inaccurate and dependent on the browser's configuration.
|
||||
ID("pixel-differences").textContent = differenceText;
|
||||
}
|
||||
}
|
||||
|
||||
function get_pixel_differences() {
|
||||
function get_pixel_differences() {
|
||||
let numPixels = 0;
|
||||
let maxPerChannel = 0;
|
||||
for (var i=0; i<gImage1Data.data.length; i+=4) {
|
||||
|
|
@ -627,9 +630,9 @@ function get_pixel_differences() {
|
|||
}
|
||||
}
|
||||
return [numPixels, maxPerChannel];
|
||||
}
|
||||
}
|
||||
|
||||
function show_image(i) {
|
||||
function show_image(i) {
|
||||
if (i == 1) {
|
||||
ID("image1").style.display = "";
|
||||
ID("image2").style.display = "none";
|
||||
|
|
@ -637,9 +640,9 @@ function show_image(i) {
|
|||
ID("image1").style.display = "none";
|
||||
ID("image2").style.display = "";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handle_keyboard_shortcut(event) {
|
||||
function handle_keyboard_shortcut(event) {
|
||||
switch (event.charCode) {
|
||||
case 49: // "1" key
|
||||
document.getElementById("radio1").checked = true;
|
||||
|
|
@ -659,9 +662,9 @@ function handle_keyboard_shortcut(event) {
|
|||
shift_images(1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function handle_keydown(event) {
|
||||
function handle_keydown(event) {
|
||||
switch (event.keyCode) {
|
||||
case 37: // left arrow
|
||||
move_pixel(-1, 0);
|
||||
|
|
@ -676,9 +679,9 @@ function handle_keydown(event) {
|
|||
move_pixel(0, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function shift_images(dir) {
|
||||
function shift_images(dir) {
|
||||
var activeItem = document.querySelector(".activeitem");
|
||||
if (!activeItem) {
|
||||
return;
|
||||
|
|
@ -693,52 +696,52 @@ function shift_images(dir) {
|
|||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function show_differences(cb) {
|
||||
function show_differences(cb) {
|
||||
ID("diffrect").style.display = cb.checked ? "" : "none";
|
||||
}
|
||||
}
|
||||
|
||||
function flash_pixels(on) {
|
||||
function flash_pixels(on) {
|
||||
var stroke = on ? "red" : "black";
|
||||
var strokeWidth = on ? "2px" : "1px";
|
||||
for (var i = 0; i < gFlashingPixels.length; i++) {
|
||||
gFlashingPixels[i].setAttribute("stroke", stroke);
|
||||
gFlashingPixels[i].setAttribute("stroke-width", strokeWidth);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function cursor_point(evt) {
|
||||
function cursor_point(evt) {
|
||||
var m = evt.target.getScreenCTM().inverse();
|
||||
var p = ID("svg").createSVGPoint();
|
||||
p.x = evt.clientX;
|
||||
p.y = evt.clientY;
|
||||
p = p.matrixTransform(m);
|
||||
return { x: Math.floor(p.x), y: Math.floor(p.y) };
|
||||
}
|
||||
}
|
||||
|
||||
function hex2(i) {
|
||||
function hex2(i) {
|
||||
return (i < 16 ? "0" : "") + i.toString(16);
|
||||
}
|
||||
}
|
||||
|
||||
function canvas_pixel_as_hex(data, x, y) {
|
||||
function canvas_pixel_as_hex(data, x, y) {
|
||||
var offset = (y * data.width + x) * 4;
|
||||
var r = data.data[offset];
|
||||
var g = data.data[offset + 1];
|
||||
var b = data.data[offset + 2];
|
||||
return "#" + hex2(r) + hex2(g) + hex2(b);
|
||||
}
|
||||
}
|
||||
|
||||
function hex_as_rgb(hex) {
|
||||
function hex_as_rgb(hex) {
|
||||
return "rgb(" + [parseInt(hex.substring(1, 3), 16), parseInt(hex.substring(3, 5), 16), parseInt(hex.substring(5, 7), 16)] + ")";
|
||||
}
|
||||
}
|
||||
|
||||
function magnify(evt) {
|
||||
function magnify(evt) {
|
||||
var { x: x, y: y } = cursor_point(evt);
|
||||
do_magnify(x, y);
|
||||
}
|
||||
}
|
||||
|
||||
function do_magnify(x, y) {
|
||||
function do_magnify(x, y) {
|
||||
var centerPixelColor1, centerPixelColor2;
|
||||
|
||||
var dx_lo = -Math.floor(gMagWidth / 2);
|
||||
|
|
@ -778,18 +781,18 @@ function do_magnify(x, y) {
|
|||
}
|
||||
flash_pixels(true);
|
||||
show_pixelinfo(x, y, centerPixelColor1, hex_as_rgb(centerPixelColor1), centerPixelColor2, hex_as_rgb(centerPixelColor2));
|
||||
}
|
||||
}
|
||||
|
||||
function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
||||
function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
|
||||
var pixelinfo = ID("pixelinfo");
|
||||
ID("coords").textContent = [x, y];
|
||||
ID("pix1hex").textContent = pix1hex;
|
||||
ID("pix1rgb").textContent = pix1rgb;
|
||||
ID("pix2hex").textContent = pix2hex;
|
||||
ID("pix2rgb").textContent = pix2rgb;
|
||||
}
|
||||
}
|
||||
|
||||
function move_pixel(deltax, deltay) {
|
||||
function move_pixel(deltax, deltay) {
|
||||
coords = ID("coords").textContent.split(',');
|
||||
x = parseInt(coords[0]);
|
||||
y = parseInt(coords[1]);
|
||||
|
|
@ -801,68 +804,126 @@ function move_pixel(deltax, deltay) {
|
|||
if (x >= 0 && y >= 0 && x < gImage1Data.width && y < gImage1Data.height) {
|
||||
do_magnify(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
]]></script>
|
||||
]]>
|
||||
</script>
|
||||
</head>
|
||||
<body onload="load()">
|
||||
<div id="entry">
|
||||
<h1>Reftest analyzer: load reftest log</h1>
|
||||
|
||||
</head>
|
||||
<body onload="load()">
|
||||
<p>
|
||||
Either paste your log into this textarea:<br />
|
||||
<textarea cols="80" rows="10" id="logentry" /><br />
|
||||
<input
|
||||
type="button"
|
||||
value="Process pasted log"
|
||||
onclick="log_pasted()"
|
||||
/>
|
||||
</p>
|
||||
|
||||
<div id="entry">
|
||||
<p>
|
||||
... or load it from a file:<br />
|
||||
<input type="file" id="fileentry" onchange="fileentry_changed()" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<h1>Reftest analyzer: load reftest log</h1>
|
||||
<div id="loading" style="display: none">Loading log...</div>
|
||||
|
||||
<p>Either paste your log into this textarea:<br />
|
||||
<textarea cols="80" rows="10" id="logentry"/><br/>
|
||||
<input type="button" value="Process pasted log" onclick="log_pasted()" /></p>
|
||||
|
||||
<p>... or load it from a file:<br/>
|
||||
<input type="file" id="fileentry" onchange="fileentry_changed()" />
|
||||
</p>
|
||||
</div>
|
||||
|
||||
<div id="loading" style="display:none">Loading log...</div>
|
||||
|
||||
<div id="viewer" style="display:none">
|
||||
<div id="viewer" style="display: none">
|
||||
<div id="pixelarea">
|
||||
<div id="pixelinfo">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr><th>Pixel at:</th><td colspan="2" id="coords"/></tr>
|
||||
<tr><th>Image 1:</th><td id="pix1rgb"></td><td id="pix1hex"></td></tr>
|
||||
<tr><th>Image 2:</th><td id="pix2rgb"></td><td id="pix2hex"></td></tr>
|
||||
<tr>
|
||||
<th>Pixel at:</th>
|
||||
<td colspan="2" id="coords" />
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image 1:</th>
|
||||
<td id="pix1rgb"></td>
|
||||
<td id="pix1hex"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Image 2:</th>
|
||||
<td id="pix2rgb"></td>
|
||||
<td id="pix2hex"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div>
|
||||
<div id="pixelhint">★
|
||||
<div id="pixelhint">
|
||||
★
|
||||
<div>
|
||||
<p>Move the mouse over the reftest image on the right to show
|
||||
magnified pixels on the left. The color information above is for
|
||||
the pixel centered in the magnified view.</p>
|
||||
<p>Image 1 is shown in the upper triangle of each pixel and Image 2
|
||||
is shown in the lower triangle.</p>
|
||||
<p>
|
||||
Move the mouse over the reftest image on the right to show
|
||||
magnified pixels on the left. The color information above is
|
||||
for the pixel centered in the magnified view.
|
||||
</p>
|
||||
<p>
|
||||
Image 1 is shown in the upper triangle of each pixel and Image
|
||||
2 is shown in the lower triangle.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="magnification">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="84" shape-rendering="optimizeSpeed">
|
||||
<g id="mag"/>
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
width="84"
|
||||
height="84"
|
||||
shape-rendering="optimizeSpeed"
|
||||
>
|
||||
<g id="mag" />
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
<div id="itemlist"></div>
|
||||
<div id="images" style="display:none">
|
||||
<div id="images" style="display: none">
|
||||
<form id="imgcontrols">
|
||||
<input id="radio1" type="radio" name="which" value="0" onchange="show_image(1)" checked="checked" /><label id="label1" title="1" for="radio1">Image 1</label>
|
||||
<input id="radio2" type="radio" name="which" value="1" onchange="show_image(2)" /><label id="label2" title="2" for="radio2">Image 2</label>
|
||||
<label><input id="differences" type="checkbox" onchange="show_differences(this)" />Circle differences</label>
|
||||
<input
|
||||
id="radio1"
|
||||
type="radio"
|
||||
name="which"
|
||||
value="0"
|
||||
onchange="show_image(1)"
|
||||
checked="checked"
|
||||
/><label id="label1" title="1" for="radio1">Image 1</label>
|
||||
<input
|
||||
id="radio2"
|
||||
type="radio"
|
||||
name="which"
|
||||
value="1"
|
||||
onchange="show_image(2)"
|
||||
/><label id="label2" title="2" for="radio2">Image 2</label>
|
||||
<label
|
||||
><input
|
||||
id="differences"
|
||||
type="checkbox"
|
||||
onchange="show_differences(this)"
|
||||
/>Circle differences</label
|
||||
>
|
||||
</form>
|
||||
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="800" height="1000" id="svg">
|
||||
<svg
|
||||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink"
|
||||
version="1.1"
|
||||
width="800"
|
||||
height="1000"
|
||||
id="svg"
|
||||
>
|
||||
<defs>
|
||||
<!-- use sRGB to avoid loss of data -->
|
||||
<filter id="showDifferences" x="0%" y="0%" width="100%" height="100%"
|
||||
style="color-interpolation-filters: sRGB">
|
||||
<filter
|
||||
id="showDifferences"
|
||||
x="0%"
|
||||
y="0%"
|
||||
width="100%"
|
||||
height="100%"
|
||||
style="color-interpolation-filters: sRGB"
|
||||
>
|
||||
<feImage id="feimage1" result="img1" xlink:href="#image1" />
|
||||
<feImage id="feimage2" result="img2" xlink:href="#image2" />
|
||||
<!-- inv1 and inv2 are the images with RGB inverted -->
|
||||
|
|
@ -882,8 +943,22 @@ function move_pixel(deltax, deltay) {
|
|||
intermediate states, but feComposite
|
||||
type="arithmetic" can't transform the RGB channels
|
||||
and leave the alpha channel untouched. -->
|
||||
<feComposite result="w1" in="img1" in2="inv2" operator="arithmetic" k2="1" k3="1" />
|
||||
<feComposite result="w2" in="img2" in2="inv1" operator="arithmetic" k2="1" k3="1" />
|
||||
<feComposite
|
||||
result="w1"
|
||||
in="img1"
|
||||
in2="inv2"
|
||||
operator="arithmetic"
|
||||
k2="1"
|
||||
k3="1"
|
||||
/>
|
||||
<feComposite
|
||||
result="w2"
|
||||
in="img2"
|
||||
in2="inv1"
|
||||
operator="arithmetic"
|
||||
k2="1"
|
||||
k3="1"
|
||||
/>
|
||||
<!-- c1 will have non-black pixels anywhere that img2
|
||||
is brighter than img1, and c2 for the reverse -->
|
||||
<feComponentTransfer result="c1" in="w1">
|
||||
|
|
@ -897,20 +972,51 @@ function move_pixel(deltax, deltay) {
|
|||
<feFuncB type="linear" slope="-1" intercept="1" />
|
||||
</feComponentTransfer>
|
||||
<!-- c will be nonblack (and fully on) for every pixel+component where there are differences -->
|
||||
<feComposite result="c" in="c1" in2="c2" operator="arithmetic" k2="255" k3="255" />
|
||||
<feComposite
|
||||
result="c"
|
||||
in="c1"
|
||||
in2="c2"
|
||||
operator="arithmetic"
|
||||
k2="255"
|
||||
k3="255"
|
||||
/>
|
||||
<!-- a will be opaque for every pixel with differences and transparent for all others -->
|
||||
<feColorMatrix result="a" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0" />
|
||||
<feColorMatrix
|
||||
result="a"
|
||||
type="matrix"
|
||||
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 1 0 0"
|
||||
/>
|
||||
|
||||
<!-- a, dilated by 1 pixel -->
|
||||
<feMorphology result="dila1" in="a" operator="dilate" radius="1" />
|
||||
<feMorphology
|
||||
result="dila1"
|
||||
in="a"
|
||||
operator="dilate"
|
||||
radius="1"
|
||||
/>
|
||||
<!-- a, dilated by 2 pixels -->
|
||||
<feMorphology result="dila2" in="dila1" operator="dilate" radius="1" />
|
||||
<feMorphology
|
||||
result="dila2"
|
||||
in="dila1"
|
||||
operator="dilate"
|
||||
radius="1"
|
||||
/>
|
||||
|
||||
<!-- all the pixels in the 2-pixel dilation of a but not in the 1-pixel dilation, to highlight the diffs -->
|
||||
<feComposite result="highlight" in="dila2" in2="dila1" operator="out" />
|
||||
<feComposite
|
||||
result="highlight"
|
||||
in="dila2"
|
||||
in2="dila1"
|
||||
operator="out"
|
||||
/>
|
||||
|
||||
<feFlood result="red" flood-color="red" />
|
||||
<feComposite result="redhighlight" in="red" in2="highlight" operator="in" />
|
||||
<feComposite
|
||||
result="redhighlight"
|
||||
in="red"
|
||||
in2="highlight"
|
||||
operator="in"
|
||||
/>
|
||||
<feFlood result="black" flood-color="black" flood-opacity="0.5" />
|
||||
<feMerge>
|
||||
<feMergeNode in="black" />
|
||||
|
|
@ -922,11 +1028,18 @@ function move_pixel(deltax, deltay) {
|
|||
<image x="0" y="0" width="100%" height="100%" id="image1" />
|
||||
<image x="0" y="0" width="100%" height="100%" id="image2" />
|
||||
</g>
|
||||
<rect id="diffrect" filter="url(#showDifferences)" pointer-events="none" x="0" y="0" width="100%" height="100%" />
|
||||
<rect
|
||||
id="diffrect"
|
||||
filter="url(#showDifferences)"
|
||||
pointer-events="none"
|
||||
x="0"
|
||||
y="0"
|
||||
width="100%"
|
||||
height="100%"
|
||||
/>
|
||||
</svg>
|
||||
<div id="pixel-differences"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,12 +1,14 @@
|
|||
<!-- 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/. -->
|
||||
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
<window
|
||||
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
id="reftest-window"
|
||||
hidechrome="true"
|
||||
onload="OnRefTestLoad();"
|
||||
onunload="OnRefTestUnload();"
|
||||
style="background:white; overflow:hidden">
|
||||
style="background: white; overflow: hidden"
|
||||
>
|
||||
<script type="application/ecmascript" src="resource://reftest/reftest.jsm" />
|
||||
<!-- The reftest browser element is dynamically created, here -->
|
||||
</window>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
|
||||
debug.assertion('failed assertion check', 'false', 'assert.html', 6);
|
||||
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
|
||||
debug.assertion("failed assertion check", "false", "assert.html", 6);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
<script>
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
const Cc = SpecialPowers.Cc;
|
||||
const Ci = SpecialPowers.Ci;
|
||||
|
||||
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
|
||||
debug.abort('crash.html', 6);
|
||||
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
|
||||
debug.abort("crash.html", 6);
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="color: green">Text</div>
|
||||
</body>
|
||||
<body>
|
||||
<div style="color: green">Text</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<body>
|
||||
<div style="color: red">Text</div>
|
||||
</body>
|
||||
<body>
|
||||
<div style="color: red">Text</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>scripttest-pass</title>
|
||||
<script type="text/javascript">
|
||||
function getTestCases()
|
||||
{
|
||||
<head>
|
||||
<title>scripttest-pass</title>
|
||||
<script type="text/javascript">
|
||||
function getTestCases() {
|
||||
return [
|
||||
{ testPassed: (function () { return true; }), testDescription: (function () { return "passed"; }) }
|
||||
{
|
||||
testPassed: function () {
|
||||
return true;
|
||||
},
|
||||
testDescription: function () {
|
||||
return "passed";
|
||||
},
|
||||
},
|
||||
];
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>scripttest-pass</h1>
|
||||
</body>
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<h1>scripttest-pass</h1>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
|||
Loading…
Reference in a new issue