Bug 1464001 [wpt PR 11135] - Split the layout test for remove-track, a=testonly
authorTed Meyer <tmathmeyer@chromium.org>
Thu, 31 May 2018 19:33:05 +0000
changeset 421330 95a167ffaacb8d1a9fef0b0e8885950eeb5cd6e6
parent 421329 ec01ee3299a446e1b14b72f2dd94c2a618f22f1f
child 421331 f864caba487be4d19983eda6a14f727e0737f45e
push id104025
push userjames@hoppipolla.co.uk
push dateTue, 05 Jun 2018 14:17:28 +0000
treeherdermozilla-inbound@c564063af144 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1464001, 11135, 826419, 1070570, 561269
milestone62.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1464001 [wpt PR 11135] - Split the layout test for remove-track, a=testonly Automatic update from web-platform-testsSplit the layout test for remove-track Keep separate tests for in-band and out-of-band text tracks. Bug: 826419 Change-Id: I2e888d47ddda080bbc7b6cd6f1f645d064c5a6fa Reviewed-on: https://chromium-review.googlesource.com/1070570 Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Ted Meyer <tmathmeyer@chromium.org> Cr-Commit-Position: refs/heads/master@{#561269} -- wpt-commits: cdec7db504d74c9a6f371a05d92f2be35ac8cc60 wpt-pr: 11135
testing/web-platform/meta/MANIFEST.json
testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html
testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html
--- a/testing/web-platform/meta/MANIFEST.json
+++ b/testing/web-platform/meta/MANIFEST.json
@@ -340070,16 +340070,22 @@
     ]
    ],
    "html/semantics/embedded-content/media-elements/track/track-element/track-remove-quickly.html": [
     [
      "/html/semantics/embedded-content/media-elements/track/track-element/track-remove-quickly.html",
      {}
     ]
    ],
