From 575630f8df25ed6ec2862dba3851889b383bd7d8 Mon Sep 17 00:00:00 2001 From: Paul Adenot Date: Thu, 7 Oct 2021 15:44:52 +0000 Subject: [PATCH] Bug 1678373 - Don't detach the media element from the tree for checking play time probes: it pauses the media element per spec. r=alwu Differential Revision: https://phabricator.services.mozilla.com/D125080 --- dom/media/test/chrome/test_accumulated_play_time.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dom/media/test/chrome/test_accumulated_play_time.html b/dom/media/test/chrome/test_accumulated_play_time.html index 70c14e502e23..c7f7517ace6d 100644 --- a/dom/media/test/chrome/test_accumulated_play_time.html +++ b/dom/media/test/chrome/test_accumulated_play_time.html @@ -87,7 +87,8 @@ add_task(async function testVisiblePlayTime() { assertValueKeptUnchanged(videoChrome, "invisiblePlayTime"); info(`make video invisible`); - document.body.removeChild(video); + video.style.display = "none"; + await once(video, "mozinvisibleplaytimestarted"); await assertValueConstantlyIncreases(videoChrome, "totalPlayTime"); await assertValueConstantlyIncreases(videoChrome, "invisiblePlayTime"); assertValueKeptUnchanged(videoChrome, "visiblePlayTime");