@@ -97,6 +97,7 @@ const Command = {
9797 SET_PERMISSION : 'setPermission' ,
9898 GET_CAST_SINKS : 'getCastSinks' ,
9999 SET_CAST_SINK_TO_USE : 'setCastSinkToUse' ,
100+ START_CAST_DESKTOP_MIRRORING : 'startDesktopMirroring' ,
100101 START_CAST_TAB_MIRRORING : 'setCastTabMirroring' ,
101102 GET_CAST_ISSUE_MESSAGE : 'getCastIssueMessage' ,
102103 STOP_CASTING : 'stopCasting' ,
@@ -161,6 +162,11 @@ function configureExecutor(executor, vendorPrefix) {
161162 'POST' ,
162163 `/session/:sessionId/${ vendorPrefix } /cast/set_sink_to_use`
163164 )
165+ executor . defineCommand (
166+ Command . START_CAST_DESKTOP_MIRRORING ,
167+ 'POST' ,
168+ `/session/:sessionId/${ vendorPrefix } /cast/start_desktop_mirroring`
169+ )
164170 executor . defineCommand (
165171 Command . START_CAST_TAB_MIRRORING ,
166172 'POST' ,
@@ -834,6 +840,23 @@ class Driver extends webdriver.WebDriver {
834840 )
835841 }
836842
843+ /**
844+ * Initiates desktop mirroring for the current browser tab on the specified device.
845+ *
846+ * @param {String } deviceName name of the target device.
847+ * @return {!promise.Thenable<void> } A promise that will be resolved
848+ * when the mirror command has been issued to the device.
849+ */
850+ startDesktopMirroring ( deviceName ) {
851+ return this . schedule (
852+ new command . Command ( Command . START_CAST_DESKTOP_MIRRORING ) . setParameter (
853+ 'sinkName' ,
854+ deviceName
855+ ) ,
856+ 'Driver.startDesktopMirroring(' + deviceName + ')'
857+ )
858+ }
859+
837860 /**
838861 * Initiates tab mirroring for the current browser tab on the specified device.
839862 *
0 commit comments