diff options
Diffstat (limited to 'testing/web-platform/tests/performance-timeline/tentative/include-frames-two-local-children.html')
-rw-r--r-- | testing/web-platform/tests/performance-timeline/tentative/include-frames-two-local-children.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/performance-timeline/tentative/include-frames-two-local-children.html b/testing/web-platform/tests/performance-timeline/tentative/include-frames-two-local-children.html new file mode 100644 index 0000000000..01d4844522 --- /dev/null +++ b/testing/web-platform/tests/performance-timeline/tentative/include-frames-two-local-children.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<head> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +</head> +<body> +</body> +<script> +promise_test(() => { + return new Promise(resolve => { + performance.clearResourceTimings() + + let childFrameOneLoaded = false + let childFrameTwoLoaded = false + + // Create first child iframe. + const childFrameOne = document.createElement('iframe') + childFrameOne.src = "../resources/child-frame.html" + document.body.appendChild(childFrameOne) + + childFrameOne.addEventListener("load", () => { + childFrameOneLoaded = true + if (childFrameTwoLoaded) + verifyPerformanceEntries() + }) + + // Create second child iframe. + const childFrameTwo = document.createElement('iframe') + childFrameTwo.src = "../resources/child-frame.html" + document.body.appendChild(childFrameTwo) + + childFrameTwo.addEventListener("load", () => { + childFrameTwoLoaded = true + if (childFrameOneLoaded) + verifyPerformanceEntries() + }) + + function verifyPerformanceEntries() { + const entries = performance.getEntries(true) + const navigationEntries = performance.getEntriesByType("navigation", true) + const markedEntries = performance.getEntriesByName("entry-name", undefined, true) + + // 4 entries for parent, 2 for each child + assert_equals(entries.length, 8) + + // 1 entry for parent, 1 for each child. + assert_equals(navigationEntries.length, 3) + + // 1 entry for each child. + assert_equals(markedEntries.length, 2) + + resolve() + } + }) +}, "GetEntries of a parent Frame with two Same-Origin children") +</script>
\ No newline at end of file |