From 2a797e85381d507d4281c9bc7b21cce24442d83c Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Thu, 20 Jul 2017 15:47:02 -0400 Subject: [PATCH 1/3] initial removeTextTrack tests --- .../HTMLMediaElement/removeTextTrack.html | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html diff --git a/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html new file mode 100644 index 000000000000000..9fb94a288eac60a --- /dev/null +++ b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html @@ -0,0 +1,53 @@ + +HTMLMediaElement.removeTextTrack + + +
+ + From a0c9bc8db96448e44274e619e4d8ad912db211a2 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Thu, 20 Jul 2017 15:53:10 -0400 Subject: [PATCH 2/3] add orphaned track test --- .../HTMLElement/HTMLMediaElement/removeTextTrack.html | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html index 9fb94a288eac60a..a4a836500956478 100644 --- a/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html +++ b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html @@ -49,5 +49,16 @@ assert_equals(video.textTracks, video.textTracks); assert_equals(video.textTracks.length, 0); }, document.title + ' descriptions'); + +test(function(){ + var t = document.createElement('track').track; + assert_equals(video.textTracks, video.textTracks); + assert_equals(video.textTracks.length, 0); + assert_throws('NOT_FOUND_ERROR', function() { + video.removeTextTrack(t); + }, 'standalone'); + assert_equals(video.textTracks, video.textTracks); + assert_equals(video.textTracks.length, 0); +}, document.title + ' orphaned track'); From 4d634650aac6a921be97b381b6710c7d13a54162 Mon Sep 17 00:00:00 2001 From: Gary Katsevman Date: Thu, 20 Jul 2017 16:15:30 -0400 Subject: [PATCH 3/3] removeTextTrack also removes associated track element --- .../HTMLMediaElement/removeTextTrack.html | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html index a4a836500956478..cc2685f765822fe 100644 --- a/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html +++ b/html/semantics/embedded-content/media-elements/interfaces/HTMLElement/HTMLMediaElement/removeTextTrack.html @@ -60,5 +60,17 @@ assert_equals(video.textTracks, video.textTracks); assert_equals(video.textTracks.length, 0); }, document.title + ' orphaned track'); + + +test(function() { + var tel = document.createElement('track'); + video.appendChild(tel); + assert_equals(video.textTracks.length, 1); + assert_true(video.contains(tel)); + video.removeTextTrack(tel.track); + assert_false(video.contains(tel)); + assert_equals(video.textTracks.length, 0); + +}, document.title + ' also remove associated track element');