1 createAppInfo("xpcshell@tests.mozilla.org", "XPCShell", "1", "1.9.2");
3 function mockAddonProvider(name) {
10 AddonManagerPrivate.markProviderSafe(this);
13 AddonManager.isInstallEnabled("made-up-mimetype");
15 supportsMimetype(mimetype) {
16 this.apiAccessed = true;
28 add_task(async function testMarkSafe() {
29 info("Starting with provider normally");
30 let provider = mockAddonProvider("Mock1");
31 AddonManagerPrivate.registerProvider(provider);
32 await promiseStartupManager();
33 ok(!provider.apiAccessed, "Provider API should not have been accessed");
34 AddonManagerPrivate.unregisterProvider(provider);
35 await promiseShutdownManager();
37 info("Starting with provider that marks itself safe");
38 provider.apiAccessed = false;
39 provider.markSafe = true;
40 AddonManagerPrivate.registerProvider(provider);
41 await promiseStartupManager();
42 ok(provider.apiAccessed, "Provider API should have been accessed");