| OLD | NEW |
| 1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
| 2 <title>Test behaviour of autoplay muted videos with regards to visibility</title
> | 2 <title>Test behaviour of autoplay muted videos with regards to visibility</title
> |
| 3 <script src="../resources/testharness.js"></script> | 3 <script src="../resources/testharness.js"></script> |
| 4 <script src="../resources/testharnessreport.js"></script> | 4 <script src="../resources/testharnessreport.js"></script> |
| 5 <script src="media-file.js"></script> | 5 <script src="media-file.js"></script> |
| 6 <body> | 6 <body> |
| 7 <script> | 7 <script> |
| 8 window.internals.settings.setMediaPlaybackRequiresUserGesture(true); | 8 window.internals.settings.setAutoplayPolicy('user-gesture-required'); |
| 9 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true; | 9 window.internals.runtimeFlags.autoplayMutedVideosEnabled = true; |
| 10 | 10 |
| 11 async_test(function(t) { | 11 async_test(function(t) { |
| 12 // Create a video off screen. | 12 // Create a video off screen. |
| 13 { | 13 { |
| 14 var video = document.createElement('video'); | 14 var video = document.createElement('video'); |
| 15 video.id = 'offscreen'; | 15 video.id = 'offscreen'; |
| 16 video.src = findMediaFile('video', 'content/test'); | 16 video.src = findMediaFile('video', 'content/test'); |
| 17 video.muted = true; | 17 video.muted = true; |
| 18 video.autoplay = true; | 18 video.autoplay = true; |
| (...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 assert_false(inscreen.paused); | 88 assert_false(inscreen.paused); |
| 89 assert_false(offscreen.paused); | 89 assert_false(offscreen.paused); |
| 90 assert_false(offscreenNoAutoplay.paused); | 90 assert_false(offscreenNoAutoplay.paused); |
| 91 assert_true(audio.paused, 'audio should not play'); | 91 assert_true(audio.paused, 'audio should not play'); |
| 92 })); | 92 })); |
| 93 })); | 93 })); |
| 94 })); | 94 })); |
| 95 }); | 95 }); |
| 96 </script> | 96 </script> |
| 97 </body> | 97 </body> |
| OLD | NEW |