Fix test_media_selection.html to handle IDLE network states, since the cache size limit can suspend its loads
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 19 May 2009 21:53:38 +1200
changeset 28573 62acac67ad816aaf27cea2f1a95d95605bcbb7cf
parent 28572 12878454c5d57c4ce9bc7dc9b13e92960088718d
child 28574 759009d95b4108c3d1626e2417000dc15e79ecbe
push id7118
push userrocallahan@mozilla.com
push dateTue, 19 May 2009 10:02:10 +0000
treeherdermozilla-central@409416c625bc [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone1.9.2a1pre
Fix test_media_selection.html to handle IDLE network states, since the cache size limit can suspend its loads
content/media/video/test/test_media_selection.html
--- a/content/media/video/test/test_media_selection.html
+++ b/content/media/video/test/test_media_selection.html
@@ -9,25 +9,25 @@
 <body>
 <pre id="test">
 <script class="testbody" type="text/javascript">
 SimpleTest.waitForExplicitFinish();
 
 function maketest(expect_load, attach_media, name, type, check_metadata) {
   return function (testNum) {
     var e = document.createElement('video');
-    e.setAttribute("autobuffer", "true");
     var errorRun = false;
     if (expect_load) {
       e.addEventListener('loadedmetadata', function () {
           ok(e.readyState >= HTMLMediaElement.HAVE_METADATA,
              'test ' +  testNum + ' readyState ' + e.readyState + ' expected >= ' + HTMLMediaElement.HAVE_METADATA);
           is(e.currentSrc.substring(e.currentSrc.length - name.length), name, 'test ' + testNum);
-          ok(e.networkState >= HTMLMediaElement.NETWORK_LOADING,
-              'test ' + testNum + ' networkState = ' + e.networkState + ' expected >= ' + HTMLMediaElement.NETWORK_LOADING);
+          // The load can go idle due to cache size limits
+          ok(e.networkState >= HTMLMediaElement.NETWORK_IDLE,
+              'test ' + testNum + ' networkState = ' + e.networkState + ' expected >= ' + HTMLMediaElement.NETWORK_IDLE);
           check_metadata(e);
           e.parentNode.removeChild(e);
           runNextTest();
         }, false);
       e.addEventListener('error', function(e) { e.stopPropagation();}, false);      
     } else {
       e.addEventListener('error', function(event) {
         event.stopPropagation();