зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1673140 - Wait for screen coords to be ready in browser_datetime_datepicker.js. r=handyman
As per comments in the bug I never managed to reproduce this locally or in pernosco, but given the structure of the test (open tab, get element position, show picker, check picker position in screen coords), it makes some amount of sense that it could hit this race. I'm confirming on try that this reduces or fixes the intermittent race but given it's a oneliner I don't feel too bad sending it for review early :) Differential Revision: https://phabricator.services.mozilla.com/D145305
This commit is contained in:
Родитель
f3edc98c4b
Коммит
b8634fa5f9
|
@ -2245,12 +2245,12 @@ class SpecialPowersChild extends JSWindowActorChild {
|
|||
* we need to wait for the updated data.
|
||||
*/
|
||||
contentTransformsReceived(win) {
|
||||
try {
|
||||
// throw if win is not a remote browser.
|
||||
return win.docShell.browserChild.contentTransformsReceived();
|
||||
} catch (e) {
|
||||
return Promise.resolve();
|
||||
for (; win; win = win.parent) {
|
||||
if (win.docShell?.browserChild) {
|
||||
return win.docShell.browserChild.contentTransformsReceived();
|
||||
}
|
||||
}
|
||||
return Promise.resolve();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -200,6 +200,11 @@ class DateTimeTestHelper {
|
|||
});
|
||||
bc = bc.browsingContext.children[0];
|
||||
}
|
||||
await SpecialPowers.spawn(bc, [], async function() {
|
||||
// Ensure that screen coordinates are ok.
|
||||
await SpecialPowers.contentTransformsReceived(content);
|
||||
});
|
||||
|
||||
if (openMethod === "click") {
|
||||
await BrowserTestUtils.synthesizeMouseAtCenter("input", {}, bc);
|
||||
} else if (openMethod === "showPicker") {
|
||||
|
|
Загрузка…
Ссылка в новой задаче