forked from bluesmoon/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 293
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
41 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<%= header %> | ||
<%= boomerangSnippet %> | ||
<script src="40-wrap-context.js" type="text/javascript"></script> | ||
<script> | ||
BOOMR_test.init({ | ||
testAfterOnBeacon: 1, | ||
Errors: { | ||
enabled: true, | ||
monitorEvents: true, | ||
sendAfterOnload: true | ||
} | ||
}); | ||
</script> | ||
<%= footer %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
/*eslint-env mocha*/ | ||
|
||
describe("e2e/14-errors/40-wrap-context", function() { | ||
it("Should infer BOOMR.window as context for unbound addEventListener calls", function(done) { | ||
if (typeof window.EventTarget === "undefined") { | ||
return this.skip(); | ||
} | ||
|
||
assert.equal(BOOMR.window, top); | ||
assert.equal(BOOMR.window, window.parent); | ||
(function(){ | ||
addEventListener("foo", function(){ | ||
// this assert is redundant, if we get our callback, it means it fired on the right window | ||
assert.equal(this, BOOMR.window); | ||
done(); | ||
}); | ||
this.dispatchEvent(new Event("foo")); | ||
}).apply(BOOMR.window); | ||
}); | ||
|
||
}); |