Bug 1249144 - [webext] fix sorting collected frame details in webNavigation tests. r=kmag
authorLuca Greco <lgreco@mozilla.com>
Fri, 19 Feb 2016 04:09:16 +0100
changeset 321654 3474b34808f788723370a0d9b99e959d21cccce9
parent 321653 35b8118cf841fcfb22823cc94db2669e4432dda7
child 321655 8089e684f942de5b14c0c66a646ef26a0812dc4b
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskmag
bugs1249144
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1249144 - [webext] fix sorting collected frame details in webNavigation tests. r=kmag MozReview-Commit-ID: ay5fGRGSpW
browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
--- a/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
+++ b/browser/components/extensions/test/browser/browser_ext_webNavigation_getFrames.js
@@ -134,17 +134,21 @@ add_task(function* testWebNavigationFram
     getFrameResults,
   } = yield extension.awaitMessage("webNavigationFrames.done");
 
   is(getAllFramesDetails.length, 3, "expected number of frames found");
   is(getAllFramesDetails.length, collectedDetails.length,
      "number of frames found should equal the number onCompleted events collected");
 
   // ordered by frameId
-  let sortByFrameId = (el) => el ? el.frameId : -1;
+  let sortByFrameId = (el1, el2) => {
+    let val1 = el1 ? el1.frameId : -1;
+    let val2 = el2 ? el2.frameId : -1;
+    return val1 - val2;
+  };
 
   collectedDetails = collectedDetails.sort(sortByFrameId);
   getAllFramesDetails = getAllFramesDetails.sort(sortByFrameId);
   getFrameResults = getFrameResults.sort(sortByFrameId);
 
   info("check frame details content");
 
   is(getFrameResults.length, getAllFramesDetails.length,