Bug 678595: Remove test assumption that cancel causes cache invalidation. r=jdm
authorJason Duell <jduell.mcbugs@gmail.com>
Fri, 02 Sep 2011 13:03:24 -0700
changeset 77792 ba720787775f210a18b523dc1ec2ac097b4ad618
parent 77791 f4af15996729ad75744f7ddad44ab579e0e06cfe
child 77793 8215d12a0015dd5d2c40bb7602263403d4d9a629
push id78
push userclegnitto@mozilla.com
push dateFri, 16 Dec 2011 17:32:24 +0000
treeherdermozilla-release@79d24e644fdd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdm
bugs678595
milestone9.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 678595: Remove test assumption that cancel causes cache invalidation. r=jdm
content/base/test/test_bug482935.html
--- a/content/base/test/test_bug482935.html
+++ b/content/base/test/test_bug482935.html
@@ -33,61 +33,16 @@ function testCancelInPhase4() {
           // This request was cancelled, so the responseText should be empty string
           is(xhr.responseText, "", "Expected empty response to cancelled request");
 
           // Second request - should be found in cache
           var xhr2 = new XMLHttpRequest();
 
           xhr2.addEventListener("load", function() {
             is(xhr2.responseText, "0", "Received fresh value for second request");
-            testCancelBeforePhase4();
-          }, false);
-
-          xhr2.open("GET", url);
-          xhr2.setRequestHeader("X-Request", "1", false);
-
-          try { xhr2.send(); }
-          catch(e) {
-            is(xhr2.status, "200", "Exception!");
-          }
-        }, 0);
-      }, false);
-
-      xhr.abort();
-    }
-  }, false);
-
-  xhr.open("GET", url, true);
-  xhr.setRequestHeader("X-Request", "0", false);
-  try { xhr.send(); }
-  catch(e) {
-    is("Nothing", "Exception", "Boom: " + e);
-  }
-}
-
-// Tests that response is NOT cached if the request is cancelled
-// before it has reached state 4
-function testCancelBeforePhase4() {
-
-  clearCache();
-
-  // First request - should be loaded from server
-  var xhr = new XMLHttpRequest();
-  xhr.addEventListener("readystatechange", function(e) {
-    if (xhr.readyState == 3) {
-      xhr.addEventListener("abort", function() {
-        setTimeout(function() {
-          // This request was cancelled, so the responseText should be empty string
-          is(xhr.responseText, "", "Expected empty response to cancelled request");
-
-          // Second request - should be found in cache
-          var xhr2 = new XMLHttpRequest();
-
-          xhr2.addEventListener("load", function() {
-            is(xhr2.responseText, "1", "Received cached value for second request");
             SimpleTest.finish();
           }, false);
 
           xhr2.open("GET", url);
           xhr2.setRequestHeader("X-Request", "1", false);
 
           try { xhr2.send(); }
           catch(e) {