This commit and commit message was mostly generated automatically by little_safefor.py. * Actors that had the annotation added: AllowJavascript, AppTestDelegate, BrowserTestUtils, Bug1622420, ColorPicker, ContentEventListener, ContentMeta, DampLoad, DateTimePicker, DocShellHelpers, ForceRefresh, FormAutofill, FullscreenFrame, Interactions, LayoutDebug, MarionetteCommands, MarionetteEvents, MarionetteReftest, PageData, PictureInPicture, PictureInPictureLauncher, PictureInPictureToggle, ReftestFission, Screenshot, Select, SpecialPowers, SpecialPowersProcessActor, StartupContentSubframe, TPSFxAAutofill, TalosTabSwitch, TestSupport, TestSupportProcess, TestWorkerWatcher, UserCharacteristicsWindowInfo, UserCharacteristicsCanvasRendering, WPTEvents, WebDriverDocumentInserted, WebDriverProcessData, WebDriverWorkerListener * Actors that were seen that shouldn't have the annotation: AboutNewTab, AboutTranslations, CodeMirrorTest, MigrationWizard, MozCachedOHTTP, UserCharacteristics Files that were skipped by the analysis: browser/extensions/newtab/lib/ExternalComponentsFeed.sys.mjs This one does something weird, but I think it only registers ASRouterNewTabMessage, which is non-web. devtools/server/actors/watcher/ParentProcessWatcherRegistry.sys.mjs This one does something weird so it is manually fixed separately. dom/chrome-webidl/JSProcessActor.webidl dom/chrome-webidl/JSWindowActor.webidl These two files define the register calls and aren't actually calling it. dom/ipc/tests/JSProcessActor/browser_registerProcessActor.js dom/ipc/tests/JSProcessActor/head.js dom/ipc/tests/JSWindowActor/browser_registerWindowActor.js dom/ipc/tests/JSWindowActor/head.js These four files do something weird and this is manually fixed up as part of the patch that adds the annotation. mobile/shared/modules/geckoview/GeckoViewActorManager.sys.mjs This file handles the mass-registration of actors and is dealt with by the other automated patch. This is also the case for most of the registrations in ActorManagerParent.sys.mjs, but we also fix up some of the individual registrations in this patch. Differential Revision: https://phabricator.services.mozilla.com/D304934
33 lines
948 B
JavaScript
33 lines
948 B
JavaScript
const ACTOR = "Bug1622420";
|
|
|
|
add_task(async function test() {
|
|
let base = getRootDirectory(gTestPath).slice(0, -1);
|
|
ChromeUtils.registerWindowActor(ACTOR, {
|
|
allFrames: true,
|
|
child: {
|
|
esModuleURI: `${base}/Bug1622420Child.sys.mjs`,
|
|
},
|
|
safeForUntrustedWebProcess: true,
|
|
});
|
|
|
|
registerCleanupFunction(async () => {
|
|
gBrowser.removeTab(tab);
|
|
|
|
ChromeUtils.unregisterWindowActor(ACTOR);
|
|
});
|
|
|
|
let tab = await BrowserTestUtils.openNewForegroundTab(
|
|
gBrowser,
|
|
// eslint-disable-next-line @microsoft/sdl/no-insecure-url
|
|
"http://example.org/browser/docshell/test/browser/file_bug1622420.html"
|
|
);
|
|
let childBC = tab.linkedBrowser.browsingContext.children[0];
|
|
let success = await childBC.currentWindowGlobal
|
|
.getActor(ACTOR)
|
|
.sendQuery("hasWindowContextForTopBC");
|
|
ok(
|
|
success,
|
|
"Should have a WindowContext for the top BrowsingContext in the process of a child BrowsingContext"
|
|
);
|
|
});
|