Commit Graph
109 Commits
Author SHA1 Message Date
Julian Descottes abf52aa74b Bug 2029978 - [remote] Prevent all script evaluation commands on parent process contexts r=whimboo
Differential Revision: https://phabricator.services.mozilla.com/D292489
2026-04-14 06:36:33 +00:00
Julian Descottes 0450ac1329 Bug 2027762 - [remote] Only allow specific commands from windowglobal modules r=Sasha
Differential Revision: https://phabricator.services.mozilla.com/D290938
2026-04-10 09:09:34 +00:00
Julian Descottes c91fea99a7 Bug 1936770 - [remote] Allow to emit an event for several related contexts r=Sasha
To support realm events for shared and service workers - which can have more than 1 related context - we need to adapt our logic to match several browsing contexts to a single context descriptor.

On the bidi spec, this is expressed in the event is enabled algorithm (https://w3c.github.io/webdriver-bidi/#event-is-enabled )which takes an array of navigables as parameter. In order to enable this, a few event-related APIs are modified to support matching several browsing context ids.

We should be able to emit an event related to N contexts, and the event should be emitted if:
- any subscription monitors any of the related contexts
- any subscription monitors the user context of any of the related contexts
- any subscription is global

Note that this allows to emit an event related to 0 browsing contexts. In that case, global subscriptions should still get the event.
While this is handy given that we can't currently retrieve the contexts related to service and shared worker, this is also an important feature in the long run.
It is completely possible to have a worker instance for a service worker which. starts running even if no related context is open at the moment.

A dedicated browser mochitest is added to cover the new feature.

Differential Revision: https://phabricator.services.mozilla.com/D282748
2026-02-13 20:02:57 +00:00
Henrik Skupin 2be355c689 Bug 1944570 - [remote] Allow loading the MessageHandlerFrameActor for chrome scope. r=Sasha
Differential Revision: https://phabricator.services.mozilla.com/D276801
2025-12-18 12:31:50 +00:00
Alexandra Borovova caf132b115 Bug 1987935 - [bidi] Implement "emulation.setUserAgentOverride" command. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D265764
2025-09-26 12:45:56 +00:00
Julian Descottes de4eed1409 Bug 1949037 - [remote] Update TabManager.browsers to only return loaded browsers r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D260795
2025-08-14 08:40:33 +00:00
Cosmin Sabou b364372550 Revert "Bug 1949037 - [remote] Update TabManager.browsers to only return loaded browsers r=webdriver-reviewers,whimboo" for causing wd failures related to lazy.TabManager.browsers.
This reverts commit 7248568fcd.
2025-08-13 23:42:57 +00:00
Julian Descottes 7248568fcd Bug 1949037 - [remote] Update TabManager.browsers to only return loaded browsers r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D260795
2025-08-13 12:40:58 +00:00
Sabina Zaripova 39b1f01461 Bug 1972865 - Add hasSessionData helper and private properties. r=jdescottes,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D256002
2025-07-21 15:18:00 +00:00
Julian Descottes 552e1f0e33 Bug 1930616 - [remote] Prototype parent process NavigationListener r=webdriver-reviewers,Sasha
Depends on D245945

Differential Revision: https://phabricator.services.mozilla.com/D245946
2025-04-29 06:59:18 +00:00
Butkovits Atila 53687eeb3d Backed out 2 changesets (bug 1936774) as requested by Julian. CLOSED TREE
Backed out changeset 35f43832e05c (bug 1936774)
Backed out changeset 842565c0705e (bug 1936774)
2025-04-29 09:47:02 +03:00
Julian Descottes ea1907fec4 Bug 1936774 - [remote] Prototype parent process NavigationListener r=webdriver-reviewers,Sasha
Depends on D245945

Differential Revision: https://phabricator.services.mozilla.com/D245946
2025-04-29 06:31:17 +00:00
Julian Descottes 455ae009d6 Bug 1868828 - [remote] Add support for vendor specific WebDriver BiDi modules r=webdriver-reviewers,whimboo
This adds tests and framework support for vendored modules in MessageHandler

We also add the moz: prefix to the WebDriver BiDi ModuleRegistry

Differential Revision: https://phabricator.services.mozilla.com/D241233
2025-03-25 12:50:28 +00:00
Julian Descottes 71bd429b58 Bug 1950217 - [remote] Add logs when MessageHandler commands timeout r=webdriver-reviewers,whimboo
This changeset updates the Parent JSWindowActor for MessageHandler to
send "ping" messages when a command takes more than 10 seconds to reply.

The "ping" message is expected to respond under 1 second, otherwise a warning
will be logged.

In the future, the JSWindowActor pair should be marked as blocked if the ping
fails and all pending commands should be canceled, future commands should be
rejected.

A browser mochitest is added to make sure the expected logs are generated.

Differential Revision: https://phabricator.services.mozilla.com/D239391
2025-02-25 08:13:07 +00:00
Alexandra Borovova e8de2e9d50 Bug 1938604 - Wait for the tab browser to load in the mochitest for updating session data per user context. CLOSED TREE
Differential Revision: https://phabricator.services.mozilla.com/D237556
2025-02-10 12:25:45 +00:00
Alexandra Borovova dec34d2c63 Bug 1938604 - [bidi] Add support for "userContexts" argument to "sessions.subscribe" command. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D236692
2025-02-10 10:48:43 +00:00
Julian Descottes 98c1f1c46a Bug 1927144 - [remote] Fix test helper hasPromiseResolved r=webdriver-reviewers,whimboo
Depends on D226890

Differential Revision: https://phabricator.services.mozilla.com/D227017
2024-10-29 13:14:19 +00:00
Henrik Skupin 3d007aa2e6 Bug 1927073 - [remote] Retrieve new browsing context if old one was replaced when forwarding a command to the window global. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D226890
2024-10-29 05:56:05 +00:00
Julian Descottes b4b5799a9f Bug 1923899 - [bidi] Wait for currentWindowGlobal when sending commands to window global message handlers r=webdriver-reviewers,Sasha
When attempting to send commands on a very early browsing context, the command might fail
due to a missing currentWindowGlobal.
This patch adds a helper to wait for the currentWindowGlobal property to be set and uses it from
RootTransport in order to avoid this issue.
A browser mochitest is added to cover this scenario.

Differential Revision: https://phabricator.services.mozilla.com/D225281
2024-10-15 14:33:29 +00:00
Henrik Skupin 0d3965f55f Bug 1854942 - [remote] Retry invocation of module methods automatically. r=webdriver-reviewers,jdescottes
The message handler framework now automatically retries executing
module methods in the window global if the corresponding
JSWindowActor pair is destroyed or becomes inactive.

This behavior can be disabled by setting the preference
"remote.retry-on-abort" to false, in which case retries
will only occur during the initial navigation.

Additionally, the behavior can be explicitly controlled
by individual callers by passing the "retryOnAbort" flag.

Differential Revision: https://phabricator.services.mozilla.com/D223398
2024-09-25 13:05:51 +00:00
Julian Descottes c3aa17d793 Bug 1918672 - [bidi] Retry all commands if the browsing context is loading or is initial r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D222602
2024-09-19 12:05:46 +00:00
Henrik Skupin ef0601ed55 Bug 1898719 - [remote] Add support for "BiDi flag" in WebDriver Session. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D212307
2024-06-06 07:37:26 +00:00
Henrik Skupin 5b14825d46 Bug 1884090 - [remote] Add support for "HTTP flag" in WebDriver Session. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D211815
2024-05-29 08:40:49 +00:00
Stanca Serban 82a780a883 Backed out changeset 1f5bdb253c2e (bug 1884090) for causing mochitets failures in browser_Troubleshoot.js. CLOSED TREE 2024-05-29 01:03:07 +03:00
Henrik Skupin d6026b2eb5 Bug 1884090 - [remote] Add support for "HTTP flag" in WebDriver Session. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D211815
2024-05-28 19:47:42 +00:00
Mark Banner cc8043b40f Bug 1885723 - Fix more jsm references in remote/. r=webdriver-reviewers,Sasha
Differential Revision: https://phabricator.services.mozilla.com/D204847
2024-03-19 08:59:11 +00:00
Dave Townsend 32b536b828 Bug 1864896: Autofix unused function arguments (remote). r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D202981
2024-03-01 23:43:51 +00:00
Joel Maher f4b2948ab2 Bug 1859896 - Batch 16 - convert xpcshell.ini -> .toml. r=aryx,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D194383
2023-11-25 21:08:44 +00:00
Sylvestre Ledru 2e0e132821 Bug 1856530 - run file-whitespace on toml files r=linter-reviewers,Standard8
Differential Revision: https://phabricator.services.mozilla.com/D189896
2023-10-03 09:22:18 +00:00
Joel Maher bb9d0a0e79 Bug 1853245 - Migrate .ini manifests to .toml (Batch 7.25). r=aryx,webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D189221
2023-09-26 17:40:01 +00:00
Alexandra Borovova 40f5038c11 Bug 1788657 - [bidi] Implement "script.realmCreated" event. r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D188439
2023-09-22 08:11:31 +00:00
Julian Descottes 8768799867 Bug 1847563 - [remote] Allow MessageHandler modules to cancel intercepted events r=webdriver-reviewers,Sasha
Depends on D187898

Differential Revision: https://phabricator.services.mozilla.com/D188101
2023-09-15 13:36:10 +00:00
Marco Bonardo 6874dffc71 Bug 1852963 - Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
This should make a bit clearer that it is only starting the load, not waiting
for its completion.

Differential Revision: https://phabricator.services.mozilla.com/D188213
2023-09-15 09:16:34 +00:00
Marco Bonardo d76762b5ca Bug 1852963 - Fix tests awaiting on BrowserTestUtils.loadURIString(). r=dao,webdriver-reviewers,devtools-reviewers,whimboo
BrowserTestUtils.loadURIString() is not async, nor returning a promise, it's
effectively not awaiting for the page to be loaded.

Differential Revision: https://phabricator.services.mozilla.com/D188211
2023-09-15 09:16:34 +00:00
Sandor Molnar 5d8dd001ad Backed out 3 changesets (bug 1852963) for causing remote failures on remote/shared/messagehandler/test/browser/browser_session_data.js CLOSED TREE
Backed out changeset 98de7bc404c3 (bug 1852963)
Backed out changeset edf1527c9a99 (bug 1852963)
Backed out changeset 34357750f69c (bug 1852963)
2023-09-14 20:29:06 +03:00
Marco Bonardo c5fb3dbb49 Bug 1852963 - Rename BrowserTestUtils.loadURIString() to .startLoadingURIString(). r=dao
This should make a bit clearer that it is only starting the load, not waiting
for its completion.

Differential Revision: https://phabricator.services.mozilla.com/D188213
2023-09-14 16:33:13 +00:00
Marco Bonardo 1bf2559539 Bug 1852963 - Fix tests awaiting on BrowserTestUtils.loadURIString(). r=dao,webdriver-reviewers,devtools-reviewers,whimboo
BrowserTestUtils.loadURIString() is not async, nor returning a promise, it's
effectively not awaiting for the page to be loaded.

Differential Revision: https://phabricator.services.mozilla.com/D188211
2023-09-14 16:33:13 +00:00
Alexandra Borovova 90592da61e Bug 1788659 - [bidi] Implement "script.realmDestroyed" event. r=webdriver-reviewers,jdescottes
Differential Revision: https://phabricator.services.mozilla.com/D187550
2023-09-12 09:39:56 +00:00
Julian Descottes b67b480296 Bug 1848156 - [remote] Add API to EventsDispatcher to check if an event has listeners r=webdriver-reviewers,Sasha
Differential Revision: https://phabricator.services.mozilla.com/D185997
2023-09-07 18:44:16 +00:00
scottlynotlie 9f4006fed6 Bug 1676736 - Use Assert.rejects to test exceptions in Remote browser chrome test r=jdescottes,webdriver-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D180723
2023-08-03 09:32:41 +00:00
Julian Descottes db186ebc42 Bug 1841010 - [remote] Expose a NavigationManager instance on the RootMessageHandler r=webdriver-reviewers,jgraham
Depends on D180440

Differential Revision: https://phabricator.services.mozilla.com/D183768
2023-07-20 11:33:18 +00:00
Mark Banner 0666077666 Bug 1826062 - Automatic fixes for upgrading Prettier to 2.8.8. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,calu
Differential Revision: https://phabricator.services.mozilla.com/D177027
2023-05-20 12:26:53 +00:00
Mark Banner 91fde42f7b Bug 1826062 - Automatic fixes for Prettier 2.0.5 upgrade. r=mossop,perftest-reviewers,webcompat-reviewers,geckoview-reviewers,denschub,devtools-reviewers,sparky,owlish
Differential Revision: https://phabricator.services.mozilla.com/D177025
2023-05-20 12:26:49 +00:00
Julian Descottes fde76d7e3e Bug 1831411 - [remote] Commands send to root modules from windowglobal should run in the parent r=webdriver-reviewers,Sasha
Depends on D177181

Quick summary:

Handling a command is mostly done in 2 steps
- first check if there is a module in the current layer which matches the command
- if yes: send the command to this module, if no: try to forward the command (using forwardCommand which has different implementations for each message handler)

The initial patch to allow windowglobal -> root communication was flawed, because it updated the ModuleCache to return "root" modules when the destination was of type ROOT. However that's not how MessageHandler modules are supposed to work. The ModuleCache should only ever return modules which can be loaded in the current "layer". So if we are in a windowglobal ModuleCache, we should never return a "root" module.

Instead the ModuleCache should return (and store) `null` for this load attempt, so that the MessageHandler can go to the `forwardCommand` step.
So here I slightly changed the ModuleCache implementation to have a single `#getModuleClass` private helper, which can quickly check if we are in a "not root" -> "root" scenario and just return null early.

Follow up: I think some of the logic currently kept in the module cache should move to the MessageHandler, and the ModuleCache should only care about caching module classes/instances. All the destination-to-folder logic is really tied to handling commands, so that should be done by the base MessageHandler class. Or at least it should be closer to the `handleCommand` implementation.

Differential Revision: https://phabricator.services.mozilla.com/D177202
2023-05-05 13:38:21 +00:00
Julian Descottes 1bc83e000b Bug 1831373 - [remote] Remove all logic from ModuleRegistry classes r=webdriver-reviewers,whimboo
Depends on D177180

Differential Revision: https://phabricator.services.mozilla.com/D177181
2023-05-05 13:38:21 +00:00
Julian Descottes b35b02339a Bug 1831373 - [remote] Use a regular ModuleRegistry for MessageHandler browser mochitests r=webdriver-reviewers,whimboo
Depends on D177179

Differential Revision: https://phabricator.services.mozilla.com/D177180
2023-05-05 13:38:20 +00:00
Julian Descottes 3638d48b3b Bug 1830404 - [remote] Support sending message handler commands from windowglobal to root r=webdriver-reviewers,whimboo
Depends on D176713

Differential Revision: https://phabricator.services.mozilla.com/D176714
2023-05-02 20:11:50 +00:00
Julian Descottes e892c049d7 Bug 1830404 - [remote] Rename transport helpers referring to frame r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D176713
2023-05-02 20:11:50 +00:00
Julian Descottes 1a24137dc8 Bug 1826366 - [remote] Manual fixes for valid-jsdoc in remote r=webdriver-reviewers,whimboo
Depends on D174738

Differential Revision: https://phabricator.services.mozilla.com/D174739
2023-04-05 16:25:48 +00:00
Julian Descottes 86c898746c Bug 1826366 - [remote] Apply lint --fix for valid-jsdoc in remote r=webdriver-reviewers,whimboo
Differential Revision: https://phabricator.services.mozilla.com/D174738
2023-04-05 16:25:47 +00:00