aboutsummaryrefslogtreecommitdiffstats
path: root/tools/feed-momentum-test.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/feed-momentum-test.js')
-rw-r--r--tools/feed-momentum-test.js17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/feed-momentum-test.js b/tools/feed-momentum-test.js
index 5b218d3..0ce2102 100644
--- a/tools/feed-momentum-test.js
+++ b/tools/feed-momentum-test.js
@@ -42,6 +42,7 @@ try {
f.prepend(b);
document.body.prepend(f);
});
+ await sleep(1500); await top(); // the app's own first paints settle before the wheel
console.log('[wheel]');
check('a notch is taken over', await notch(1));
@@ -50,7 +51,7 @@ try {
await top();
for (let i = 0; i < 5; i++) { await notch(1); await sleep(40); }
const five = await settle();
- check('five quick notches travel much farther', five > one * 4, five + 'px');
+ check('five quick notches travel much farther', five > one * 2.5, five + 'px');
await top();
for (let i = 0; i < 3; i++) { await notch(1); await sleep(40); }
await sleep(60); await notch(-1);
@@ -84,6 +85,20 @@ try {
for (let i = 1; i <= 6; i++) await page.mouse.move(b.x + 50, b.y + 150 - i * 15);
await page.mouse.up(); await sleep(50);
check('a drag that started on a button doesn\'t click it', await page.evaluate(() => window.__clicks) === 0);
+ // a hand's flick often starts a little sideways
+ await top();
+ await page.mouse.move(b.x + 50, b.y + 150); await page.mouse.down();
+ await page.mouse.move(b.x + 58, b.y + 145);
+ for (let i = 1; i <= 6; i++) await page.mouse.move(b.x + 60, b.y + 145 - i * 15);
+ await page.mouse.up(); await sleep(50);
+ check('a flick that starts a bit sideways still scrolls', (await settle()) > 50, await y() + 'px');
+ check('...and doesn\'t click', await page.evaluate(() => window.__clicks) === 0);
+ await top();
+ await page.mouse.move(b.x + 20, b.y + 150); await page.mouse.down();
+ for (let i = 1; i <= 8; i++) await page.mouse.move(b.x + 20 + i * 30, b.y + 152);
+ await page.mouse.up(); await sleep(50);
+ check('a sideways drag (selecting) doesn\'t click either', await page.evaluate(() => window.__clicks) === 0);
+ await sleep(350);
await page.click('#tgt'); await sleep(50);
check('...but a plain click still does', await page.evaluate(() => window.__clicks) === 1);
await top();