Closed Bug 1573638 Opened 5 years ago Closed 5 years ago

Port functional/security/test_enable_privilege.py to a Mochitest

Categories

(Core :: XPConnect, task)

task
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: whimboo, Assigned: emk)

References

Details

As result of my conversation with Johann earlier today we want to get this test moved over to the web-platform-tests. Mainly because Firefox UI tests will be removed soon, and we need a test harness which doesn't set the security.turn_off_all_security_so_that_viruses_can_take_over_this_computer preference. And web-platform-tests seem to be a good candidate here, whereby this has to land under the mozilla sub folder.

Current test location:
https://searchfox.org/mozilla-central/rev/30b01f4f60dbcbd6b01500a26b3100c28005cf62/testing/firefox-ui/tests/functional/security/test_enable_privilege.py

Current HTML testcase:
https://searchfox.org/mozilla-central/source/testing/firefox-ui/resources/security/enable_privilege.html

Johann, what kind of component (sub directory) should that test belong to? xpcom maybe?

Flags: needinfo?(jhofmann)
Blocks: 1573383

I'd say this is Core Security. CC'ing Andrew who might be interested in this?

Component: Firefox UI Tests → Security
Flags: needinfo?(jhofmann)
Product: Testing → Core
QA Contact: hskupin
Version: Version 3 → unspecified

We would like to get rid of all the remaining security tests under testing/marionette. Andrew, do you know someone who could port this bug?

Flags: needinfo?(continuation)
Component: Security → XPConnect

What this test does is it tries to run
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
If that doesn't throw an exception, then the test fails. I'm not sure why this was a Marionette test in particular. I guess like you said in comment 0, this was probably just a handy test suite that didn't have high privileges enabled.

Do we actually use UniversalXPConnect in Mochitests any more? I thought we'd gotten rid of it outside of Talos. Maybe it is still pref'ed on there. It looks like it is still enabled. I wonder how hard it would be to move the pref into profiles for specific test suites that actually use it.

I guess IsInAutomation is used for other things, so we probably can't just flip the pref off. We could add an additional pref to disable netscape.security.PrivilegeManager.enablePrivilege even if IsInAutomation is true, but then the test would just be testing that pref and not IsInAutomation.

What sort of timeline are you looking for getting rid of this test?

Do you know how to run the tests in the mozilla WPT directory? I tried
mach wpt mozilla/tests/binast/domain-restrict-excluded.https.html
mach wpt binast/domain-restrict-excluded.https.html
and neither worked.

Flags: needinfo?(continuation) → needinfo?(hskupin)

I don't care if this would happen in somewhat the next months. Anyway, it's one of the tests which keeping us running the firefox-ui-remote tests in CI, which is not actually worth it.

When I run that it works just fine:

mach wpt testing/web-platform/mozilla/tests/binast/domain-restrict-excluded.https.html

Maybe it needs the full path for the mozilla sub folder?

Flags: needinfo?(hskupin) → needinfo?(continuation)

Thanks. I'll try to take a look at this at some point.

Assignee: nobody → continuation
Flags: needinfo?(continuation)

Thanks Andrew. If it's not clear when you can work on that, maybe you give some instructions so that this bug could be a mentored one. I'm happy to assist as best as possible.

Flags: needinfo?(continuation)

Andrew, do you have any feedback to comment 8? It would be great to get this test moved over to wpt.

Looks like with bug 1448967 we remove the enablePrivilege feature. So I assume there is no need to keep this bug alive? Johann, what do you think?

Depends on: 1448967
Flags: needinfo?(jhofmann)

Well, with bug 1448967 I can turn it into a regular Mochitest, because enable privileges won't work anywhere.

Flags: needinfo?(continuation)
Flags: needinfo?(jhofmann)

It looks like emk is removing the existing test as part of bug 1448967.

Assignee: continuation → VYV03354
Summary: Port functional/security/test_enable_privilege.py to a web-platform-test → Port functional/security/test_enable_privilege.py to a Mochitest

Phabricator automatically added marionette-reviewers as a blocking reviewer of the bug 1448967 patch. Please sign off the change.

Flags: needinfo?(hskupin)
Flags: needinfo?(hskupin)

Based on bug 1448967 landing.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.