Closed Bug 1875065 Opened 4 months ago Closed 12 days ago

Implement "permissions.setPermission" command

Categories

(Remote Protocol :: WebDriver BiDi, task, P2)

task
Points:
5

Tracking

(firefox127 fixed)

RESOLVED FIXED
127 Branch
Tracking Status
firefox127 --- fixed

People

(Reporter: whimboo, Assigned: Sasha)

References

(Blocks 4 open bugs, )

Details

(Whiteboard: [webdriver:m11], [wptsync upstream])

Attachments

(3 files)

Let implement the external command permissions.setPermission for setting browser permissions via WebDriver BiDi.

Blocks: 1524074

Tests will be sync'ed soon via bug 1872136.

Depends on: 1872136

After talking to Alex we most likely should get started with geolocation (in combination with emulation), push and clipboard. The others are most likely less frequently used.

The very basic implementation that we have for Marionette can be found at:
https://searchfox.org/mozilla-central/source/remote/marionette/permissions.sys.mjs

We should make sure that this becomes a shared module so it can be used by both implementations. If that's hard to do lets have a separate implementation for BiDi first and afterward update Marionette to use it.

Oh hey, I started to work on this to finally get rid of hacks from my tests and then found this! Have you already started your work? 👀 (I'm just generalizing the addFromPrincipal calls for storage-access.)

Flags: needinfo?(hskupin)

No we didn't start the work yet and I saw your patch on bug 1524074. Lets move that one to another bug which should block this one as well. It would clearly give us a good starting point for the BiDi implementation. Thanks a lot!

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

Nice! I filed bug 1875257 👍

Flags: needinfo?(krosylight)
Depends on: 1875257
Depends on: 1875067
Points: --- → 5
Whiteboard: [webdriver:m11]
Assignee: nobody → aborovova
Status: NEW → ASSIGNED
Depends on: 1894217
Blocks: 1894217
No longer depends on: 1894217
Blocks: 1895457
Pushed by aborovova@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/824de0ff3b56
Move permissions module to the shared folder. r=webdriver-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/007c815885ff
[bidi] Implement "permissions.setPermission" command. r=webdriver-reviewers,jdescottes,whimboo
https://hg.mozilla.org/integration/autoland/rev/f5d605c87173
[wdspec] Remove test cases for "permissions.setPermission" command which are invalid for Firefox. r=webdriver-reviewers,whimboo,jdescottes
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/46146 for changes under testing/web-platform/tests
Whiteboard: [webdriver:m11] → [webdriver:m11], [wptsync upstream]

Backed out for causing wpt crashes on instance.https.html.

[task 2024-05-07T20:01:02.420Z] 20:01:02     INFO - TEST-START | /notifications/instance.https.html
[task 2024-05-07T20:01:02.420Z] 20:01:02     INFO - Setting pref dom.webnotifications.requireinteraction.enabled to true
[task 2024-05-07T20:01:02.421Z] 20:01:02     INFO - Setting pref dom.webnotifications.vibrate.enabled to false
[task 2024-05-07T20:01:02.425Z] 20:01:02     INFO - Setting pref dom.webnotifications.silent.enabled to true
[task 2024-05-07T20:01:02.437Z] 20:01:02     INFO - Closing window 074d94ff-4f1d-4ab4-bc96-146373b54def
[task 2024-05-07T20:01:02.723Z] 20:01:02     INFO - PID 1644 | FATAL ERROR: Non-local network connections are disabled and a connection attempt to example.com (93.184.215.14) was made.
[task 2024-05-07T20:01:02.724Z] 20:01:02     INFO - PID 1644 | You should only access hostnames available via the test networking proxy (if running mochitests) or from a test-specific httpd.js server (if running xpcshell tests). Browser services should be disabled or redirected to a local server.
[task 2024-05-07T20:01:02.727Z] 20:01:02     INFO - PID 1644 | [1644] Hit MOZ_CRASH(Attempting to connect to non-local address! opener is [unknown], uri is [http://example.com/icon.png]) at /builds/worker/checkouts/gecko/netwerk/protocol/http/nsHttpChannel.cpp:7381
[task 2024-05-07T20:01:02.733Z] 20:01:02     INFO - STDOUT: Initializing stack-fixing for the first stack frame, this may take a while...
[task 2024-05-07T20:01:03.125Z] 20:01:03     INFO - IOError on command, setting status to CRASH
[task 2024-05-07T20:01:03.127Z] 20:01:03     INFO - mozcrash Copy/paste: /opt/worker/tasks/task_171511114848422/fetches/minidump-stackwalk/minidump-stackwalk --symbols-url=https://symbols.mozilla.org/ --cyborg=/var/folders/cz/qv3bqv2n7vbg9gg9t4mb47y0000014/T/tmphi58su4w/B2DC2E30-471E-4F98-A4FB-AEDAA6CFDB72.trace /var/folders/cz/qv3bqv2n7vbg9gg9t4mb47y0000014/T/tmpcwszyvbb/minidumps/B2DC2E30-471E-4F98-A4FB-AEDAA6CFDB72.dmp /opt/worker/tasks/task_171511114848422/build/symbols
[task 2024-05-07T20:01:11.756Z] 20:01:11     INFO - mozcrash Saved minidump as /opt/worker/tasks/task_171511114848422/build/blobber_upload_dir/B2DC2E30-471E-4F98-A4FB-AEDAA6CFDB72.dmp
[task 2024-05-07T20:01:11.756Z] 20:01:11     INFO - mozcrash Saved app info as /opt/worker/tasks/task_171511114848422/build/blobber_upload_dir/B2DC2E30-471E-4F98-A4FB-AEDAA6CFDB72.extra
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - PROCESS-CRASH | Attempting to connect to non-local address! opener is [unknown], uri is [http://example.com/icon.png] [@ mozilla::net::nsHttpChannel::OnStartRequest] | /notifications/instance.https.html 
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Process type: main
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Process pid: 1644
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Mozilla crash reason: Attempting to connect to non-local address! opener is [unknown], uri is [http://example.com/icon.png]
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Crash dump filename: /var/folders/cz/qv3bqv2n7vbg9gg9t4mb47y0000014/T/tmpcwszyvbb/minidumps/B2DC2E30-471E-4F98-A4FB-AEDAA6CFDB72.dmp
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Operating system: Mac OS X
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO -                   10.15.7 19H524
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - CPU: amd64
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO -      family 6 model 158 stepping 10
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO -      12 CPUs
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - 
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Crash reason:  EXC_BAD_ACCESS / KERN_INVALID_ADDRESS
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Crash address: 0x0000000000000000
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Crashing instruction: `mov dword [0x0], 0x1cd5`
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Memory accessed by instruction:
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO -   0. Address: 0x0000000000000000
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO -      Size: 4
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Mac Crash Info:
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - 
[task 2024-05-07T20:01:12.258Z] 20:01:12     INFO - Mac Boot Args: chunklist-security-epoch=0 -chunklist-no-rev2-dev
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO - 
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO - Process uptime: 15 seconds
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO - 
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO - Thread 0 MainThread (crashed)
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  0  XUL!MOZ_Crash(char const*, int, char const*) [Assertions.h:f5d605c87173305d279124e1011544261ec4b807 : 317]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: inlining
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  1  XUL!mozilla::net::nsHttpChannel::OnStartRequest(nsIRequest*) [nsHttpChannel.cpp:f5d605c87173305d279124e1011544261ec4b807 : 7374 + 0x1e]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rax = 0x000000010b001a18    rdx = 0x0000000000000000
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rcx = 0x0000000116b13e6c    rbx = 0x000000013b4c2108
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rsi = 0x00000000000120a8    rdi = 0x00007fff924c1ca8
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rbp = 0x00007ffee4cd81d0    rsp = 0x00007ffee4cd80d0
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -       r8 = 0x00000000000130a8     r9 = 0x0000000000000000
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r10 = 0x00007fff924c1cc8    r11 = 0x00007fff924c1cc0
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r12 = 0xaaaaaaaaaaaaaaaa    r13 = 0x00000001161f22c0
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r14 = 0x0000000121922650    r15 = 0xaaaaaaaaaaaaaaaa
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rip = 0x00000001175f4a52
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: given as instruction pointer in context
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  2  XUL!nsInputStreamPump::OnStateStart() [nsInputStreamPump.cpp:f5d605c87173305d279124e1011544261ec4b807 : 504 + 0x8]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rbx = 0x0000000138e68890    rbp = 0x00007ffee4cd8210
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd81e0    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x0000000138e68930
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r15 = 0xaaaaaaaaaaaaaaaa    rip = 0x0000000117097149
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  3  XUL!nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*) [nsInputStreamPump.cpp:f5d605c87173305d279124e1011544261ec4b807 : 409 + 0x7]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rbx = 0x0000000138e68890    rbp = 0x00007ffee4cd8260
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd8220    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x0000000138e68930
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r15 = 0x000000011709704c    rip = 0x0000000117096d7c
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  4  XUL!{virtual override thunk({offset(-24)}, nsInputStreamPump::OnInputStreamReady(nsIAsyncInputStream*))} [nsInputStreamPump.cpp:f5d605c87173305d279124e1011544261ec4b807 : 0 + 0xc]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rbx = 0x00000001353cf400    rbp = 0x00007ffee4cd8270
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd8270    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x00007ffee4cd8328
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r15 = 0x00000001353cf400    rip = 0x0000000117097f9d
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  5  XUL!CallbackHolder::CallbackHolder(nsIAsyncInputStream*, nsIInputStreamCallback*, unsigned int, nsIEventTarget*)::{lambda()#1}::operator()() const [nsPipe3.cpp:f5d605c87173305d279124e1011544261ec4b807 : 73]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -     Found by: inlining
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -  6  XUL!NS_NewCancelableRunnableFunction<CallbackHolder::CallbackHolder(nsIAsyncInputStream*, nsIInputStreamCallback*, unsigned int, nsIEventTarget*)::{lambda()#1}>(char const*, CallbackHolder::CallbackHolder(nsIAsyncInputStream*, nsIInputStreamCallback*, unsigned int, nsIEventTarget*)::{lambda()#1}&&)::FuncCancelableRunnable::Run() [nsThreadUtils.h:f5d605c87173305d279124e1011544261ec4b807 : 636 + 0x15]
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rbx = 0x00000001353cf400    rbp = 0x00007ffee4cd8280
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd8280    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.259Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x00007ffee4cd8328
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r15 = 0x00000001353cf400    rip = 0x0000000116e142c0
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -  7  XUL!mozilla::RunnableTask::Run() [TaskController.cpp:f5d605c87173305d279124e1011544261ec4b807 : 580 + 0x5]
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rbx = 0x00000001353cf400    rbp = 0x00007ffee4cd82a0
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd8290    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x00007ffee4cd8328
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r15 = 0x00000001353cf400    rip = 0x0000000116e5c308
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -  8  XUL!mozilla::TaskController::DoExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [TaskController.cpp:f5d605c87173305d279124e1011544261ec4b807 : 907 + 0x8]
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rbx = 0x0000000000000004    rbp = 0x00007ffee4cd88c0
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd82b0    r12 = 0x0000000122b66054
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r13 = 0x00000001161f22c0    r14 = 0x00007ffee4cd8328
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r15 = 0x00000001353cf400    rip = 0x0000000116e51786
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -  9  XUL!mozilla::TaskController::ExecuteNextTaskOnlyMainThreadInternal(mozilla::detail::BaseAutoLock<mozilla::Mutex&> const&) [TaskController.cpp:f5d605c87173305d279124e1011544261ec4b807 : 730 + 0xa]
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rbx = 0x00000001161f2100    rbp = 0x00007ffee4cd8910
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      rsp = 0x00007ffee4cd88d0    r12 = 0x0000000000000000
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r13 = 0x00007ffee4cd8928    r14 = 0x000000010b22f5e0
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -      r15 = 0x00007ffee4cd8a00    rip = 0x0000000116e50169
[task 2024-05-07T20:01:12.260Z] 20:01:12     INFO -     Found by: call frame info
<...>
[task 2024-05-07T20:01:12.264Z] 20:01:12     INFO - 36  firefox!main [nsBrowserApp.cpp:f5d605c87173305d279124e1011544261ec4b807 : 448 + 0x108]
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rbx = 0x0000000000000006    rbp = 0x00007ffee4cdaa10
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rsp = 0x00007ffee4cda5c0    r12 = 0x000000010af2728e
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r13 = 0x00007ffee4cdad51    r14 = 0x00007ffee4cdaa38
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r15 = 0x000000000000002d    rip = 0x000000010af24c80
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO - 37  libdyld.dylib!start + 0x0
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rbx = 0x0000000000000000    rbp = 0x00007ffee4cdaa28
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rsp = 0x00007ffee4cdaa20    r12 = 0x0000000000000000
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r13 = 0x0000000000000000    r14 = 0x0000000000000000
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r15 = 0x0000000000000000    rip = 0x00007fff6bc16cc9
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO - 38  libdyld.dylib!start + 0x0
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rbx = 0x0000000000000000    rbp = 0x00007ffee4cdaa28
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      rsp = 0x00007ffee4cdaa28    r12 = 0x0000000000000000
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r13 = 0x0000000000000000    r14 = 0x0000000000000000
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -      r15 = 0x0000000000000000    rip = 0x00007fff6bc16cc9
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO -     Found by: call frame info
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO - 
[task 2024-05-07T20:01:12.265Z] 20:01:12     INFO - Thread 1 
Flags: needinfo?(aborovova)
Upstream PR was closed without merging
Pushed by aborovova@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/9f364c760b2e
Move permissions module to the shared folder. r=webdriver-reviewers,jdescottes
https://hg.mozilla.org/integration/autoland/rev/22a2d518d723
[bidi] Implement "permissions.setPermission" command. r=webdriver-reviewers,jdescottes,whimboo
https://hg.mozilla.org/integration/autoland/rev/c84d4a64a938
[wdspec] Remove test cases for "permissions.setPermission" command which are invalid for Firefox. r=webdriver-reviewers,whimboo,jdescottes
Flags: needinfo?(aborovova)
Status: ASSIGNED → RESOLVED
Closed: 12 days ago
Resolution: --- → FIXED
Target Milestone: --- → 127 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: