Index: LayoutTests/media/mediasession/htmlmediaelement-set-session.html |
diff --git a/LayoutTests/media/mediasession/htmlmediaelement-set-session.html b/LayoutTests/media/mediasession/htmlmediaelement-set-session.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..ede4cd42277f92800e41dbfcf62debc5dac272e4 |
--- /dev/null |
+++ b/LayoutTests/media/mediasession/htmlmediaelement-set-session.html |
@@ -0,0 +1,28 @@ |
+<!DOCTYPE html> |
+<title>HTMLMediaElement set session</title> |
+<script src="../../resources/testharness.js"></script> |
+<script src="../../resources/testharnessreport.js"></script> |
+<script> |
+ test(function() { |
+ assert_true(!window.internals || window.internals.runtimeFlags.mediaSessionEnabled, |
+ "Run either manually by passing the MediaSession flag or as part of the virtual mediasession testsuite."); |
whywhat
2015/07/02 22:04:54
btw, why isn't the feature enabled as 'test' in Ru
davve
2015/07/03 08:25:11
The idea was to try out Jochen's suggestion in:
h
|
+ console.warn("dummy log entry to avoid an empty -expected.txt in virtual/"); |
+ |
+ var mediaSession = new MediaSession(); |
+ assert_true(mediaSession instanceof MediaSession); |
philipj_slow
2015/07/02 20:22:49
I don't think this and the following assert is nee
davve
2015/07/03 09:29:19
Done.
|
+ |
+ var mediaElement = document.createElement('audio'); |
+ assert_true(mediaElement instanceof HTMLMediaElement); |
+ |
+ mediaElement.session = mediaSession; |
+ assert_equals(mediaElement.session, mediaSession); |
+ |
+ assert_throws(new TypeError, function() { mediaElement.session = document; }); |
+ assert_throws(new TypeError, function() { mediaElement.session = "string"; }); |
+ assert_throws(new TypeError, function() { mediaElement.session = 42; }); |
+ assert_equals(mediaElement.session, mediaSession); |
+ |
+ mediaElement.session = null; |
+ assert_equals(mediaElement.session, null); |
+ }); |
+</script> |