forked from bluesmoon/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 294
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
01-beacon-type/04-send-beacon: Change how sendBeacon is detected
- Loading branch information
Showing
3 changed files
with
17 additions
and
21 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 |
---|---|---|
@@ -1,15 +1,16 @@ | ||
/*eslint-env mocha*/ | ||
/*global BOOMR_test*/ | ||
|
||
describe("e2e/01-beacon-type/00-resourcetiming-disabled", function() { | ||
it("Should send an beacon via navigator.sendBeacon if it is available", function(done) { | ||
describe("e2e/01-beacon-type/04-send-beacon", function() { | ||
it("Should send an beacon via navigator.sendBeacon if it is available", function() { | ||
if (window && window.navigator && typeof window.navigator.sendBeacon === "function") { | ||
// NOTE: Currently this doesn't work because the beacon isn't added to ResourceTiming in Chrome/Opera: | ||
// https://bugs.chromium.org/p/chromium/issues/detail?id=711060 | ||
// BOOMR_test.validateBeaconWasSendBeacon(done); | ||
assert.isDefined(window.sendBeaconUrl); | ||
assert.equal(window.sendBeaconUrl, BOOMR_test.BEACON_URL); | ||
|
||
assert.isDefined(window.sendBeaconData); | ||
} | ||
else { | ||
done(); | ||
this.skip(); | ||
} | ||
}); | ||
}); |