Bug 1285173 - Netmonitor perf stats: whenDataAvailable should wait for a nonempty request list r=Honza
☠☠ backed out by 222dd5537727 ☠ ☠
authorJarda Snajdr <jsnajdr@gmail.com>
Fri, 11 Nov 2016 16:06:29 +0100
changeset 322432 afd22bdea63caf72d1ae956d2b2f28e99ab2a748
parent 322431 89101092aea13babe5a9a9e4750b89758425f1e2
child 322433 785cc517d781a2f7b1b2dda8a98384db636bf8c7
push id21
push usermaklebus@msu.edu
push dateThu, 01 Dec 2016 06:22:08 +0000
reviewersHonza
bugs1285173
milestone52.0a1
Bug 1285173 - Netmonitor perf stats: whenDataAvailable should wait for a nonempty request list r=Honza MozReview-Commit-ID: F4yi7vUdXsM
devtools/client/netmonitor/netmonitor-view.js
--- a/devtools/client/netmonitor/netmonitor-view.js
+++ b/devtools/client/netmonitor/netmonitor-view.js
@@ -1196,17 +1196,17 @@ var $all = (selector, target = document)
  * @return object
  *         A promise resolved when all objects in dataStore contain the
  *         properties defined in mandatoryFields.
  */
 function whenDataAvailable(dataStore, mandatoryFields) {
   let deferred = promise.defer();
 
   let interval = setInterval(() => {
-    if (dataStore.every(item => {
+    if (dataStore.length > 0 && dataStore.every(item => {
       return mandatoryFields.every(field => field in item);
     })) {
       clearInterval(interval);
       clearTimeout(timer);
       deferred.resolve();
     }
   }, WDA_DEFAULT_VERIFY_INTERVAL);