Added some more tests for checking the execution order of events (from last night's changes - routes around Chrome's busted object looping abilities).
This commit is contained in:
parent
e177465a6b
commit
104757705a
1 changed files with 20 additions and 0 deletions
|
@ -318,6 +318,26 @@ test("bind(), with same function", function() {
|
||||||
equals(count, 1, "Verify that removing events still work." );
|
equals(count, 1, "Verify that removing events still work." );
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("bind(), make sure order is maintained", function() {
|
||||||
|
expect(1);
|
||||||
|
|
||||||
|
var elem = jQuery("#firstp"), log = [], check = [];
|
||||||
|
|
||||||
|
for ( var i = 0; i < 100; i++ ) (function(i){
|
||||||
|
elem.bind( "click", function(){
|
||||||
|
log.push( i );
|
||||||
|
});
|
||||||
|
|
||||||
|
check.push( i );
|
||||||
|
})(i);
|
||||||
|
|
||||||
|
elem.trigger("click");
|
||||||
|
|
||||||
|
equals( log.join(","), check.join(","), "Make sure order was maintained." );
|
||||||
|
|
||||||
|
elem.unbind("click");
|
||||||
|
});
|
||||||
|
|
||||||
test("bind(), with different this object", function() {
|
test("bind(), with different this object", function() {
|
||||||
expect(4);
|
expect(4);
|
||||||
var thisObject = { myThis: true },
|
var thisObject = { myThis: true },
|
||||||
|
|
Loading…
Add table
Reference in a new issue