Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[EXPERIMENTAL] expose testdriver + webdriver bidi #44649

Conversation

sadym-chromium
Copy link
Contributor

@sadym-chromium sadym-chromium commented Feb 19, 2024

Experimental PR trying to extend testdriver with WebDriver BiDi functionality.

Open questions:

  1. Should tools/wptrunner/wptrunner/testharnessreport.js be extended as well?


async def subscribe(self, events, contexts):
self.logger.info("Subscribing to events %s in %s" % (events, contexts))
self._subscriptions.append((events, contexts))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A problem with this being a list is that something like

subscribe(["event"], "context")
subscribe(["event"], "context")
unsubscribe_all()

is going to end up throwing an error during unsubscription because we'll try to remove a subscription that doesn't exist. Unfortunately I think you probably need to use the return value of the command to discover the new contexts for which the event was enabled, and store only those.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point! I updated the logic. I can see the following edge cases:

  1. Subscription is done with wrong arguments. In this case the subscription will not happen at all, and nothing will be added to the _subscriptions.
  2. Subscription is done for the sub-context which is removed later on. To handle this case, I add top-level contexts to the _subscriptions.

@@ -646,6 +754,81 @@ def do_testharness(self, protocol, url, timeout):

return rv

def bidi_deserialize(self, bidi_value):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be very nice to use the existing WebDriver library rather than duplicating the functionality here.

Copy link
Contributor Author

@sadym-chromium sadym-chromium Apr 22, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have the BiDi script deserialization implemented in WPT?

@sadym-chromium
Copy link
Contributor Author

Closing to preserver the RFC references. Continue work in #45823

sadym-chromium added a commit that referenced this pull request Apr 22, 2024
sadym-chromium added a commit that referenced this pull request Apr 23, 2024
sadym-chromium added a commit that referenced this pull request Apr 25, 2024
sadym-chromium added a commit that referenced this pull request Apr 26, 2024
sadym-chromium added a commit that referenced this pull request Apr 29, 2024
sadym-chromium added a commit that referenced this pull request May 2, 2024
sadym-chromium added a commit that referenced this pull request May 21, 2024
sadym-chromium added a commit that referenced this pull request May 24, 2024
sadym-chromium added a commit that referenced this pull request Jun 17, 2024
sadym-chromium added a commit that referenced this pull request Jun 19, 2024
sadym-chromium added a commit that referenced this pull request Jul 18, 2024
sadym-chromium added a commit that referenced this pull request Jul 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants