Add BrowserUtils test for shouldShowVPNPromo when an enterprise policy is active
Categories
(Firefox :: Messaging System, enhancement, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox99 | --- | fixed |
People
(Reporter: mviar, Assigned: mviar)
Details
Attachments
(1 file)
In Bug 1747149, the logic below was originally included in in toolkit/modules/tests/xpcshell/test_BrowserUtils.js's test_shouldShowVPNPromo test. Running it results in a Linux specific error where Services.appinfo.name is undefined when it's referenced in EnterprisePoliciesParent.jsm.
Investigate the cause of this error and find a way to mitigate it so we can test shouldShowVPNPromo when an enterprise policy is active.
// set up an arbitrary enterprise policy
await EnterprisePolicyTesting.setupPolicyEngineWithJson({
policies: {
EnableTrackingProtection: {
Value: true,
},
},
});
// Don't show VPN if there's an active enterprise policy
Assert.ok(!BrowserUtils.shouldShowVPNPromo());
await EnterprisePolicyTesting.setupPolicyEngineWithJson(""); // revert changes to policies
Updated•4 years ago
|
Updated•4 years ago
|
| Assignee | ||
Comment 1•4 years ago
|
||
Hi @kaply. We recently added some logic that checks for a active enterprise policies when determining whether to show VPN promos. Do you have any suggestions for investigating why Services.appinfo.name is undefined when it's referred to in this Linux specific logic in EnterprisePoliciesParent.jsm? It this case it was being called in the course of an xpcshell test (see above).
Comment 2•4 years ago
|
||
Service.appinfo.name is not defined by default for XPCShell tests.
You can add code similar to this to do that:
| Assignee | ||
Comment 3•4 years ago
|
||
Updated•4 years ago
|
Comment 5•4 years ago
|
||
Backed out for causing xpcshell failures on test_BrowserUtils.js
Failure line(s): TEST-UNEXPECTED-TIMEOUT | toolkit/modules/tests/xpcshell/test_BrowserUtils.js | Test timed out
| Assignee | ||
Comment 7•4 years ago
|
||
I added a condition to skip policy related parts of the test when the platform is Android as policies aren't supported on that platform.
Comment 8•3 years ago
|
||
| bugherder | ||
Description
•