diff --git a/performance-timeline/resources/include-frames-subframe.html b/performance-timeline/resources/include-frames-subframe.html index b74b1175f8c94a..73df04b046e16e 100644 --- a/performance-timeline/resources/include-frames-subframe.html +++ b/performance-timeline/resources/include-frames-subframe.html @@ -29,7 +29,7 @@ const childFrame = document.createElement('iframe'); childFrame.addEventListener('load', async () => { - const entries = performance.getEntries(true); + const entries = performance.getEntries({ includeChildFrames: true }); // Report number of performance entries to the parent. window.parent.postMessage(entries.length, "*"); diff --git a/performance-timeline/tentative/detached-frame.html b/performance-timeline/tentative/detached-frame.html index d5753dbcd7bac9..70019223a648d9 100644 --- a/performance-timeline/tentative/detached-frame.html +++ b/performance-timeline/tentative/detached-frame.html @@ -21,8 +21,7 @@ // Detach the child frame document.body.removeChild(childFrame); - const entries = childWindow.performance.getEntries(true); - const parent_entries = performance.getEntries(true); + const entries = childWindow.performance.getEntries({ includeChildFrames: true }); + const parent_entries = performance.getEntries({ includeChildFrames: true }); }, "GetEntries of a detached parent frame does not crash"); - diff --git a/performance-timeline/tentative/include-frames-originA-A-A.html b/performance-timeline/tentative/include-frames-originA-A-A.html index 0cdcd58115f65e..58480c7af1e649 100644 --- a/performance-timeline/tentative/include-frames-originA-A-A.html +++ b/performance-timeline/tentative/include-frames-originA-A-A.html @@ -32,12 +32,12 @@ // Verify the number of performance entries in the child frame. assert_equals(childFrameEntrySize, 6, 'Child Frame should have 6 entries.'); - const entries = performance.getEntries(true); + const entries = performance.getEntries({ includeChildFrames: true }); - const navigationEntries = performance.getEntriesByType('navigation', true); - - const markedEntries = performance.getEntriesByName('entry-name', undefined, true); + const navigationEntries = performance.getEntries({ entryType: "navigation", includeChildFrames: true }); + const markedEntries = performance.getEntries( + { name: 'entry-name', includeChildFrames: true }); // 3 entries for parent, 4 for child, 2 for grandchild. assert_equals(entries.length, 9, 'Total entries should be 9.'); @@ -48,6 +48,31 @@ // 1 entry for child, 1 for grandchild. assert_equals(markedEntries.length, 2, 'Mark entries should be 2.'); + // Test cases where includeChildFrames is false. + const entriesWithNoFitlerOptions = performance.getEntries(); + + const entriesWithoutIncludingChildFrames = performance.getEntries({ includeChildFrames: false }); + + const navigationEntriesWithoutIncludingChildFrames = performance.getEntries({ entryType: "navigation", includeChildFrames: false }); + + const markedEntriesWithoutIncludingChildFrames = performance.getEntries( + { name: 'entry-name', includeChildFrames: false }); + + // 3 entries for parent. + assert_equals(entriesWithNoFitlerOptions.length, 3, + 'Total entries without filter options should be 3 without filter options.'); + + assert_equals(entriesWithoutIncludingChildFrames.length, 3, + 'Total entries with includeChildFrame being false should be 3.'); + + // 1 entry for parent. + assert_equals(navigationEntriesWithoutIncludingChildFrames.length, 1, + 'Navigation entries with includeChildFrame being false should be 1.'); + + // 0 entry for child. + assert_equals(markedEntriesWithoutIncludingChildFrames.length, 0, + 'Mark entries with includeChildFrame being false should be 0.'); + }, 'GetEntries of a document of origin A, its child frame of origin B and \ its grandchild frame of origin A.'); diff --git a/performance-timeline/tentative/include-frames-originA-A.html b/performance-timeline/tentative/include-frames-originA-A.html index bb4ee9e63abcee..277a2376aefbcf 100644 --- a/performance-timeline/tentative/include-frames-originA-A.html +++ b/performance-timeline/tentative/include-frames-originA-A.html @@ -28,11 +28,12 @@ // Load a child frame. await loadSameOriginChildFrame(); - const entries = performance.getEntries(true); + const entries = performance.getEntries({ includeChildFrames: true }); - const navigationEntries = performance.getEntriesByType('navigation', true); + const navigationEntries = performance.getEntries({ entryType: "navigation", includeChildFrames: true }); - const markedEntries = performance.getEntriesByName('entry-name', undefined, true); + const markedEntries = performance.getEntries( + { name: 'entry-name', includeChildFrames: true }); // 3 entries for parent, 2 for child. assert_equals(entries.length, 5, 'Total entries should be 5.'); @@ -42,6 +43,32 @@ // 1 entry for child. assert_equals(markedEntries.length, 1, 'Mark entries should be 1.'); + + // Test cases where includeChildFrames is false. + const entriesWithNoFitlerOptions = performance.getEntries(); + + const entriesWithoutIncludingChildFrames = performance.getEntries({ includeChildFrames: false }); + + const navigationEntriesWithoutIncludingChildFrames = performance.getEntries({ entryType: "navigation", includeChildFrames: false }); + + const markedEntriesWithoutIncludingChildFrames = performance.getEntries( + { name: 'entry-name', includeChildFrames: false }); + + // 3 entries for parent. + assert_equals(entriesWithNoFitlerOptions.length, 3, + 'Total entries without filter options should be 3 without filter options.'); + + assert_equals(entriesWithoutIncludingChildFrames.length, 3, + 'Total entries with includeChildFrame being false should be 3.'); + + // 1 entry for parent. + assert_equals(navigationEntriesWithoutIncludingChildFrames.length, 1, + 'Navigation entries with includeChildFrame being false should be 1.'); + + // 0 entry for child. + assert_equals(markedEntriesWithoutIncludingChildFrames.length, 0, + 'Mark entries with includeChildFrame being false should be 0.'); + }, 'GetEntries of a document of origin A and its child frame of origin A.');
diff --git a/performance-timeline/tentative/include-frames-originA-B-B.html b/performance-timeline/tentative/include-frames-originA-B-B.html index a1c85150e691ea..b182931e5dceee 100644 --- a/performance-timeline/tentative/include-frames-originA-B-B.html +++ b/performance-timeline/tentative/include-frames-originA-B-B.html @@ -35,7 +35,7 @@ // 4 for child, 2 for grandchild. assert_equals(childFrameEntrySize, 6, 'Child frame entries should be 6.'); - const entries = performance.getEntries(true); + const entries = performance.getEntries({ includeChildFrames: true }); // 3 entries for parent, 0 for child, 0 for grandchild. assert_equals(entries.length, 3, 'Total entries should be 3.'); diff --git a/performance-timeline/tentative/include-frames-originA-B.html b/performance-timeline/tentative/include-frames-originA-B.html index 0373c824d908ab..0686c9b1e5876c 100644 --- a/performance-timeline/tentative/include-frames-originA-B.html +++ b/performance-timeline/tentative/include-frames-originA-B.html @@ -28,11 +28,12 @@ await loadCrossOriginChildFrame(); - const entries = performance.getEntries(true); + const entries = performance.getEntries({ includeChildFrames: true }); - const navigationEntries = performance.getEntriesByType("navigation", true); + const navigationEntries = performance.getEntries({ entryType: "navigation", includeChildFrames: true }); - const markedEntries = performance.getEntriesByName('entry-name', undefined, true); + const markedEntries = performance.getEntries( + { name: 'entry-name', includeChildFrames: true }); // 3 entries for parent, 0 for child. assert_equals(entries.length, 3, 'Total entries should be 3.'); diff --git a/performance-timeline/tentative/performance-entry-source.html b/performance-timeline/tentative/performance-entry-source.html index 5e51ddbbe4493d..471a52ab285882 100644 --- a/performance-timeline/tentative/performance-entry-source.html +++ b/performance-timeline/tentative/performance-entry-source.html @@ -8,7 +8,7 @@ \ No newline at end of file +