Update WPT tests for embedded content
[WebKit-https.git] / LayoutTests / imported / w3c / web-platform-tests / html / semantics / embedded-content / media-elements / loading-the-media-resource / resource-selection-invoke-set-src-networkState.html
1 <!doctype html>
2 <title>invoking load by setting src when networkState is not NETWORK_EMPTY</title>
3 <script src="/resources/testharness.js"></script>
4 <script src="/resources/testharnessreport.js"></script>
5 <div id=log></div>
6 <script>
7 test(function(t) {
8   var v = document.createElement('video');
9   v.play().catch(() => {}); // invokes resource selection and sets .paused to false
10   assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState');
11   assert_false(v.paused, 'paused');
12   v.setAttribute('src', ''); // invokes media load which sets .paused to true
13   assert_equals(v.networkState, v.NETWORK_NO_SOURCE, 'networkState after setting src');
14   assert_true(v.paused, 'paused after setting src');
15 });
16 </script>