forked from WebKit/WebKit
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathno-layer-changes-from-raf.html
43 lines (36 loc) · 1.36 KB
/
no-layer-changes-from-raf.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<!DOCTYPE html>
<html>
<head>
<script src="../resources/js-test-pre.js"></script>
<script src="../resources/ui-helper.js"></script>
<script>
jsTestIsAsync = true;
async function getCountOfLayerChangingUpdates()
{
return new Promise(resolve => {
testRunner.runUIScript("uiController.countOfUpdatesWithLayerChanges", result => resolve(result));
});
}
async function waitForRenderingUpdates(count)
{
for (let i = 0; i < count; ++i)
await UIHelper.renderingUpdate();
}
let initialCountOfLayerChangingUpdates;
let finalCountOfLayerChangingUpdates;
window.addEventListener('load', async () => {
// Wait to stabilize.
await UIHelper.renderingUpdate();
await UIHelper.renderingUpdate();
initialCountOfLayerChangingUpdates = await getCountOfLayerChangingUpdates();
waitForRenderingUpdates(5);
finalCountOfLayerChangingUpdates = await getCountOfLayerChangingUpdates();
shouldBeTrue('initialCountOfLayerChangingUpdates === finalCountOfLayerChangingUpdates');
finishJSTest();
}, false);
</script>
</head>
<body>
<script src="../resources/js-test-post.js"></script>
</body>
</html>