Emulation settings are overridden on context creation when applying multiple emulations at once
Categories
(Remote Protocol :: WebDriver BiDi, defect, P2)
Tracking
(firefox-esr140 unaffected, firefox144 unaffected, firefox145 unaffected, firefox146 fixed)
| Tracking | Status | |
|---|---|---|
| firefox-esr140 | --- | unaffected |
| firefox144 | --- | unaffected |
| firefox145 | --- | unaffected |
| firefox146 | --- | fixed |
People
(Reporter: hbenl, Assigned: Sasha)
References
(Blocks 1 open bug, Regression)
Details
(Keywords: regression, Whiteboard: [webdriver:m18], [wptsync upstream])
Attachments
(2 files)
This Playwright test recently started failing. It evaluates new Date(1479579154987).toString() which returns "Sat Nov 19 2016 19:12:34 GMT+0100 (Central European Standard Time)" instead of the expected "Sat Nov 19 2016 19:12:34 GMT+0100 (Mitteleuropäische Normalzeit)". I verified that it was regressed by Bug 1988725.
Interestingly the Playwright test passes when I remove the timezoneId from it.
I was unable to reproduce the issue without Playwright (i.e. in a wdspec test) so far.
Comment 1•3 months ago
|
||
Set release status flags based on info from the regressing bug 1988725
:Sasha, since you are the author of the regressor, bug 1988725, could you take a look? Also, could you set the severity field?
For more information, please visit BugBot documentation.
| Assignee | ||
Updated•3 months ago
|
| Assignee | ||
Comment 2•3 months ago
|
||
Ok, I could reproduce it. The issue happens when we set multiple emulation at once, like in this case locale and timezone, so then when they're applied on the browser context creation timezone overrides locale (that's why removing timezone ID resolves the issue). The fix is coming.
| Reporter | ||
Comment 3•3 months ago
|
||
FWIW, this test reproduces it:
async def test_locale_affects_date_formatting(bidi_session, create_user_context, get_current_locale, some_locale):
user_context = await create_user_context()
await bidi_session.emulation.set_locale_override(
user_contexts=[user_context],
locale=some_locale
)
await bidi_session.emulation.set_timezone_override(
user_contexts=[user_context],
timezone="Europe/Berlin"
)
context_in_user_context = await bidi_session.browsing_context.create(
user_context=user_context, type_hint="tab"
)
formatted_date = await bidi_session.script.evaluate(
expression="new Date(1479579154987).toString()",
target=ContextTarget(context_in_user_context["context"]),
await_promise=False,
)
assert formatted_date["value"] == "Sat Nov 19 2016 19:12:34 GMT+0100 (Mitteleuropäische Normalzeit)"
This test passes if I remove the timezone override or if I move browsing_context.create up before emulation.set_locale_override.
| Assignee | ||
Comment 4•3 months ago
|
||
| Assignee | ||
Comment 5•3 months ago
|
||
| Assignee | ||
Updated•3 months ago
|
Comment 8•3 months ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/798ce7663725
https://hg.mozilla.org/mozilla-central/rev/a15226bdc709
Description
•