| Index: chrome/content/tests/notification.js |
| =================================================================== |
| --- a/chrome/content/tests/notification.js |
| +++ b/chrome/content/tests/notification.js |
| @@ -33,6 +33,7 @@ |
| Prefs.notificationurl = "http://example.com/notification.json"; |
| Prefs.notificationdata = {}; |
| + Prefs.notifications_ignoredcategories = []; |
| // Replace Math.random() function |
| let DownloaderGlobal = Cu.getGlobalForObject(getModuleGlobal("downloader")); |
| @@ -376,6 +377,35 @@ |
| deepEqual(Notification.getNextToShow("http://www.example.com"), subdomainURLFilter, "URL-specific notification matches subdomain"); |
| }); |
| + test("Global opt-out", function() |
| + { |
| + Prefs.notifications_showui = false; |
| + |
| + Notification.toggleIgnoreCategory("*", true); |
| + |
| + ok(Prefs.notifications_showui, "Opt-out UI will be shown after opt-out"); |
| + |
| + let information = fixConstructors({ |
| + id: 1, |
| + type: "information" |
| + }); |
| + let critical = fixConstructors({ |
| + id: 2, |
| + type: "critical" |
| + }); |
| + |
| + registerHandler([information]); |
| + testRunner.runScheduledTasks(1); |
| + |
| + deepEqual(Notification.getNextToShow(), null, "Information notifications are ignored"); |
| + |
| + Prefs.notificationdata = {}; |
| + registerHandler([critical]); |
| + testRunner.runScheduledTasks(1); |
| + |
| + deepEqual(Notification.getNextToShow(), critical, "Critical notifications are not ignored"); |
|
Wladimir Palant
2015/05/26 11:23:19
This test is incomplete. Following scenarios need
Thomas Greiner
2015/05/28 13:24:18
Done, thanks for the additions.
Note that the exi
|
| + }); |
| + |
| module("Notification localization"); |
| test("Message without localization", function() |