Source code

Revision control

Copy as Markdown

Other Tools

<!DOCTYPE html>
Test that the remote playback state changes when selecting a device
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/common/media.js"></script>
setup({ explicit_timeout: true });
<div id="prep">
<p>Please make sure a device for remote playback is <b>available.</b></p>
<button id="prompt-button-prep">Show devices</button>
<button id="start-button">Start test</button>
<div id="pick-device" style="display: none">
Click the button below to prompt for a remote playback device and select
<button id="prompt-button">Pick device</button>
<script src="./prepare-device.js"></script>
let v = document.createElement("video");
v.src = getVideoURI("/media/movie_5");
async_test(t => {
assert_equals(v.remote.state, "disconnected");
function callback(available) {
promise_test(() => {
return v.remote.prompt().then(
t.step_func(() => {
assert_equals(v.remote.state, "connecting");
}, "Prompt call resolves");
let button = document.getElementById("prompt-button");
button.onclick = () => {
t.step_func(() => {}),
}, "Test that the remote playback state changes when selecting a device.");