4 <title>Media test: promise-based play() method
</title>
5 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
6 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css" />
7 <script type=
"text/javascript" src=
"manifest.js"></script>
8 <script type=
"text/javascript" src=
"play_promise.js"></script>
14 // Name: playNotSupportedContent
15 // Case: invoke play() on an element with an unsupported content
16 // Expected result: reject the promise with NotSupportedError DOM exception
18 let manager
= new MediaTestManager
;
20 function initTest(test
, token
) {
21 manager
.started(token
);
23 let element
= document
.createElement(getMajorMimeType(test
.type
));
24 element
.src
= getNotSupportedFile(test
.name
);
27 ok(false, `${token} is resolved with ${result}.`);
30 if (error
.name
== "NotSupportedError") {
31 ok(true, `${token} is rejected with ${error.name}.`);
33 ok(false, `${token} is rejected with ${error.name}.`);
36 ).then( () => { manager
.finished(token
); } );
39 manager
.runTests(gSmallTests
, initTest
);