icecat: add release icecat-140.9.0-1gnu1 for ecne
This commit is contained in:
parent
8eb1f1732f
commit
a5f93cb214
1197 changed files with 30593 additions and 15344 deletions
|
|
@ -746,7 +746,7 @@ class RequestListContextMenu {
|
|||
};
|
||||
|
||||
const options = JSON.stringify(fetchOptions, null, 4);
|
||||
const fetchString = `await fetch("${url}", ${options});`;
|
||||
const fetchString = `await fetch(${JSON.stringify(url)}, ${options});`;
|
||||
return fetchString;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,10 +50,11 @@ add_task(async function () {
|
|||
const types = ["end", "response", "duration", "latency"];
|
||||
|
||||
for (const t of types) {
|
||||
info("Check the timing column for type: " + t);
|
||||
await waitUntil(() => {
|
||||
const node = item.querySelector(".requests-list-" + t + "-time");
|
||||
const value = parseInt(node.textContent, 10);
|
||||
return value > 0;
|
||||
return value >= 0;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
* Tests if Copy as Fetch works.
|
||||
*/
|
||||
|
||||
add_task(async function () {
|
||||
add_task(async function testBasicCopyAsFetch() {
|
||||
const { tab, monitor } = await initNetMonitor(HTTPS_CURL_URL, {
|
||||
requestCount: 1,
|
||||
});
|
||||
|
|
@ -15,7 +15,9 @@ add_task(async function () {
|
|||
|
||||
// GET request, no cookies (first request)
|
||||
await performRequest("GET");
|
||||
await testClipboardContent(`await fetch("https://example.com/browser/devtools/client/netmonitor/test/sjs_simple-test-server.sjs", {
|
||||
await testClipboardContent(
|
||||
monitor,
|
||||
`await fetch("https://example.com/browser/devtools/client/netmonitor/test/sjs_simple-test-server.sjs", {
|
||||
"credentials": "omit",
|
||||
"headers": {
|
||||
"User-Agent": "${navigator.userAgent}",
|
||||
|
|
@ -33,7 +35,8 @@ add_task(async function () {
|
|||
"referrer": "https://example.com/browser/devtools/client/netmonitor/test/html_copy-as-curl.html",
|
||||
"method": "GET",
|
||||
"mode": "cors"
|
||||
});`);
|
||||
});`
|
||||
);
|
||||
|
||||
await teardown(monitor);
|
||||
|
||||
|
|
@ -54,39 +57,71 @@ add_task(async function () {
|
|||
);
|
||||
await waitRequest;
|
||||
}
|
||||
|
||||
async function testClipboardContent(expectedResult) {
|
||||
const { document } = monitor.panelWin;
|
||||
|
||||
const items = document.querySelectorAll(".request-list-item");
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, items[items.length - 1]);
|
||||
EventUtils.sendMouseEvent(
|
||||
{ type: "contextmenu" },
|
||||
document.querySelectorAll(".request-list-item")[0]
|
||||
);
|
||||
|
||||
/* Ensure that the copy as fetch option is always visible */
|
||||
is(
|
||||
!!getContextMenuItem(monitor, "request-list-context-copy-as-fetch"),
|
||||
true,
|
||||
'The "Copy as Fetch" context menu item should not be hidden.'
|
||||
);
|
||||
|
||||
await waitForClipboardPromise(
|
||||
async function setup() {
|
||||
await selectContextMenuItem(
|
||||
monitor,
|
||||
"request-list-context-copy-as-fetch"
|
||||
);
|
||||
},
|
||||
function validate(result) {
|
||||
if (typeof result !== "string") {
|
||||
return false;
|
||||
}
|
||||
return expectedResult === result;
|
||||
}
|
||||
);
|
||||
|
||||
info("Clipboard contains a fetch command for item " + (items.length - 1));
|
||||
}
|
||||
});
|
||||
|
||||
/**
|
||||
* Tests for Url escaping of copy as Fetch
|
||||
*/
|
||||
add_task(async function testUrlEscapeOfCopyAsFetch() {
|
||||
const { monitor } = await initNetMonitor(HTTPS_CURL_URL, {
|
||||
requestCount: 1,
|
||||
});
|
||||
info("Starting test... ");
|
||||
|
||||
const waitRequest = waitForNetworkEvents(monitor, 1);
|
||||
await SpecialPowers.spawn(
|
||||
gBrowser.selectedBrowser,
|
||||
['data:text/html,"+alert(document.domain)+"'],
|
||||
url => {
|
||||
content.fetch(url);
|
||||
}
|
||||
);
|
||||
await waitRequest;
|
||||
|
||||
await testClipboardContent(
|
||||
monitor,
|
||||
`await fetch("data:text/html,\\"+alert(document.domain)+\\"", {
|
||||
"credentials": "omit",
|
||||
"headers": {},
|
||||
"method": "GET",
|
||||
"mode": "cors"
|
||||
});`
|
||||
);
|
||||
|
||||
await teardown(monitor);
|
||||
});
|
||||
|
||||
async function testClipboardContent(monitor, expectedResult) {
|
||||
const { document } = monitor.panelWin;
|
||||
|
||||
const items = document.querySelectorAll(".request-list-item");
|
||||
EventUtils.sendMouseEvent({ type: "mousedown" }, items[items.length - 1]);
|
||||
EventUtils.sendMouseEvent(
|
||||
{ type: "contextmenu" },
|
||||
document.querySelectorAll(".request-list-item")[0]
|
||||
);
|
||||
|
||||
/* Ensure that the copy as fetch option is always visible */
|
||||
is(
|
||||
!!getContextMenuItem(monitor, "request-list-context-copy-as-fetch"),
|
||||
true,
|
||||
'The "Copy as Fetch" context menu item should not be hidden.'
|
||||
);
|
||||
|
||||
await waitForClipboardPromise(
|
||||
async function setup() {
|
||||
await selectContextMenuItem(
|
||||
monitor,
|
||||
"request-list-context-copy-as-fetch"
|
||||
);
|
||||
},
|
||||
function validate(result) {
|
||||
if (typeof result !== "string") {
|
||||
return false;
|
||||
}
|
||||
return expectedResult === result;
|
||||
}
|
||||
);
|
||||
|
||||
info("Clipboard contains a fetch command for item " + (items.length - 1));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,15 +10,13 @@ const DEFAULT_DPPX = window.devicePixelRatio;
|
|||
|
||||
/* eslint-disable max-len */
|
||||
const TEST_DEVICE = {
|
||||
name: "iPhone 6/7/8",
|
||||
width: 375,
|
||||
height: 667,
|
||||
pixelRatio: 2,
|
||||
name: "iPhone 17 / 17 Pro",
|
||||
width: 402,
|
||||
height: 874,
|
||||
pixelRatio: 3,
|
||||
userAgent:
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1",
|
||||
"Mozilla/5.0 (iPhone; CPU iPhone OS 18_6 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/26.0 Mobile/15E148 Safari/604.1",
|
||||
touch: true,
|
||||
icecatOS: false,
|
||||
os: "iOS",
|
||||
featured: true,
|
||||
};
|
||||
/* eslint-enable max-len */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue