|
1986 | 1986 | }, |
1987 | 1987 |
|
1988 | 1988 | /** |
1989 | | - * Sets the response for the next digital credentials request. |
| 1989 | + * Sets the behavior for the virtual wallet. |
1990 | 1990 | * |
1991 | | - * Matches the `Set Wallet Response |
1992 | | - * <https://github.com/w3c-fedid/digital-credentials/pull/381>`_ |
1993 | | - * WebDriver command. |
1994 | | - * |
1995 | | - * @param {String} data - The data to be returned by the wallet. |
1996 | | - * @param {WindowProxy} context - Browsing context in which |
1997 | | - * to run the call, or null for the current |
1998 | | - * browsing context. |
1999 | | - * |
2000 | | - * @returns {Promise} Fulfilled after the response has been set, |
2001 | | - * or rejected in case the WebDriver command errors. |
2002 | | - */ |
2003 | | - set_virtual_wallet_response: function(data, context=null) { |
2004 | | - return window.test_driver_internal.set_virtual_wallet_response(data, context); |
2005 | | - }, |
2006 | | - |
2007 | | - /** |
2008 | | - * Sets the virtual wallet to wait indefinitely for the next digital credentials request. |
| 1991 | + * Matches the `Set Virtual Wallet Behavior` |
| 1992 | + * WebDriver BiDi command in Digital Credentials spec. |
2009 | 1993 | * |
2010 | | - * Matches the `Set Wallet to Wait |
2011 | | - * <https://github.com/w3c-fedid/digital-credentials/pull/381>`_ |
2012 | | - * WebDriver command. |
2013 | | - * |
2014 | | - * @param {WindowProxy} context - Browsing context in which |
2015 | | - * to run the call, or null for the current |
2016 | | - * browsing context. |
| 1994 | + * @param {String} action - The action to take ("decline", "respond", "wait", "clear"). |
| 1995 | + * @param {String} [protocol=null] - The protocol requested (required for "respond"). |
| 1996 | + * @param {Object} [response=null] - The response data (optional for "respond"). |
| 1997 | + * @param {WindowProxy} [context=null] - Browsing context in which to run the call. |
2017 | 1998 | * |
2018 | | - * @returns {Promise} Fulfilled after the wallet has been set to wait, |
2019 | | - * or rejected in case the WebDriver command errors. |
| 1999 | + * @returns {Promise} Fulfilled after the behavior has been set. |
2020 | 2000 | */ |
2021 | | - set_virtual_wallet_to_wait: function(context=null) { |
2022 | | - return window.test_driver_internal.set_virtual_wallet_to_wait(context); |
| 2001 | + set_virtual_wallet_behavior: function(action, protocol=null, response=null, context=null) { |
| 2002 | + return window.test_driver_internal.set_virtual_wallet_behavior(action, protocol, response, context); |
2023 | 2003 | }, |
2024 | 2004 |
|
2025 | | - /** |
2026 | | - * Sets the virtual wallet to decline the next digital credentials request. |
2027 | | - * |
2028 | | - * Matches the `Set Wallet to Decline |
2029 | | - * <https://github.com/w3c-fedid/digital-credentials/pull/381>`_ |
2030 | | - * WebDriver command. |
2031 | | - * |
2032 | | - * @param {WindowProxy} context - Browsing context in which |
2033 | | - * to run the call, or null for the current |
2034 | | - * browsing context. |
2035 | | - * |
2036 | | - * @returns {Promise} Fulfilled after the wallet has been set to decline, |
2037 | | - * or rejected in case the WebDriver command errors. |
2038 | | - */ |
2039 | | - set_virtual_wallet_to_decline: function(context=null) { |
2040 | | - return window.test_driver_internal.set_virtual_wallet_to_decline(context); |
2041 | | - }, |
2042 | 2005 |
|
2043 | 2006 | /** |
2044 | 2007 | * Creates a virtual sensor for use with the Generic Sensors APIs. |
|
2750 | 2713 | throw new Error("reset_fedcm_cooldown() is not implemented by testdriver-vendor.js"); |
2751 | 2714 | }, |
2752 | 2715 |
|
2753 | | - async set_virtual_wallet_response(data, context=null) { |
2754 | | - throw new Error("set_virtual_wallet_response() is not implemented by testdriver-vendor.js"); |
| 2716 | + async set_virtual_wallet_behavior(action, protocol=null, response=null, context=null) { |
| 2717 | + throw new Error("set_virtual_wallet_behavior() is not implemented by testdriver-vendor.js"); |
2755 | 2718 | }, |
2756 | 2719 |
|
2757 | | - async set_virtual_wallet_to_wait(context=null) { |
2758 | | - throw new Error("set_virtual_wallet_to_wait() is not implemented by testdriver-vendor.js"); |
2759 | | - }, |
2760 | | - |
2761 | | - async set_virtual_wallet_to_decline(context=null) { |
2762 | | - throw new Error("set_virtual_wallet_to_decline() is not implemented by testdriver-vendor.js"); |
2763 | | - }, |
2764 | 2720 |
|
2765 | 2721 | async create_virtual_sensor(sensor_type, sensor_params, context=null) { |
2766 | 2722 | throw new Error("create_virtual_sensor() is not implemented by testdriver-vendor.js"); |
|
0 commit comments