OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <title>Crash test for play() promise</title> | 4 <title>Crash test for play() promise</title> |
5 </head> | 5 </head> |
6 <body> | 6 <body> |
7 <script src="../resources/testharness.js"></script> | 7 <script src="../resources/testharness.js"></script> |
8 <script src="../resources/testharnessreport.js"></script> | 8 <script src="../resources/testharnessreport.js"></script> |
9 <script src="media-file.js"></script> | 9 <script src="media-file.js"></script> |
10 <script> | 10 <script> |
11 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); | 11 window.internals.settings.setAutoplayPolicy('user-gesture-required'); |
12 | 12 |
13 async_test(function(t) { | 13 async_test(function(t) { |
14 var video = document.createElement('video'); | 14 var video = document.createElement('video'); |
15 video.src = findMediaFile('video', 'content/test'); | 15 video.src = findMediaFile('video', 'content/test'); |
16 video.play().then(t.step_func_done(function() { | 16 video.play().then(t.step_func_done(function() { |
17 assert_unreached(); | 17 assert_unreached(); |
18 }), t.step_func(function() { | 18 }), t.step_func(function() { |
19 // Running gc to make sure the promise returned by |play()| is destructed. | 19 // Running gc to make sure the promise returned by |play()| is destructed. |
20 gc(); | 20 gc(); |
21 t.done(); | 21 t.done(); |
22 })); | 22 })); |
23 }, "Test that the rejected promise returned by play() doesn't lead to a crash
at dtor."); | 23 }, "Test that the rejected promise returned by play() doesn't lead to a crash
at dtor."); |
24 </script> | 24 </script> |
25 </body> | 25 </body> |
26 </html> | 26 </html> |
OLD | NEW |