+   "html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html": [
+    [
+     "/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html",
+     {}
+    ]
+   ],
    "html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html": [
     [
      "/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html",
      {}
     ]
    ],
    "html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html": [
     [
@@ -578467,18 +578473,22 @@
   "html/semantics/embedded-content/media-elements/track/track-element/track-remove-insert-ready-state.html": [
    "9d6735eaf36145ceeefec0630f30be49ff37d676",
    "testharness"
   ],
   "html/semantics/embedded-content/media-elements/track/track-element/track-remove-quickly.html": [
    "e955322b149ecb74471bc972a4662972fa287516",
    "testharness"
   ],
+  "html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html": [
+   "652c94e9776d84e7bbec2b3b5758ed6408d41d1a",
+   "testharness"
+  ],
   "html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html": [
-   "931cfc4d06107dfccb001fbeaeef987cca528747",
+   "a59413e676dd9c05b13bb3f9405cc1a6d0bf933d",
    "testharness"
   ],
   "html/semantics/embedded-content/media-elements/track/track-element/track-selection-metadata.html": [
    "b82d60202e4df526baedd40eafef7c63a2e2c51d",
    "testharness"
   ],
   "html/semantics/embedded-content/media-elements/track/track-element/track-text-track-cue-list.html": [
    "1fc10a807231c4a4e3701c4b532138dc7b520c07",
new file mode 100644
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track-inband.html
@@ -0,0 +1,79 @@
+<!DOCTYPE html>
+<html>
+    <head>
+        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+
+        <script src="/common/media.js"></script>
+        <script src="/resources/testharness.js"></script>
+        <script src="/resources/testharnessreport.js"></script>
+    </head>
+    <body>
+        <script>
+            async_test(function(test)
+            {
+                var video = document.createElement("video");
+
+                // Create an out-of-band text track by adding a track element.
+                var trackElement = document.createElement('track');
+
+                trackElement.addEventListener("error", test.step_func(function()
+                {
+                    assert_unreached("'error' event on track element should not fire.")
+                }));
+
+                video.appendChild(trackElement);
+                trackElement.src = 'resources/webvtt-file.vtt';
+                trackElement.track.mode = 'hidden';
+
+                assert_equals(video.textTracks.length, 1);
+                var outOfBandTrack = video.textTracks[0];
+
+                // Load a media file with an inband text track.
+                var inbandTrack = null;
+                var url = "resources/vp8-vorbis-webvtt.webm"
+
+                var firstAddTrackHandler = test.step_func(function()
+                {
+                    assert_equals(event.target, video.textTracks);
+                    assert_equals(event instanceof window.TrackEvent, true);
+                    if (event.track == outOfBandTrack) {
+                        return;
+                    }
+
+                    assert_equals(inbandTrack, null);
+                    assert_equals(video.textTracks.length, 2);
+                    assert_equals(event.track, video.textTracks[1]);
+                    inbandTrack = event.track;
+
+                    video.textTracks.removeEventListener("addtrack", firstAddTrackHandler);
+
+                    // Clear .src to force the inband track to get destroyed.
+                    video.src = "";
+
+                    // Verify that the inband track was removed.
+                    assert_not_equals(inbandTrack, null);
+                    assert_equals(video.textTracks.length, 1);
+                    assert_equals(video.textTracks[0], outOfBandTrack);
+
+                    // Load the URL again to trigger another 'addtrack' event to make sure
+                    // no 'removetrack' event was queued.
+                    video.src = url;
+                    video.textTracks.addEventListener("addtrack", test.step_func(function()
+                    {
+                        assert_equals(video.textTracks.length, 2);
+                        test.done();
+                    }));
+                });
+                video.textTracks.addEventListener("addtrack", firstAddTrackHandler);
+
+                video.textTracks.addEventListener("removetrack", test.step_func(function()
+                {
+                    assert_unreached("'removetrack' event should not fire.")
+                }));
+
+                video.src = url;
+            }, "Tests that the 'removetrack' event is NOT fired for inband TextTrack on a failed load.");
+
+        </script>
+    </body>
+</html>
--- a/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html
+++ b/testing/web-platform/tests/html/semantics/embedded-content/media-elements/track/track-element/track-remove-track.html
@@ -29,77 +29,11 @@
                 trackElement.track.mode = 'hidden';
 
                 assert_equals(video.textTracks.length, 1);
 
                 track = video.textTracks[0];
                 video.removeChild(trackElement);
                 video.textTracks.addEventListener("removetrack", test.step_func(trackRemoved));
             }, "Tests that the 'removetrack' event is fired when an out-of-band TextTrack is removed.");
-
-            async_test(function(test)
-            {
-                var video = document.createElement("video");
-
-                // Create an out-of-band text track by adding a track element.
-                var trackElement = document.createElement('track');
-
-                trackElement.addEventListener("error", test.step_func(function()
-                {
-                    assert_unreached("'error' event on track element should not fire.")
-                }));
-
-                video.appendChild(trackElement);
-                trackElement.src = 'resources/webvtt-file.vtt';
-                trackElement.track.mode = 'hidden';
-
-                assert_equals(video.textTracks.length, 1);
-                var outOfBandTrack = video.textTracks[0];
-
-                // Load a media file with an inband text track.
-                var inbandTrack = null;
-                var url = "resources/vp8-vorbis-webvtt.webm"
-
-                var firstAddTrackHandler = test.step_func(function()
-                {
-                    assert_equals(event.target, video.textTracks);
-                    assert_equals(event instanceof window.TrackEvent, true);
-                    if (event.track == outOfBandTrack) {
-                        return;
-                    }
-
-                    assert_equals(inbandTrack, null);
-                    assert_equals(video.textTracks.length, 2);
-                    assert_equals(event.track, video.textTracks[1]);
-                    inbandTrack = event.track;
-
-                    video.textTracks.removeEventListener("addtrack", firstAddTrackHandler);
-
-                    // Clear .src to force the inband track to get destroyed.
-                    video.src = "";
-
-                    // Verify that the inband track was removed.
-                    assert_not_equals(inbandTrack, null);
-                    assert_equals(video.textTracks.length, 1);
-                    assert_equals(video.textTracks[0], outOfBandTrack);
-
-                    // Load the URL again to trigger another 'addtrack' event to make sure
-                    // no 'removetrack' event was queued.
-                    video.src = url;
-                    video.textTracks.addEventListener("addtrack", test.step_func(function()
-                    {
-                        assert_equals(video.textTracks.length, 2);
-                        test.done();
-                    }));
-                });
-                video.textTracks.addEventListener("addtrack", firstAddTrackHandler);
-
-                video.textTracks.addEventListener("removetrack", test.step_func(function()
-                {
-                    assert_unreached("'removetrack' event should not fire.")
-                }));
-
-                video.src = url;
-            }, "Tests that the 'removetrack' event is NOT fired for inband TextTrack on a failed load.");
-
         </script>
     </body>
 </html>