Bug 1370585 - Periodically check the flag (at most 30 seconds) rather than checking only once. draft
authorHenry Chang <hchang@mozilla.com>
Mon, 19 Jun 2017 18:25:12 +0800
changeset 596501 1860ada5b62c5aeec2e0955c8eb48fc9e6829b42
parent 596219 95543bdc59bd038a3d5d084b85a4fec493c349ee
child 633984 f1c7af2dfdd0a6f6b5dddd0cc5035f8818caa1d4
push id64664
push userhchang@mozilla.com
push dateMon, 19 Jun 2017 10:25:53 +0000
bugs1370585
milestone56.0a1
Bug 1370585 - Periodically check the flag (at most 30 seconds) rather than checking only once. MozReview-Commit-ID: BjGN7nOCmTS
toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
--- a/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
+++ b/toolkit/components/url-classifier/tests/mochitest/test_classify_ping.html
@@ -47,19 +47,18 @@
     SpecialPowers.setBoolPref(TP_ENABLE_PREF, false);
 
     var msg = "ping should reach page in blacklist when tracking protection is off";
     var expectPing = true;
     var id = "2222";
     ping(id, host_track);
 
     return new Promise(function(resolve, reject) {
-      setTimeout(function() {
-        isPinged(id, expectPing, msg, resolve);
-      }, timeout);
+      // Retry at most 30 seconds.
+      isPingedWithRetry(id, expectPing, msg, resolve, 30 * 1000 / RETRY_TIMEOUT_MS);
     });
   }
 
   function testPingBlacklistSafebrowsingOn() {
     SpecialPowers.setBoolPref(TP_ENABLE_PREF, true);
 
     var msg = "ping should not reach page in blacklist when tracking protection is on";
     var expectPing = false;