Bug 1685542 [wpt PR 27077] - Reload embed elements when url attribute is changed...
[gecko.git] / testing / web-platform / tests / html / semantics / embedded-content / the-embed-element / embed-change-src.html
blob4152d51b0c6658be2b05081f02ba455da39b5343
1 <!DOCTYPE html>
2 <html class="reftest-wait">
3 <meta charset="utf-8">
4 <link rel="author" title="Joey Arhar" href="mailto:jarhar@chromium.org">
5 <link rel="help" href="https://html.spec.whatwg.org/multipage/iframe-embed-object.html#the-embed-element">
6 <link rel="help" href="http://crbug.com/1035330">
8 <script src="/resources/testharness.js"></script>
9 <script src="/resources/testharnessreport.js"></script>
11 <body>
12 <script>
13 promise_test(async () => {
14 const embed = document.createElement('embed');
15 let loadPromise = new Promise(resolve => embed.onload = resolve);
16 embed.src = '/media/white.mp4';
17 document.body.appendChild(embed);
19 await loadPromise;
21 loadPromise = new Promise(resolve => embed.onload = resolve);
22 embed.src = '/media/white.webm';
24 await loadPromise;
25 }, 'Verifies that embed elements reload with new content when the src attribute is changed.');
26 </script>