2 <title>HTMLMediaElement set session
</title>
3 <script src=
"../../resources/testharness.js"></script>
4 <script src=
"../../resources/testharnessreport.js"></script>
7 assert_true(!window
.internals
|| window
.internals
.runtimeFlags
.mediaSessionEnabled
,
8 "Run either manually by passing the MediaSession flag or as part of the virtual mediasession testsuite.");
9 console
.warn("dummy log entry to avoid an empty -expected.txt in virtual/");
11 var mediaElement
= document
.createElement('audio');
12 assert_true(mediaElement
instanceof HTMLMediaElement
);
14 var mediaSession
= new MediaSession();
15 mediaElement
.session
= mediaSession
;
16 assert_equals(mediaElement
.session
, mediaSession
);
18 assert_throws(new TypeError
, function() { mediaElement
.session
= document
; });
19 assert_throws(new TypeError
, function() { mediaElement
.session
= "string"; });
20 assert_throws(new TypeError
, function() { mediaElement
.session
= 42; });
21 assert_equals(mediaElement
.session
, mediaSession
);
23 mediaElement
.session
= null;
24 assert_equals(mediaElement
.session
, null);