mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 960762 - Fix intermittence of Notification mochitests. r=mhenretty
This commit is contained in:
parent
e1b7481efd
commit
8bf3c597f2
@ -384,7 +384,6 @@ NotificationObserver::Observe(nsISupports* aSubject, const char* aTopic,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!strcmp("alertclickcallback", aTopic)) {
|
if (!strcmp("alertclickcallback", aTopic)) {
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMEvent> event;
|
nsCOMPtr<nsIDOMEvent> event;
|
||||||
NS_NewDOMEvent(getter_AddRefs(event), mNotification, nullptr, nullptr);
|
NS_NewDOMEvent(getter_AddRefs(event), mNotification, nullptr, nullptr);
|
||||||
nsresult rv = event->InitEvent(NS_LITERAL_STRING("click"), false, true);
|
nsresult rv = event->InitEvent(NS_LITERAL_STRING("click"), false, true);
|
||||||
|
@ -6,9 +6,7 @@ support-files =
|
|||||||
|
|
||||||
[test_notification_basics.html]
|
[test_notification_basics.html]
|
||||||
[test_notification_storage.html]
|
[test_notification_storage.html]
|
||||||
skip-if = toolkit == 'android' || toolkit == 'gonk' #bug 960762
|
|
||||||
[test_bug931307.html]
|
[test_bug931307.html]
|
||||||
skip-if = (toolkit == 'gonk' && debug) #debug-only timeout
|
|
||||||
[test_notification_resend.html]
|
[test_notification_resend.html]
|
||||||
skip-if = e10s # On e10s, faking the app seems to be failing
|
skip-if = e10s # On e10s, faking the app seems to be failing
|
||||||
[test_notification_noresend.html]
|
[test_notification_noresend.html]
|
||||||
|
@ -17,15 +17,16 @@ var notification = new Notification("");
|
|||||||
var promise = Notification.get();
|
var promise = Notification.get();
|
||||||
promise.then(
|
promise.then(
|
||||||
function onSuccess() {
|
function onSuccess() {
|
||||||
ok(true, "No crash!");
|
ok(true, "No error when creating a notification without title");
|
||||||
notification.close();
|
|
||||||
SimpleTest.finish();
|
|
||||||
},
|
},
|
||||||
function onFailure() {
|
function onFailure() {
|
||||||
ok(false, "Should not get an error in promise callback");
|
ok(false, "Should not throw error when creating a notification without title");
|
||||||
notification.close();
|
|
||||||
}
|
}
|
||||||
);
|
).then(() => {
|
||||||
|
notification.close();
|
||||||
|
}).then(() => {
|
||||||
|
SimpleTest.finish();
|
||||||
|
});
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
</pre>
|
</pre>
|
||||||
|
@ -15,12 +15,13 @@
|
|||||||
|
|
||||||
SimpleTest.requestFlakyTimeout("untriaged");
|
SimpleTest.requestFlakyTimeout("untriaged");
|
||||||
|
|
||||||
function deleteAllNotifications() {
|
function deleteAllNotifications(done) {
|
||||||
var promise = Notification.get();
|
var promise = Notification.get();
|
||||||
promise.then(function (notifications) {
|
promise.then(function (notifications) {
|
||||||
notifications.forEach(function(notification) {
|
notifications.forEach(function(notification) {
|
||||||
notification.close();
|
notification.close();
|
||||||
});
|
});
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -120,10 +121,10 @@
|
|||||||
var promise = Notification.get();
|
var promise = Notification.get();
|
||||||
promise.then(function (notifications) {
|
promise.then(function (notifications) {
|
||||||
is(notifications.length, 3, "should return 3 notifications");
|
is(notifications.length, 3, "should return 3 notifications");
|
||||||
done();
|
|
||||||
n1.close();
|
n1.close();
|
||||||
n2.close();
|
n2.close();
|
||||||
n3.close();
|
n3.close();
|
||||||
|
done();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -134,13 +135,17 @@
|
|||||||
var n = new Notification("test-title" + Math.random());
|
var n = new Notification("test-title" + Math.random());
|
||||||
n.onclose = function() {
|
n.onclose = function() {
|
||||||
Notification.get().then(function(notifications) {
|
Notification.get().then(function(notifications) {
|
||||||
is(notifications.length, 0, "should return 0 notifications");
|
is(notifications.length, 0, "should return 0 notifications");
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
}
|
};
|
||||||
window.setTimeout(function() {
|
info("Installing 'onshow' for " + n.title);
|
||||||
|
n.onshow = function() {
|
||||||
|
info("Triggered 'onshow' for " + n.title);
|
||||||
|
window.setTimeout(function() {
|
||||||
NotificationTest.fireCloseEvent(n.title);
|
NotificationTest.fireCloseEvent(n.title);
|
||||||
}, 100);
|
}, 100);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user