| <script src='media-file.js'></script> |
| <script src='video-test.js'></script> |
| internals.setMockMediaPlaybackTargetPickerEnabled(true); |
| internals.settings.setAllowsAirPlayForMediaPlayback(true); |
| consoleWrite('** create initial callback'); |
| run('video.disableRemotePlayback = true'); |
| video.remote.watchAvailability(callback).then(failTest).catch(handleInitialError); |
| function callback(available) { }; |
| function handleInitialError(exception) |
| consoleWrite(`EXPECTED ERROR: ${ exception }`); |
| consoleWrite('** try again without disableRemotePlayback'); |
| run('video.disableRemotePlayback = false'); |
| video.remote.watchAvailability(callback).then(succeeded).catch(failTest); |
| consoleWrite('SUCCEEDED'); |
| consoleWrite('** set disableRemotePlayback and try to cancel callback'); |
| run('video.disableRemotePlayback = true'); |
| video.remote.cancelWatchAvailability(id).then(failTest).catch(handleError); |
| function handleError(exception) |
| consoleWrite(`EXPECTED ERROR: ${ exception }`); |
| <p>Test that trying to watchAvailability on a video with the "disableremoteplayback" attribute set will generate an error.</p> |