Bug 1324135 - Wait 300ms after the first IntersectionObserver notification to prevent intermittent test failure, r=jet

This commit is contained in:
Tobias Schneider 2017-04-14 16:00:07 -07:00
Родитель 295baa4040
Коммит a61eaa4f23
1 изменённых файлов: 34 добавлений и 32 удалений

Просмотреть файл

@ -369,7 +369,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.display = 'none';
@ -379,7 +379,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(0);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.display = 'block';
@ -389,7 +389,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
rootEl.style.display = 'none';
@ -399,7 +399,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(0);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
rootEl.style.display = 'block';
@ -409,7 +409,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
], done);
});
@ -430,7 +430,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.left = '-40px';
@ -440,7 +440,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(0);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
parentEl.style.overflow = 'visible';
@ -450,7 +450,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
});
@ -471,7 +471,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be.greaterThan(0.5);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.left = '-15px';
@ -481,7 +481,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be.lessThan(0.5);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.left = '-25px';
@ -498,7 +498,7 @@ limitations under the License.
expect(records.length).to.be(1);
expect(records[0].intersectionRatio).to.be(0.5);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
@ -534,7 +534,7 @@ limitations under the License.
expect(records[1].target).to.be(targetEl2);
expect(records[1].intersectionRatio).to.be(0.75);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '0px';
@ -554,7 +554,7 @@ limitations under the License.
expect(records[2].target).to.be(targetEl3);
expect(records[2].intersectionRatio).to.be(0.25);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '0px';
@ -574,7 +574,7 @@ limitations under the License.
expect(records[2].target).to.be(targetEl3);
expect(records[2].intersectionRatio).to.be(0.75);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '0px';
@ -590,7 +590,7 @@ limitations under the License.
expect(records[0].target).to.be(targetEl3);
expect(records[0].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
});
@ -709,7 +709,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].target).to.be(targetEl2);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '0px';
@ -726,7 +726,7 @@ limitations under the License.
expect(records[1].intersectionRatio).to.be(0);
expect(records[1].target).to.be(targetEl2);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '-20px';
@ -740,7 +740,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].target).to.be(targetEl2);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl3.style.top = '20px';
@ -759,7 +759,7 @@ limitations under the License.
expect(records[1].intersectionRatio).to.be(0);
expect(records[1].target).to.be(targetEl4);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
@ -785,7 +785,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].isIntersecting).to.be.ok();
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
targetEl1.style.top = '-1px';
@ -795,7 +795,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].isIntersecting).to.be(false);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
});
@ -830,7 +830,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(1);
expect(records[0].target).to.be(targetEl1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
grandParentEl.remove();
@ -841,7 +841,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].target).to.be(targetEl1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
rootEl.appendChild(targetEl1);
@ -852,7 +852,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(1);
expect(records[0].target).to.be(targetEl1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
rootEl.remove();
@ -863,7 +863,7 @@ limitations under the License.
expect(records[0].intersectionRatio).to.be(0);
expect(records[0].target).to.be(targetEl1);
done();
}, ASYNC_TIMEOUT);
});
}
], done);
});
@ -918,10 +918,12 @@ limitations under the License.
io.observe(targetEl1);
io.observe(targetEl1);
spy.waitForNotification(function() {
callDelayed(function () {
expect(spy.callCount).to.be(1);
done();
}, ASYNC_TIMEOUT * 3);
}, ASYNC_TIMEOUT);
});
});
});
@ -1027,7 +1029,7 @@ limitations under the License.
expect(records[1].target).to.be(targetEl2);
expect(records[1].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
io.unobserve(targetEl1);
@ -1040,7 +1042,7 @@ limitations under the License.
expect(records[0].target).to.be(targetEl2);
expect(records[0].intersectionRatio).to.be(0);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
io.unobserve(targetEl2);
@ -1079,7 +1081,7 @@ limitations under the License.
expect(records[1].target).to.be(targetEl2);
expect(records[1].intersectionRatio).to.be(1);
done();
}, ASYNC_TIMEOUT);
});
},
function(done) {
io.disconnect();