Commit 16980f14 authored by Xianzhu Wang's avatar Xianzhu Wang

Ensure consistent focus status of some form tests

The tests were flaky because of inconsistent forcus status.

Change-Id: Idb494efcc489a441446c4a9b12968cde86faf8e6
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1872991Reviewed-by: default avatarPhilip Rogers <pdr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#708675}
parent ce9dbc69
......@@ -5714,11 +5714,6 @@ crbug.com/1013523 [ Release ] virtual/cross-origin-embedder-policy/external/wpt/
crbug.com/1013523 [ Release Linux Mac ] external/wpt/html/cross-origin-embedder-policy/require-corp.https.html [ Failure Pass ]
crbug.com/1010472 [ Linux Mac Debug ] virtual/disable-deferred-rendering/fast/canvas/color-space/canvas-drawImage-offscreenCanvas.html [ Timeout Pass ]
crbug.com/1010472 [ Mac Debug ] virtual/disable-deferred-rendering/fast/canvas/OffscreenCanvas-placeholder-createImageBitmap.html [ Failure Pass ]
crbug.com/1013779 virtual/scalefactor200/fast/hidpi/static/calendar-picker-appearance.html [ Failure Pass ]
crbug.com/1013779 [ Mac ] virtual/scalefactor200/fast/hidpi/static/data-suggestion-picker-appearance.html [ Failure Pass ]
crbug.com/1013779 virtual/scalefactor200/fast/hidpi/static/pointerevents/pointerevent_touch-adjustment_click_target.html [ Failure Pass ]
crbug.com/1013779 virtual/scalefactor200/fast/hidpi/static/popup-menu-appearance.html [ Failure Pass ]
crbug.com/1013779 virtual/scalefactor200/fast/hidpi/static/validation-bubble-appearance-hidpi.html [ Failure Pass ]
crbug.com/990900 external/wpt/cookie-store/idlharness.tentative.https.any.serviceworker.html [ Pass Timeout ]
crbug.com/990900 virtual/omt-worker-fetch/external/wpt/fetch/api/idlharness.any.html [ Pass Timeout ]
......
......@@ -17,10 +17,7 @@
return;
var select = document.getElementById('select');
// FIXME: it would be really nice to use getBoundingClientRect() and not
// hard-code pixel coordinates here, but since it's in an iframe, the
// coordinates are translated anyway.
clickToOpenPicker(50, 120, callback, function () {
openPicker(select, callback, function () {
setTimeout(callback, 0);
});
}
......@@ -47,7 +44,7 @@
select.appendChild(option);
}
if (x == 24) {
if (x == 23) {
select.id = 'select';
}
......
......@@ -45,17 +45,8 @@ function openPicker(element, callback, errorCallback) {
eventSender.keyDown("ArrowDown", ["altKey"]);
}
}
popupWindow = internals.pagePopupWindow;
if (typeof callback === "function" && popupWindow)
setPopupOpenCallback(callback);
else if (typeof errorCallback === "function" && !popupWindow)
errorCallback();
}
function clickToOpenPicker(x, y, callback, errorCallback) {
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
// To avoid flakiness of test about focused status of the element.
element.focus();
popupWindow = internals.pagePopupWindow;
if (typeof callback === "function" && popupWindow)
setPopupOpenCallback(callback);
......
......@@ -2,10 +2,12 @@
<body>
<div style="width:100%; height:4em; overflow:scroll">
<div style="position:relative; left:90%; top:1000px; width:100%; font-family:system-ui; font-size:16px">
Font-size in the validation bubble should be same as this paragraph.<input type=checkbox required>
Font-size in the validation bubble should be same as this paragraph.<input id=checkbox type=checkbox required>
</div>
</div>
<script>
document.querySelector('input').reportValidity();
checkbox.reportValidity();
// To avoid flakiness of test about focused status of the element.
checkbox.focus();
</script>
</body>
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