Bug 1420037 - Wait for all payload to be finished in DAMP requestsFinished. r=Honza
authorAlexandre Poirot <poirot.alex@gmail.com>
Thu, 23 Nov 2017 01:26:04 -0800
changeset 437996 adec56d3dad559dd7b6a239b4e4ee8800bc30ca2
parent 437995 f9ea3f389c6adf43d289aac1cd7e6e8be2ec2683
child 437997 3a7a93bf138e3f05b7e23e5a550640bd60f0d2d3
push id117
push userfmarier@mozilla.com
push dateTue, 28 Nov 2017 20:17:16 +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);
     };