Bug 1109238 - Fix dns cancel test. r=mcmanus, a=test-only
authorDragana Damjanovic <dd.mozilla@gmail.com>
Thu, 22 Jan 2015 09:25:00 -0500
changeset 249404 8347494bd357d27e1b4e08d43cd0c23f418e86b5
parent 249403 b29971ada02412835cc631e63087ac3fef15f3df
child 249405 d1b94a06a364471d2626d029473b81f4c7e81403
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus, test-only
bugs1109238
milestone37.0a2
Bug 1109238 - Fix dns cancel test. r=mcmanus, a=test-only
netwerk/test/unit/test_dns_cancel.js
--- a/netwerk/test/unit/test_dns_cancel.js
+++ b/netwerk/test/unit/test_dns_cancel.js
@@ -14,23 +14,17 @@ var requestList1Canceled2;
 var requestList1NotCanceled;
 
 var requestList2Canceled;
 var requestList2NotCanceled;
 
 var listener1 = {
   onLookupComplete: function(inRequest, inRecord, inStatus) {
     // One request should be resolved and two request should be canceled.
-    if (inRequest == requestList1Canceled1 ||
-        inRequest == requestList1Canceled2) {
-      // This request is canceled.
-      do_check_eq(inStatus, Cr.NS_ERROR_ABORT);
-
-      do_test_finished();
-    } else if (inRequest == requestList1NotCanceled) {
+    if (inRequest == requestList1NotCanceled) {
       // This request should not be canceled.
       do_check_neq(inStatus, Cr.NS_ERROR_ABORT);
 
       do_test_finished();
     }
   },
   QueryInterface: function(aIID) {
     if (aIID.equals(Ci.nsIDNSListener) ||
@@ -39,22 +33,17 @@ var listener1 = {
     }
     throw Cr.NS_ERROR_NO_INTERFACE;
   }
 };
 
 var listener2 = {
   onLookupComplete: function(inRequest, inRecord, inStatus) {
     // One request should be resolved and the other canceled.
-    if (inRequest == requestList2Canceled) {
-      // This request is canceled.
-      do_check_eq(inStatus, Cr.NS_ERROR_ABORT);
-
-      do_test_finished();
-    } else {
+    if (inRequest == requestList2NotCanceled) {
       // The request should not be canceled.
       do_check_neq(inStatus, Cr.NS_ERROR_ABORT);
 
       do_test_finished();
     }
   },
   QueryInterface: function(aIID) {
     if (aIID.equals(Ci.nsIDNSListener) ||
@@ -86,12 +75,9 @@ function run_test() {
   requestList2NotCanceled = dns.asyncResolve(hostname1, flags, listener2, mainThread);
 
   // This one will be canceled with cancel(Cr.NS_ERROR_ABORT).
   requestList2Canceled = dns.asyncResolve(hostname2, flags, listener2, mainThread);
   requestList2Canceled.cancel(Cr.NS_ERROR_ABORT);
 
   do_test_pending();
   do_test_pending();
-  do_test_pending();
-  do_test_pending();
-  do_test_pending();
 }