Bug 1651253 [wpt PR 24508] - Remove containerName truncation, switch to use atomicString, a=testonly

Automatic update from web-platform-tests
Remove containerName truncation, switch to use atomicString

As mentioned in Bug 1030396, the containerName attribute was first added in https://codereview.chromium.org/2515993002/ and it was truncated to 100 chars. The spec does not mention this truncation anywhere, see https://w3c.github.io/longtasks/.

In this PR, we removed undocumented containerName truncation, and changed member variables to use
atomicString instead of String.

Bug: 1030396
Change-Id: Ie1e7e6d7d1878ca16091a5f4db316d9c59368be0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2276680
Commit-Queue: Qiaofei Ye <qiaye@microsoft.com>
Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Reviewed-by: Nicolás Peña Moreno <npm@chromium.org>
Cr-Commit-Position: refs/heads/master@{#786484}

--

wpt-commits: 1378543f15bedb0365455795053c3b5cd1f08581
wpt-pr: 24508
This commit is contained in:
Qiaofei Ye 2020-07-09 14:19:22 +00:00 коммит произвёл moz-wptsync-bot
Родитель b5b30cf46a
Коммит cf9c4d31da
1 изменённых файлов: 54 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,54 @@
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>LongTask Timing: long tasks in long-name iframe containers</title>
<body>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<h1>Longtasks in iframe</h1>
<div id="log"></div>
<script>
const longContainerName = 'iframeWithLongNameMoreThan100CharactersSpaceHolderSpaceHolderSpaceHolderSpaceHolderSpaceHolderSpaceHolder';
promise_test(async t => {
assert_implements(window.PerformanceLongTaskTiming, 'Longtasks are not supported.');
const initialTime = performance.now();
return new Promise(resolve => {
const observer = new PerformanceObserver(t.step_func(entryList => {
const entries = entryList.getEntries();
assert_equals(entries.length, 1,
'Exactly one entry is expected.');
const longtask = entries[0];
assert_equals(longtask.entryType, 'longtask');
if (longtask.name == 'self' ||
longtask.name == 'multiple-contexts' ||
longtask.name == 'unknown')
return;
assert_equals(longtask.name, 'same-origin-descendant');
assert_greater_than(longtask.duration, 50);
assert_greater_than_equal(longtask.startTime, initialTime);
const currentTime = performance.now();
assert_less_than_equal(longtask.startTime, currentTime);
// Assert the TaskAttributionTiming entry in attribution.
assert_equals(longtask.attribution.length, 1,
'Exactly one attribution entry is expected');
const attribution = longtask.attribution[0];
assert_equals(attribution.entryType, 'taskattribution');
assert_equals(attribution.name, 'unknown');
assert_equals(attribution.duration, 0);
assert_equals(attribution.startTime, 0);
assert_equals(attribution.containerId, longContainerName + '-id');
assert_equals(attribution.containerName, longContainerName + '-name');
assert_equals(attribution.containerSrc, 'resources/subframe-with-longtask.html');
observer.disconnect();
resolve();
}));
observer.observe({entryTypes: ['longtask']});
const iframe = document.createElement('iframe');
iframe.id = longContainerName + '-id';
iframe.name = longContainerName + '-name';
iframe.src = 'resources/subframe-with-longtask.html';
document.body.appendChild(iframe);
});
}, `Performance longtask entries in ${longContainerName} are observable in parent.`);
</script>
</body>