Bug 1543095 - Pass `frameId` to all Page events. r=ato

Differential Revision: https://phabricator.services.mozilla.com/D28957

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Alexandre Poirot 2019-04-29 13:42:55 +00:00
Родитель 5a549b8d58
Коммит ff0fe13c9f
2 изменённых файлов: 13 добавлений и 3 удалений

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

@ -119,10 +119,10 @@ class Page extends ContentProcessDomain {
break;
case "pageshow":
this.emit("Page.loadEventFired", {timestamp});
this.emit("Page.loadEventFired", {timestamp, frameId});
// XXX this should most likely be sent differently
this.emit("Page.navigatedWithinDocument", {timestamp});
this.emit("Page.frameStoppedLoading", {timestamp});
this.emit("Page.navigatedWithinDocument", {timestamp, frameId, url});
this.emit("Page.frameStoppedLoading", {timestamp, frameId});
break;
}
}

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

@ -97,6 +97,16 @@ async function testCDP() {
is(frameNavigated.frame.url, url, "frameNavigated url is the same being given to " +
"Page.navigate");
const navigatedWithinDocument = resolutions.get("navigatedWithinDocument");
is(navigatedWithinDocument.frameId, frameId, "navigatedWithinDocument frameId is " +
"the same than the one returned by Page.navigate");
is(navigatedWithinDocument.url, url, "navigatedWithinDocument url is the same than " +
"the one being given to Page.navigate");
const frameStoppedLoading = resolutions.get("frameStoppedLoading");
is(frameStoppedLoading.frameId, frameId, "frameStoppedLoading frameId is the same " +
"than the one returned by Page.navigate");
await client.close();
ok(true, "The client is closed");