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.
ResourceTiming: Add iframe and subdocument to initiatorType
- Loading branch information
Showing
4 changed files
with
52 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<%= header %> | ||
<script src="../../vendor/resourcetiming-compression/src/resourcetiming-decompression.js" type="text/javascript"></script> | ||
<%= boomerangSnippet %> | ||
<script src="issue-606.js" type="text/javascript"></script> | ||
<link rel="stylesheet" href="support/09.css" /> | ||
<iframe src="support/92542-iframe.html"></iframe> | ||
<script> | ||
BOOMR_test.init({ | ||
testAfterOnBeacon: true, | ||
ResourceTiming: { | ||
enabled: true, | ||
trackedResourceTypes: ["css", "iframe", "subdocument"] | ||
} | ||
}); | ||
</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,29 @@ | ||
/*eslint-env mocha*/ | ||
/*global BOOMR_test,assert*/ | ||
|
||
describe("e2e/06-bug/issue-606", function() { | ||
var t = BOOMR_test; | ||
var tf = BOOMR.plugins.TestFramework; | ||
|
||
it("Should pass basic beacon validation", function(done) { | ||
t.validateBeaconWasSent(done); | ||
}); | ||
|
||
it("Should only have one iframe and one CSS in the filter (if ResourceTiming is supported)", function() { | ||
if (t.isResourceTimingSupported()) { | ||
var b = tf.lastBeacon(); | ||
|
||
var resources = ResourceTimingDecompression.decompressResources(JSON.parse(b.restiming)); | ||
|
||
assert.equal(resources.length, 2); | ||
|
||
// find our iframe | ||
assert.equal(resources[0].initiatorType, "other"); | ||
assert.include(resources[0].name, "support/92542-iframe.html"); | ||
|
||
// find our css | ||
assert.equal(resources[1].initiatorType, "css"); | ||
assert.include(resources[1].name, "support/img.jpg"); | ||
} | ||
}); | ||
}); |
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,3 @@ | ||
body { | ||
background-image: url("img.jpg") | ||
} |