diff options
author | jeresig <jeresig@gmail.com> | 2010-02-04 09:23:50 -0500 |
---|---|---|
committer | jeresig <jeresig@gmail.com> | 2010-02-04 09:23:50 -0500 |
commit | 104757705a19df3b6b9750aaef30aa451082f825 (patch) | |
tree | e14f7285d0e019f68d1b7dbbddc55240f0b0d9d0 /test | |
parent | e177465a6b65aecbb87486f6243410ffabfe14b7 (diff) | |
download | jquery-104757705a19df3b6b9750aaef30aa451082f825.tar.gz jquery-104757705a19df3b6b9750aaef30aa451082f825.zip |
Added some more tests for checking the execution order of events (from last night's changes - routes around Chrome's busted object looping abilities).
Diffstat (limited to 'test')
-rw-r--r-- | test/unit/event.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/test/unit/event.js b/test/unit/event.js index 9ce6e2f6b..2937b1c02 100644 --- a/test/unit/event.js +++ b/test/unit/event.js @@ -317,6 +317,26 @@ test("bind(), with same function", function() { 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() { expect(4); |