await BrowserTestUtils.withNewTab("about:blank", async function (browser) {
await ContentTask.spawn(
browser,
{ aExecuteFromPBM, aDesc, aAssertURLStartsWith }, // eslint-disable-next-line no-shadow
async function ({ aExecuteFromPBM, aDesc, aAssertURLStartsWith }) { const responseURL = await new Promise(resolve => {
let xhr = new XMLHttpRequest();
xhr.timeout = 1200;
xhr.open("GET", "http://example.com"); if (aExecuteFromPBM) {
xhr.channel.loadInfo.originAttributes = {
privateBrowsingId: 1,
};
}
xhr.onreadystatechange = () => { // We don't care about the result and it's possible that // the requests might even succeed in some testing environments if (
xhr.readyState !== XMLHttpRequest.OPENED ||
xhr.readyState !== XMLHttpRequest.UNSENT
) { // Let's make sure this function does not get called anymore
xhr.onreadystatechange = undefined;
resolve(xhr.responseURL);
}
};
xhr.send();
});
ok(responseURL.startsWith(aAssertURLStartsWith), aDesc);
}
);
});
}
add_task(async function () {
requestLongerTimeout(2);
await runPrefTest( false, false, false, "Setting no prefs should not upgrade", "http://"
);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.