<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>286763</bug_id>
          
          <creation_ts>2025-01-30 11:24:20 -0800</creation_ts>
          <short_desc>[WebDriver][BiDi] Add proper session.subscribe and session.unsubscribe parameter checks for events and context</short_desc>
          <delta_ts>2025-12-19 04:32:34 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebDriver</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>281940</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Lauro Moura">lmoura</reporter>
          <assigned_to name="Lauro Moura">lmoura</assigned_to>
          <cc>bburg</cc>
    
    <cc>hskupin</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2090785</commentid>
    <comment_count>0</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-01-30 11:24:20 -0800</bug_when>
    <thetext>imported/w3c/webdriver/tests/bidi/session/subscribe/invalid.py
imported/w3c/webdriver/tests/bidi/session/unsubscribe/invalid.py

For example, currently we just check if &quot;events&quot; is an array and, for each element get `eventName-&gt;asString()`, while the spec expects the name to be actually a string, and a valid module or event name.

Non-Comprehensive list of test cases from wpt:

- Empty parameters should raise InvalidArgument

- Invalid &quot;events&quot; parameter type (i.e. non-array) should raise InvalidArgument
- &quot;events&quot; as an empty array should raise InvalidArgument
- Invalid &quot;events&quot; values types (non-string) should raise InvalidArgument
- &quot;events&quot; values that refer to unknown events should raise InvalidArgument
- Mixing known and unknown events should, not subscribe to the known event
  - Raise InvalidArgument

- Invalid &quot;contexts&quot; parameter type (i.e. non-array) should raise InvalidArgument
- &quot;contexts&quot; as an empty array should raise InvalidArgument
- Invalid &quot;context&quot; values types (non-string) should raise InvalidArgument
- Invalid &quot;context&quot; value (e.g. non-existing frame) should raise NoSuchFrame
- Valid event and invalid context should not subscribe to the event, raising NoSuchFrame
- Trying to subscribe to a context of a closed tab should raise NoSuchFrame</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2092515</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2025-02-06 11:25:15 -0800</bug_when>
    <thetext>&lt;rdar://problem/144324820&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2167261</commentid>
    <comment_count>2</comment_count>
    <who name="Lauro Moura">lmoura</who>
    <bug_when>2025-12-19 04:32:34 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/55701</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>