bug 1116382 adjust explict revoke test to fail if revocation fails r=bholley
authorKarl Tomlinson <karlt+@karlt.net>
Thu, 28 May 2015 23:36:31 +1200
changeset 247302 9117150ca7e6072d24f523889c4347868d1d78ad
parent 247301 76bc62c51e9edd0bd79a787ce8be1d3152d8e038
child 247303 94fcc63014b32ed6e5bbf819ce83c8555f660e7b
push id60669
push userktomlinson@mozilla.com
push dateFri, 05 Jun 2015 08:08:50 +0000
treeherdermozilla-inbound@94fcc63014b3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1116382
milestone41.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 1116382 adjust explict revoke test to fail if revocation fails r=bholley Previously this test would pass even without the revokeObjectURL().
testing/web-platform/tests/media-source/URL-createObjectURL-revoke.html
--- a/testing/web-platform/tests/media-source/URL-createObjectURL-revoke.html
+++ b/testing/web-platform/tests/media-source/URL-createObjectURL-revoke.html
@@ -4,19 +4,26 @@
   <meta charset='utf-8'>
   <title>Revoking a created URL with URL.revokeObjectURL(url)</title>
   <script src="/resources/testharness.js"></script>
   <script src="/resources/testharnessreport.js"></script>
 </head>
 <body>
 <div id="log"></div>
 <script>
-var video = document.createElement('video');
-test(function() {
+async_test(function(t) {
     var mediaSource = new MediaSource();
     var url = window.URL.createObjectURL(mediaSource);
     window.URL.revokeObjectURL(url);
+    mediaSource.addEventListener('sourceopen',
+                                 t.unreached_func("url should not reference MediaSource."));
+    var video = document.createElement('video');
     video.src = url;
-    assert_equals(mediaSource.readyState, 'closed');
+    video.addEventListener('error', t.step_func_done(function(e) {
+        assert_equals(e.target.error.code,
+                      MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED,
+                      'Expected error code');
+        assert_equals(mediaSource.readyState, 'closed');
+    }));
 }, "Check revoking behavior of URL.revokeObjectURL(url).");
 </script>
 </body>
 </html>