зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1684708 - Migrate helper_scrollby_bug1531796.html to async/await style. r=botond
Depends on D100617 Differential Revision: https://phabricator.services.mozilla.com/D100618
This commit is contained in:
Родитель
498df38275
Коммит
a1c103f316
|
@ -9,18 +9,19 @@
|
|||
<script src="/tests/SimpleTest/paint_listener.js"></script>
|
||||
<script type="application/javascript">
|
||||
|
||||
function* test(testDriver) {
|
||||
async function test() {
|
||||
const maxSteps = 20;
|
||||
let scrollPerStep = 40;
|
||||
for (let step = 0; step < maxSteps; step++) {
|
||||
window.scrollBy(0, scrollPerStep);
|
||||
window.requestAnimationFrame(testDriver);
|
||||
yield;
|
||||
await waitForFrame();
|
||||
}
|
||||
is(window.scrollY, maxSteps * scrollPerStep, "Scrolled by the expected amount");
|
||||
}
|
||||
|
||||
waitUntilApzStable().then(runContinuation(test)).then(subtestDone, subtestFailed);
|
||||
waitUntilApzStable()
|
||||
.then(test)
|
||||
.then(subtestDone, subtestFailed);
|
||||
|
||||
</script>
|
||||
<style>
|
||||
|
|
Загрузка…
Ссылка в новой задаче