blob: 2e7a9990dd059b6b4142636c58c884431b74f878 [file] [log] [blame]
spanickera5b95cb2017-03-10 22:42:551<!DOCTYPE HTML>
2<meta charset=utf-8>
3<title>LongTask Timing: long task in nested child iframe</title>
4<body>
5
6<script src="/resources/testharness.js"></script>
7<script src="/resources/testharnessreport.js"></script>
8
9<script>
npm@chromium.org71ff8882017-08-15 17:22:0110 const t = async_test(t => {
Nicolas Penacd751192018-07-10 21:05:2711 if (typeof PerformanceLongTaskTiming === 'undefined') {
12 assert_unreached("Longtasks are not supported.");
13 t.done();
14 }
npm@chromium.org71ff8882017-08-15 17:22:0115 window.addEventListener('message', t.step_func(e => {
Nicolas Pena17feed52017-12-04 18:27:4116 assert_equals(e.data['entryType'], 'longtask');
17 assert_equals(e.data['frame-attribution'], 'same-origin-ancestor');
18 assert_equals(e.data['task-attribution'], 'script');
19 assert_equals(e.data['containerId'], '');
20 assert_equals(e.data['containerName'], '');
21 assert_equals(e.data['containerSrc'], '');
spanickera5b95cb2017-03-10 22:42:5522 t.done();
23 }));
npm@chromium.org71ff8882017-08-15 17:22:0124 }, 'Performance longtask entries in parent are observable in child iframe.');
maxlg@chromium.orgb12daf62017-07-28 21:31:5725
npm@chromium.org71ff8882017-08-15 17:22:0126 const iframe = document.createElement('iframe');
maxlg@chromium.orgb12daf62017-07-28 21:31:5727 iframe.id = 'child-iframe-id';
28 iframe.name = 'child-iframe-name';
29 document.body.appendChild(iframe);
30 iframe.src = 'resources/subframe-observing-longtask.html';
Nicolas Pena930d2ef2018-07-16 20:18:1331 iframe.onload = () => {
32 t.step_timeout( () => {
33 const begin = window.performance.now();
34 while (window.performance.now() < begin + 60);
35 }, 50);
36 };
spanickera5b95cb2017-03-10 22:42:5537</script>
38
maxlg@chromium.orgb12daf62017-07-28 21:31:5739</body>