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/ ...@@ -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/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 [ 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/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 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 ] crbug.com/990900 virtual/omt-worker-fetch/external/wpt/fetch/api/idlharness.any.html [ Pass Timeout ]
......
...@@ -17,10 +17,7 @@ ...@@ -17,10 +17,7 @@
return; return;
var select = document.getElementById('select'); var select = document.getElementById('select');
// FIXME: it would be really nice to use getBoundingClientRect() and not openPicker(select, callback, function () {
// hard-code pixel coordinates here, but since it's in an iframe, the
// coordinates are translated anyway.
clickToOpenPicker(50, 120, callback, function () {
setTimeout(callback, 0); setTimeout(callback, 0);
}); });
} }
...@@ -47,7 +44,7 @@ ...@@ -47,7 +44,7 @@
select.appendChild(option); select.appendChild(option);
} }
if (x == 24) { if (x == 23) {
select.id = 'select'; select.id = 'select';
} }
......
...@@ -45,17 +45,8 @@ function openPicker(element, callback, errorCallback) { ...@@ -45,17 +45,8 @@ function openPicker(element, callback, errorCallback) {
eventSender.keyDown("ArrowDown", ["altKey"]); eventSender.keyDown("ArrowDown", ["altKey"]);
} }
} }
popupWindow = internals.pagePopupWindow; // To avoid flakiness of test about focused status of the element.
if (typeof callback === "function" && popupWindow) element.focus();
setPopupOpenCallback(callback);
else if (typeof errorCallback === "function" && !popupWindow)
errorCallback();
}
function clickToOpenPicker(x, y, callback, errorCallback) {
eventSender.mouseMoveTo(x, y);
eventSender.mouseDown();
eventSender.mouseUp();
popupWindow = internals.pagePopupWindow; popupWindow = internals.pagePopupWindow;
if (typeof callback === "function" && popupWindow) if (typeof callback === "function" && popupWindow)
setPopupOpenCallback(callback); setPopupOpenCallback(callback);
......
...@@ -2,10 +2,12 @@ ...@@ -2,10 +2,12 @@
<body> <body>
<div style="width:100%; height:4em; overflow:scroll"> <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"> <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>
</div> </div>
<script> <script>
document.querySelector('input').reportValidity(); checkbox.reportValidity();
// To avoid flakiness of test about focused status of the element.
checkbox.focus();
</script> </script>
</body> </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