|
1422 | 1422 | return window.test_driver_internal.freeze(); |
1423 | 1423 | }, |
1424 | 1424 |
|
| 1425 | + /** |
| 1426 | + * Creates a new top-level browsing context, as if the user requested |
| 1427 | + * a new tab or window from the browser. |
| 1428 | + * |
| 1429 | + * Matches the behaviour of the `New Window |
| 1430 | + * <https://www.w3.org/TR/webdriver/#new-window>`_ |
| 1431 | + * WebDriver command. |
| 1432 | + * |
| 1433 | + * The new window is opened with `about:blank`, |
| 1434 | + * the test does not get a ``WindowProxy`` for it, |
| 1435 | + * and the returned WebDriver window handle is its only identifier. |
| 1436 | + * |
| 1437 | + * @param {String} type - Type hint for the new browsing context, |
| 1438 | + * either "tab" or "window" or null for the |
| 1439 | + * implementation default. |
| 1440 | + * @param {WindowProxy} context - Browsing context in which |
| 1441 | + * to run the call, or null to use the current |
| 1442 | + * browsing context. |
| 1443 | + * |
| 1444 | + * @returns {Promise} fulfilled with the WebDriver window handle |
| 1445 | + * (a string) of the new browsing context, or |
| 1446 | + * rejected if the WebDriver command errors. |
| 1447 | + */ |
| 1448 | + create_window: function(type=null, context=null) { |
| 1449 | + return window.test_driver_internal.create_window(type, context); |
| 1450 | + }, |
| 1451 | + |
1425 | 1452 | /** |
1426 | 1453 | * Minimizes the browser window. |
1427 | 1454 | * |
|
2618 | 2645 | throw new Error("freeze() is not implemented by testdriver-vendor.js"); |
2619 | 2646 | }, |
2620 | 2647 |
|
| 2648 | + async create_window(type=null, context=null) { |
| 2649 | + throw new Error("create_window() is not implemented by testdriver-vendor.js"); |
| 2650 | + }, |
| 2651 | + |
2621 | 2652 | async minimize_window(context=null) { |
2622 | 2653 | throw new Error("minimize_window() is not implemented by testdriver-vendor.js"); |
2623 | 2654 | }, |
|
0 commit comments