Bug 1081794 - Fixing a test for dns request cancel. On e10s, the dns resolver is sometimes faster than a cancel request. Use a random string to be resolved instead of a fix one. r=sworkman, a=test-only
authorDragana Damjanovic <dd.mozilla@gmail.com>
Tue, 14 Oct 2014 10:03:00 +0200
changeset 225752 6d2e5afd8b75
parent 225751 73bc0bc9343b
child 225753 53b97e435f10
push id4000
push userryanvm@gmail.com
push date2014-10-20 16:31 +0000
treeherdermozilla-beta@6d2e5afd8b75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssworkman, test-only
bugs1081794
milestone34.0
Bug 1081794 - Fixing a test for dns request cancel. On e10s, the dns resolver is sometimes faster than a cancel request. Use a random string to be resolved instead of a fix one. r=sworkman, 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
@@ -1,12 +1,18 @@
 var dns = Cc["@mozilla.org/network/dns-service;1"].getService(Ci.nsIDNSService);
 
-var hostname1 = "mozilla.org";
-var hostname2 = "mozilla.com";
+var hostname1 = "";
+var hostname2 = "";
+var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
+
+for( var i=0; i < 20; i++ ) {
+  hostname1 += possible.charAt(Math.floor(Math.random() * possible.length));
+  hostname2 += possible.charAt(Math.floor(Math.random() * possible.length));
+}
 
 var requestList1Canceled1;
 var requestList1Canceled2;
 var requestList1NotCanceled;
 
 var requestList2Canceled;
 var requestList2NotCanceled;