fix intermittent Option::unwrap in timers

not allow to fire timers installed during another timer call
This commit is contained in:
Aleksandr Likhanov 2015-12-02 02:09:50 +05:00
parent a8cbc28643
commit d891e75d9d
4 changed files with 55 additions and 8 deletions

View file

@ -5661,6 +5661,12 @@
"url": "/_mozilla/mozilla/textcontent.html"
}
],
"mozilla/timer_eventInvalidation.html": [
{
"path": "mozilla/timer_eventInvalidation.html",
"url": "/_mozilla/mozilla/timer_eventInvalidation.html"
}
],
"mozilla/title.html": [
{
"path": "mozilla/title.html",

View file

@ -0,0 +1,21 @@
<html>
<head>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<script>
async_test(function(test) {
// couldn't reproduce this behaviour without iframe
var iframe = document.createElement('iframe');
window.addEventListener('test_done', function() {
// if event invalidation is not properly implemented
// servo will crash during a short period of time
setTimeout(() => test.done(), 50);
}, false);
iframe.src = 'timer_eventInvalidation_test.html';
document.body.appendChild(iframe);
});
</script>
</body>
</html>

View file

@ -0,0 +1,14 @@
<html>
<head>
</head>
<body>
<script>
setTimeout(function() {
setTimeout(function() {
var e = new Event('test_done');
window.parent.dispatchEvent(e);
}, 0);
}, 0);
</script>
</body>
</html>