Bug 1869735 - [devtools] Use frameBrowsingContextID if available in network getChannelBrowsingContextID r=webdriver-reviewers,devtools-reviewers,bomsy,whimboo

Before, navigation requests performed for iframes would be linked to the parent's browsing context, whereas all other requests are linked to the iframe's browsing context.
With this change, all requests made for a frame will be associated with the frame's browsing context, navigation or not.

Differential Revision: https://phabricator.services.mozilla.com/D196326
This commit is contained in:
Julian Descottes 2023-12-15 11:30:42 +00:00
Родитель 07937a5d00
Коммит a81593bd09
2 изменённых файлов: 7 добавлений и 18 удалений

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

@ -99,6 +99,13 @@ function isChannelFromSystemPrincipal(channel) {
* @returns {number}
*/
function getChannelBrowsingContextID(channel) {
// `frameBrowsingContextID` is non-0 if the channel is loading an iframe.
// If available, use it instead of `browsingContextID` which is exceptionally
// set to the parent's BrowsingContext id for such channels.
if (channel.loadInfo.frameBrowsingContextID) {
return channel.loadInfo.frameBrowsingContextID;
}
if (channel.loadInfo.browsingContextID) {
return channel.loadInfo.browsingContextID;
}

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

@ -2249,12 +2249,6 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Frame.goto should navigate subframes",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Frame.goto should reject when frame detaches",
"platforms": ["darwin", "linux", "win32"],
@ -2285,12 +2279,6 @@
"parameters": ["cdp", "firefox"],
"expectations": ["FAIL"]
},
{
"testIdPattern": "[navigation.spec] navigation Frame.waitForNavigation should work",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["FAIL", "TIMEOUT"]
},
{
"testIdPattern": "[navigation.spec] navigation Page.goBack should work with HistoryAPI",
"platforms": ["darwin", "linux", "win32"],
@ -2621,12 +2609,6 @@
"parameters": ["chrome", "webDriverBiDi"],
"expectations": ["PASS"]
},
{
"testIdPattern": "[network.spec] network Request.frame should work for subframe navigation request",
"platforms": ["darwin", "linux", "win32"],
"parameters": ["firefox", "webDriverBiDi"],
"expectations": ["TIMEOUT", "FAIL"]
},
{
"testIdPattern": "[network.spec] network Request.headers should define Firefox as user agent header",
"platforms": ["darwin", "linux", "win32"],