blob: 2da635467a211cae6e15352c8e9ddf450ce36663 [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');
Nicolas Pena4309ceb2018-11-15 20:00:4418 assert_equals(e.data['task-attribution'], 'unknown');
Nicolás Peña Morenoe92918c2019-12-04 00:48:4219 assert_equals(e.data['containerType'], 'window');
Nicolas Pena17feed52017-12-04 18:27:4120 assert_equals(e.data['containerId'], '');
21 assert_equals(e.data['containerName'], '');
22 assert_equals(e.data['containerSrc'], '');
spanickera5b95cb2017-03-10 22:42:5523 t.done();
24 }));
npm@chromium.org71ff8882017-08-15 17:22:0125 }, 'Performance longtask entries in parent are observable in child iframe.');
maxlg@chromium.orgb12daf62017-07-28 21:31:5726
npm@chromium.org71ff8882017-08-15 17:22:0127 const iframe = document.createElement('iframe');
maxlg@chromium.orgb12daf62017-07-28 21:31:5728 iframe.id = 'child-iframe-id';
29 iframe.name = 'child-iframe-name';
30 document.body.appendChild(iframe);
31 iframe.src = 'resources/subframe-observing-longtask.html';
Nicolas Pena930d2ef2018-07-16 20:18:1332 iframe.onload = () => {
33 t.step_timeout( () => {
34 const begin = window.performance.now();
35 while (window.performance.now() < begin + 60);
36 }, 50);
37 };
spanickera5b95cb2017-03-10 22:42:5538</script>
39
maxlg@chromium.orgb12daf62017-07-28 21:31:5740</body>