blob: ce273cbb1cdc36e367c4680a7f92a4b68ee0b617 [file] [log] [blame]
<!DOCTYPE html>
<title>No crash when resetting player during PIP</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<video></video>
<script>
async_test(t => {
if (!document.pictureInPictureEnabled)
t.done();
const video = document.querySelector('video');
video.src = '../content/test.ogv';
video.addEventListener('click', t.step_func(() => {
video.requestPictureInPicture().then(t.step_func_done(() => {
video.src = '';
// Do not crash.
}));
}), { once: true });
video.play().then(t.step_func(() => {
const bounds = video.getBoundingClientRect();
chrome.gpuBenchmarking.pointerActionSequence([{
source: 'mouse',
actions: [
{ name: 'pointerDown',
x: bounds.left + bounds.width / 2,
y: bounds.top + bounds.height / 2
},
{ name: 'pointerUp' }
]
}]);
}));
});
</script>