Bug 1249144 - [webext] Test explicitly the frameId/parentFrameId associated to the toplevel frame. r?billm
MozReview-Commit-ID: 9E7LmdyHcnG
--- 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);