Skip to content

Commit

Permalink
failing test for clearInterval/clearTimeout which should not throw ex…
Browse files Browse the repository at this point in the history
…ceptions with invalid timers
  • Loading branch information
Justin Tulloss committed Dec 21, 2011
1 parent db76ccf commit 8da950c
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions spec/eventloop_spec.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ Vows.describe("EventLoop").addBatch(
browser.wait 300, @callback
"should fire only uncancelled timeout events": (browser)->
assert.equal browser.document.title, "One Two"
"should not choke on invalid timers": (browser)->
assert.doesNotThrow ->
# clearTimeout should not choke when clearing an invalid timer
# https://developer.mozilla.org/en/DOM/window.clearTimeout
browser.window.clearTimeout undefined

"outside wait":
Browser.wants "http://localhost:3003/eventloop/timeout"
Expand Down Expand Up @@ -119,6 +124,10 @@ Vows.describe("EventLoop").addBatch(
browser.wait 200, @callback
"should fire only uncancelled interval events": (browser)->
assert.equal browser.document.title, ".."
"should not throw an exception with invalid interval": (browser)->
assert.doesNotThrow ->
# clearInterval should not choke on invalid interval
browser.window.clearInterval undefined

"outside wait":
Browser.wants "http://localhost:3003/eventloop/interval"
Expand Down

0 comments on commit 8da950c

Please sign in to comment.