Commit 31097e58 authored by Lukasz Anforowicz's avatar Lukasz Anforowicz Committed by Commit Bot

Disable flaky EventGeneratorTest.MouseEventsProcessedSequentially.

I looked at other js-based tests and couldn't find a way to disable only
on a single platform (it seems that the flakiness is specific to
ChromeOS).

Note that most of the changes in this CL comes from
|git cl format --js chrome/browser/resources|.

Bug: 1136991
Change-Id: Ib292732483b5f1d88f0a5b919c66eb484646f31b
Tbr: anastasi@chromium.org
Tbr: dtseng@chromium.org
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2463928Reviewed-by: default avatarŁukasz Anforowicz <lukasza@chromium.org>
Commit-Queue: Łukasz Anforowicz <lukasza@chromium.org>
Cr-Commit-Position: refs/heads/master@{#815866}
parent f6cdd7d7
...@@ -10,34 +10,39 @@ GEN_INCLUDE([ ...@@ -10,34 +10,39 @@ GEN_INCLUDE([
/** Test fixture for array_util.js. */ /** Test fixture for array_util.js. */
EventGeneratorTest = class extends ChromeVoxNextE2ETest {}; EventGeneratorTest = class extends ChromeVoxNextE2ETest {};
TEST_F('EventGeneratorTest', 'MouseEventsProcessedSequentially', function() { // Fails on ChromeOS - https://crbug.com/1136991
const mouseEventLog = []; TEST_F(
chrome.accessibilityPrivate.sendSyntheticMouseEvent = (event) => 'EventGeneratorTest', 'DISABLED_MouseEventsProcessedSequentially',
mouseEventLog.push(event); function() {
const mouseEventLog = [];
chrome.accessibilityPrivate.sendSyntheticMouseEvent = (event) =>
mouseEventLog.push(event);
// Set a 1ms delay so that a timeout is set between the press and release. // Set a 1ms delay so that a timeout is set between the press and release.
EventGenerator.sendMouseClick(100, 100, /*delayMs=*/ 1); EventGenerator.sendMouseClick(100, 100, /*delayMs=*/ 1);
assertEquals(1, mouseEventLog.length, 'First event should be synchronous'); assertEquals(
1, mouseEventLog.length, 'First event should be synchronous');
EventGenerator.sendMouseClick(200, 200, /*delayMs=*/ 1); EventGenerator.sendMouseClick(200, 200, /*delayMs=*/ 1);
assertEquals( assertEquals(
1, mouseEventLog.length, 1, mouseEventLog.length,
'Second mouse click shouldn\'t start until first has finished'); 'Second mouse click shouldn\'t start until first has finished');
const checkEventLog = () => { const checkEventLog = () => {
assertEquals( assertEquals(
4, mouseEventLog.length, 'Both click events should have completed.'); 4, mouseEventLog.length,
assertEquals('press', mouseEventLog[0].type); 'Both click events should have completed.');
assertEquals('release', mouseEventLog[1].type); assertEquals('press', mouseEventLog[0].type);
assertEquals(mouseEventLog[0].x, mouseEventLog[1].x); assertEquals('release', mouseEventLog[1].type);
assertEquals(mouseEventLog[0].y, mouseEventLog[1].y); assertEquals(mouseEventLog[0].x, mouseEventLog[1].x);
assertEquals(mouseEventLog[0].y, mouseEventLog[1].y);
assertEquals('press', mouseEventLog[2].type); assertEquals('press', mouseEventLog[2].type);
assertEquals('release', mouseEventLog[3].type); assertEquals('release', mouseEventLog[3].type);
assertEquals(mouseEventLog[2].x, mouseEventLog[3].x); assertEquals(mouseEventLog[2].x, mouseEventLog[3].x);
assertEquals(mouseEventLog[2].y, mouseEventLog[3].y); assertEquals(mouseEventLog[2].y, mouseEventLog[3].y);
}; };
// Experimentally, the code takes 13ms to set all timeouts on a development // Experimentally, the code takes 13ms to set all timeouts on a
// machine. Wait 150ms to increase stability. // development machine. Wait 150ms to increase stability.
setTimeout(this.newCallback(checkEventLog), 150); setTimeout(this.newCallback(checkEventLog), 150);
}); });
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment