Bug 998282. Ensure cancellable_request.sjs massively overfills the default 100K media cache size.
authorRobert O'Callahan <robert@ocallahan.org>
Tue, 11 Mar 2014 17:30:27 +0800
changeset 198461 0920db1ab388e4a6f32a9cdb49d769988ded3d0c
parent 198460 2293861712300b82d8aa5e347775178086d1bc01
child 198462 8c7e0c36f4eaf5e762724357c11ca89aab3255a2
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs998282
milestone31.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 998282. Ensure cancellable_request.sjs massively overfills the default 100K media cache size. This ensures a test can make such a request, receive the event that the load has been suspended, and cancel the request, all before the load has completed.
content/media/test/cancellable_request.sjs
--- a/content/media/test/cancellable_request.sjs
+++ b/content/media/test/cancellable_request.sjs
@@ -78,17 +78,17 @@ function handleRequest(request, response
   if (cancel) {
     setState(cancel[1], "cancelled");
     response.setStatusLine(request.httpVersion, 200, "OK");
     response.write("Cancel approved!");
     return;
   }
 
   var samples = [];
-  for (var i = 0; i < 100000; ++i) {
+  for (var i = 0; i < 1000000; ++i) {
     samples.push(0);
   }
   var bytes = buildWave(samples, 44100).join("");
 
   var key = parseQuery(request, "key");
   response.setHeader("Content-Type", "audio/x-wav");
   response.setHeader("Content-Length", ""+bytes.length, false);
 
@@ -132,20 +132,20 @@ function handleRequest(request, response
   }
   
   if (start > 0) {
     // Send all requested data
     out.write(bytes.slice(start, end + 1), end + 1 - start);
     return;
   }
 
-  // Write the first 120K of the Wave file. We know the cache size is set to
+  // Write the first 1.2M of the Wave file. We know the cache size is set to
   // 100K so this will fill the cache and and cause a "suspend" event on
   // the loading element.
-  out.write(bytes, 120000);
+  out.write(bytes, 1200000);
 
   response.processAsync();
   // Now wait for the message to cancel this response
   poll(function() {
     if (getState(key[1]) != "cancelled") {
       return false;
     }
     response.finish();