Bug 1420037 - Wait for all payload to be finished in DAMP requestsFinished. r=Honza draft
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 23 Nov 2017 01:26:04 -0800
changeset 702484 a6a164f0b3a1f7431602fed305818643f24c98de
parent 702483 6e46b1cec119b6b7ecc6b1fbd9be8c545cfcff0a
child 741506 b41789a987d1baf8576a9cdbaf0dfc6aa62e792f
push id90526
push userbmo:poirot.alex@gmail.com
push dateThu, 23 Nov 2017 09:30:25 +0000
reviewersHonza
bugs1420037
milestone59.0a1
Bug 1420037 - Wait for all payload to be finished in DAMP requestsFinished. r=Honza MozReview-Commit-ID: 3R5BY2oeKKL
testing/talos/talos/tests/devtools/addon/content/damp.js
--- a/testing/talos/talos/tests/devtools/addon/content/damp.js
+++ b/testing/talos/talos/tests/devtools/addon/content/damp.js
@@ -709,35 +709,35 @@ async _consoleOpenWithCachedMessagesTest
     return new Promise(resolve => {
       // Key is the request id, value is a boolean - is request finished or not?
       let requests = new Map();
 
       function onRequest(_, id) {
         requests.set(id, false);
       }
 
-      function onTimings(_, id) {
+      function onPayloadReady(_, id) {
         requests.set(id, true);
         maybeResolve();
       }
 
       function maybeResolve() {
         // Have all the requests in the map finished yet?
         if (![...requests.values()].every(finished => finished)) {
           return;
         }
 
         // All requests are done - unsubscribe from events and resolve!
         window.off(EVENTS.NETWORK_EVENT, onRequest);
-        window.off(EVENTS.RECEIVED_EVENT_TIMINGS, onTimings);
+        window.off(EVENTS.PAYLOAD_READY, onPayloadReady);
         resolve();
       }
 
       window.on(EVENTS.NETWORK_EVENT, onRequest);
-      window.on(EVENTS.RECEIVED_EVENT_TIMINGS, onTimings);
+      window.on(EVENTS.PAYLOAD_READY, onPayloadReady);
     });
   },
 
   startTest(doneCallback, config) {
     this._onTestComplete = function(results) {
       TalosParentProfiler.pause("DAMP - end");
       doneCallback(results);
     };