let testAllocations = response.allocations.filter(isTestAllocation);
ok(testAllocations.length >= 3, "Should find our 3 test allocations (plus some allocations for the error "
+ "objects used to get line numbers)");
// For each of the test case's allocations, ensure that the parent frame // indices are correct. Also test that we did get an allocation at each // line we expected (rather than a bunch on the first line and none on the // others, etc).
let expectedLines = new Set([alloc1.line, alloc2.line, alloc3.line]);
for (let alloc of testAllocations) {
let innerFrame = alloc.frame;
ok(innerFrame, "Should get the inner frame");
is(innerFrame.functionDisplayName, "inner");
expectedLines.delete(innerFrame.line);
let middleFrame = innerFrame.parent;
ok(middleFrame, "Should get the middle frame");
is(middleFrame.functionDisplayName, "middle");
let outerFrame = middleFrame.parent;
ok(outerFrame, "Should get the outer frame");
is(outerFrame.functionDisplayName, "outer");
// Not going to test the rest of the frames because they are Task.jsm // and promise frames and it gets gross. Plus, I wouldn't want this test // to start failing if they changed their implementations in a way that // added or removed stack frames here.
}
is(expectedLines.size, 0, "Should have found all the expected lines");
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.