Closed Bug 1640744 Opened 5 years ago Closed 5 years ago

Modernize and re-enable browser_notification_do_not_disturb.js

Categories

(Toolkit Graveyard :: Notifications and Alerts, task, P1)

Tracking

(firefox78 fixed)

RESOLVED FIXED
mozilla78
Tracking Status
firefox78 --- fixed

People

(Reporter: mconley, Assigned: mconley)

References

Details

Attachments

(2 files)

This was disabled via bug 1352791 for failing periodically. I'm going to try to get this re-enabled.

Attachment #9151594 - Attachment description: Bug 1640744 - [WIP] Modernize and re-enable the browser_notification_do_not_disturb.js test. r?MattN! → Bug 1640744 - Modernize and re-enable the browser_notification_do_not_disturb.js test. r?MattN!

Thanks for taking this!

Severity: -- → N/A
Status: NEW → ASSIGNED
Priority: -- → P1
Pushed by mconley@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/9c7d3f6a68bf Make sure we can send all notifications while testing on Windows, regardless of OS state. r=MattN https://hg.mozilla.org/integration/autoland/rev/a0a1d1b45d0d Modernize and re-enable the browser_notification_do_not_disturb.js test. r=MattN
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla78

For the code archeologists from the future who might want to know why it was necessary to add the if (!xpc::IsInAutomation()) { condition around the QUERY_USER_NOTIFICATION_STATE qstate; in nsAlertsService.cpp: the qstate was sometimes QUNS_QUIET_TIME, at least according to my testing. Here's the documentation on QUNS_QUIET_TIME:

Introduced in Windows 7. The current user is in "quiet time", which is the first hour after a new user logs into his or her account for the first time. During this time, most notifications should not be sent or shown. This lets a user become accustomed to a new computer system without those distractions. Quiet time also occurs for each user after an operating system upgrade or clean installation.

Applications should set the NIIF_RESPECT_QUIET_TIME flag in their notifications or balloon tooltip, which prevents those items from being displayed while the current user is in the quiet-time state.

Note that during quiet time, if the user is in one of the other blocked modes (QUNS_NOT_PRESENT, QUNS_BUSY, QUNS_PRESENTATION_MODE, or QUNS_RUNNING_D3D_FULL_SCREEN) SHQueryUserNotificationState returns only that value, and does not report QUNS_QUIET_TIME.

From https://docs.microsoft.com/en-us/windows/win32/api/shellapi/ne-shellapi-query_user_notification_state

That would make sense since I believe we now use a new OS account for each test run and therefore "the first hour after a new user logs into his or her account for the first time" would apply.

Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: