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:
Mark Banner 2023-09-24 10:38:55 +00:00
parent 3dd3f97545
commit b8dcda2dd2
16 changed files with 6189 additions and 5213 deletions

View file

@ -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*/

View file

@ -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,9 +40,18 @@ 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;
}
}
@ -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);
}
@ -78,13 +102,18 @@ class ReftestFissionChild extends JSWindowActorChild {
return returnStrings;
},
function (reason) {
returnStrings.errorStrings.push("SetupDisplayport SendQuery to parent promise rejected: " + 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) {
@ -194,8 +286,7 @@ class ReftestFissionChild extends JSWindowActorChild {
}
return { errorStrings };
}
case "FlushRendering":
{
case "FlushRendering": {
let errorStrings = [];
let warningStrings = [];
let infoStrings = [];
@ -207,7 +298,9 @@ class ReftestFissionChild extends JSWindowActorChild {
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,11 +345,14 @@ 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);
@ -261,19 +360,21 @@ class ReftestFissionChild extends JSWindowActorChild {
return { errorStrings, warningStrings, infoStrings };
}
case "SetupDisplayport":
{
case "SetupDisplayport": {
let contentRootElement = this.document.documentElement;
let winUtils = this.contentWindow.windowUtils;
let returnStrings = { infoStrings: [], errorStrings: [] };
if (contentRootElement) {
this.setupDisplayportForElementSubtree(contentRootElement, winUtils, returnStrings);
this.setupDisplayportForElementSubtree(
contentRootElement,
winUtils,
returnStrings
);
}
return returnStrings;
}
case "SetupAsyncScrollOffsets":
{
case "SetupAsyncScrollOffsets": {
let returns = { infoStrings: [], errorStrings: [], updatedAny: false };
let contentRootElement = this.document.documentElement;
@ -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;
}
}
}
}

View file

@ -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,7 +72,9 @@ 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 };
}
@ -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);
infoStrings.push(
"tellChildrenToUpdateLayerTree EmptyMessage msg to child rejected: " +
e
);
}
try {
@ -100,9 +132,11 @@ 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
);
}
}
}
}
@ -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;
}
@ -180,12 +233,10 @@ class ReftestFissionParent extends JSWindowActorParent {
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;
}
@ -231,8 +291,6 @@ class ReftestFissionParent extends JSWindowActorParent {
return { errorStrings, infoStrings, updatedAny };
});
}
}
}
}

View file

@ -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: {
@ -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);

View file

@ -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,17 +962,20 @@ 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));
@ -770,22 +984,20 @@ function AddTestItem(aTest, aFilter, aManifestID) {
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...");
}

View file

@ -22,7 +22,8 @@ Features to add:
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Reftest analyzer</title>
<style type="text/css"><![CDATA[
<style type="text/css">
<![CDATA[
html, body { margin: 0; }
html { padding: 0; }
@ -62,8 +63,10 @@ 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";
@ -519,20 +522,25 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
ID("pix2rgb").textContent = pix2rgb;
}
]]></script>
]]>
</script>
</head>
<body onload="load()">
<div id="entry">
<h1>Reftest analyzer: load raw structured log</h1>
<p>Either paste your log into this textarea:<br />
<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>
<input
type="button"
value="Process pasted log"
onclick="log_pasted()"
/>
</p>
<p>... or load it from a file:<br/>
<p>
... or load it from a file:<br />
<input type="file" id="fileentry" onchange="fileentry_changed()" />
</p>
</div>
@ -544,25 +552,46 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
<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">
<svg
xmlns="http://www.w3.org/2000/svg"
width="84"
height="84"
shape-rendering="optimizeSpeed"
>
<g id="mag" />
</svg>
</div>
@ -570,15 +599,47 @@ function show_pixelinfo(x, y, pix1rgb, pix1hex, pix2rgb, pix2hex) {
<div id="itemlist"></div>
<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>
</html>

View file

@ -22,7 +22,8 @@ Features to add:
<html lang="en-US" xml:lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Reftest analyzer</title>
<style type="text/css"><![CDATA[
<style type="text/css">
<![CDATA[
html, body { margin: 0; }
html { padding: 0; }
@ -62,8 +63,10 @@ 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";
@ -803,20 +806,25 @@ function move_pixel(deltax, deltay) {
}
}
]]></script>
]]>
</script>
</head>
<body onload="load()">
<div id="entry">
<h1>Reftest analyzer: load reftest log</h1>
<p>Either paste your log into this textarea:<br />
<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>
<input
type="button"
value="Process pasted log"
onclick="log_pasted()"
/>
</p>
<p>... or load it from a file:<br/>
<p>
... or load it from a file:<br />
<input type="file" id="fileentry" onchange="fileentry_changed()" />
</p>
</div>
@ -828,25 +836,46 @@ function move_pixel(deltax, deltay) {
<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">
<svg
xmlns="http://www.w3.org/2000/svg"
width="84"
height="84"
shape-rendering="optimizeSpeed"
>
<g id="mag" />
</svg>
</div>
@ -854,15 +883,47 @@ function move_pixel(deltax, deltay) {
<div id="itemlist"></div>
<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>
</html>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -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>

View file

@ -3,5 +3,5 @@ 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);
debug.assertion("failed assertion check", "false", "assert.html", 6);
</script>

View file

@ -3,5 +3,5 @@ const Cc = SpecialPowers.Cc;
const Ci = SpecialPowers.Ci;
let debug = Cc["@mozilla.org/xpcom/debug;1"].getService(Ci.nsIDebug2);
debug.abort('crash.html', 6);
debug.abort("crash.html", 6);
</script>

View file

@ -3,10 +3,16 @@
<head>
<title>scripttest-pass</title>
<script type="text/javascript">
function getTestCases()
{
function getTestCases() {
return [
{ testPassed: (function () { return true; }), testDescription: (function () { return "passed"; }) }
{
testPassed: function () {
return true;
},
testDescription: function () {
return "passed";
},
},
];
}
</script>