Bug 1249144 - [webext] Test explicitly the frameId/parentFrameId associated to the toplevel frame. r?billm draft
authorLuca Greco <lgreco@mozilla.com>
Thu, 18 Feb 2016 01:56:09 +0100
changeset 335782 94994c243b67c0f1b6e9f720d5e11c2e3cc8f72f
parent 334586 17ba8c582eba5fb32809f1480867c200f69b5e2f
child 515215 45bec6d84f6de7f8669aa432f61fc18e87539914
push id11874
push userluca.greco@alcacoop.it
push dateTue, 01 Mar 2016 14:57:35 +0000
reviewersbillm
bugs1249144
milestone47.0a1
Bug 1249144 - [webext] Test explicitly the frameId/parentFrameId associated to the toplevel frame. r?billm MozReview-Commit-ID: 9E7LmdyHcnG
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
@@ -133,16 +133,19 @@ add_task(function* testWebNavigationFram
     getAllFramesDetails,
     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");
 
+  is(getAllFramesDetails[0].frameId, 0, "the root frame has the expected frameId");
+  is(getAllFramesDetails[0].parentFrameId, -1, "the root frame has the expected parentFrameId");
+
   // ordered by frameId
   let sortByFrameId = (el1, el2) => {
     let val1 = el1 ? el1.frameId : -1;
     let val2 = el2 ? el2.frameId : -1;
     return val1 - val2;
   };
 
   collectedDetails = collectedDetails.sort(sortByFrameId);