forked from YahooArchive/boomerang
-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request YahooArchive#47 from SOASTA/bug-92560
Fixes bug 92560, exclude list not honored in IE, reviewed by Nic
- Loading branch information
Showing
9 changed files
with
137 additions
and
33 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 +1 @@ | ||
[{"path":"00-basic","file":"00-onload"},{"path":"00-basic","file":"01-onunload"},{"path":"01-beacon-type","file":"00-resourcetiming-disabled"},{"path":"01-beacon-type","file":"01-resourcetiming-enabled-browser-supports"},{"path":"01-beacon-type","file":"02-resourcetiming-enabled-browser-unsupported"},{"path":"02-snippet","file":"00-snippet"},{"path":"03-load-order","file":"00-before-page-load"},{"path":"03-load-order","file":"01-after-page-load"},{"path":"03-load-order","file":"02-after-page-load-tag-manager"},{"path":"04-page-params","file":"00-custom-metrics"},{"path":"04-page-params","file":"01-page-group-order"},{"path":"04-page-params","file":"02-page-group-xhrs"},{"path":"04-page-params","file":"03-custom-dimensions-js"},{"path":"04-page-params","file":"04-custom-dimensions-cookies"},{"path":"06-bugs","file":"92542"}] | ||
[{"path":"00-basic","file":"00-onload"},{"path":"00-basic","file":"01-onunload"},{"path":"01-beacon-type","file":"00-resourcetiming-disabled"},{"path":"01-beacon-type","file":"01-resourcetiming-enabled-browser-supports"},{"path":"01-beacon-type","file":"02-resourcetiming-enabled-browser-unsupported"},{"path":"02-snippet","file":"00-snippet"},{"path":"03-load-order","file":"00-before-page-load"},{"path":"03-load-order","file":"01-after-page-load"},{"path":"03-load-order","file":"02-after-page-load-tag-manager"},{"path":"04-page-params","file":"00-custom-metrics"},{"path":"04-page-params","file":"01-page-group-order"},{"path":"04-page-params","file":"02-page-group-xhrs"},{"path":"04-page-params","file":"03-custom-dimensions-js"},{"path":"04-page-params","file":"04-custom-dimensions-cookies"},{"path":"06-bugs","file":"92542"},{"path":"06-bugs","file":"92560"}] |
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,37 @@ | ||
<%= header %> | ||
<!-- | ||
IE doesn't return a leading slash (/) on anchor.pathname, XHR exclude list was not being honored | ||
--> | ||
<script src="92560.js" type="text/javascript"></script> | ||
<%= boomerangSnippet %> | ||
<script> | ||
BOOMR_test.init({ | ||
"instrument_xhr": true, | ||
testAfterOnBeacon: 2, | ||
afterBoomerangLoad: | ||
function() { | ||
var xhrSent = false; | ||
BOOMR.xhr_excludes["/pages/06-bugs/support/script2.js"] = true; | ||
BOOMR.subscribe( | ||
"onbeacon", | ||
function() { | ||
if (xhrSent) { | ||
return; | ||
} | ||
xhrSent = true; | ||
|
||
var xhr; | ||
xhr = BOOMR.plugins.TestFramework.initXMLHttpRequest(); | ||
xhr.open("GET", "support/script1.js"); | ||
xhr.send(null); | ||
|
||
setTimeout(function(){ | ||
xhr = BOOMR.plugins.TestFramework.initXMLHttpRequest(); | ||
xhr.open("GET", "support/script2.js"); | ||
xhr.send(null); | ||
}, 500); | ||
}); | ||
} | ||
}); | ||
</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,10 @@ | ||
/*eslint-env mocha*/ | ||
/*global assert*/ | ||
|
||
describe("e2e/06-bugs/92560", function() { | ||
var tf = BOOMR.plugins.TestFramework; | ||
|
||
it("Should get 2 beacons: 1 onload, 1 xhr (2nd xhr should be excluded)", function() { | ||
assert.equal(tf.beaconCount(), 2); | ||
}); | ||
}); |
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,32 @@ | ||
/*eslint-env mocha*/ | ||
/*global chai*/ | ||
|
||
describe("BOOMR.plugins.AutoXHR", function() { | ||
var assert = chai.assert; | ||
|
||
describe("exports", function() { | ||
it("Should have a getPathname() function", function() { | ||
assert.isFunction(BOOMR.plugins.AutoXHR.getPathname); | ||
}); | ||
|
||
it("getPathname test", function() { | ||
var anchor = document.createElement("a"); | ||
function test(href, expected) { | ||
anchor.href = href; | ||
assert.equal( | ||
BOOMR.plugins.AutoXHR.getPathname(anchor), | ||
expected); | ||
} | ||
|
||
test("path/file.js", "/unit/path/file.js"); | ||
test("/path/file.js", "/path/file.js"); | ||
test("//path/file.js", "/file.js"); | ||
test("./path/file.js", "/unit/path/file.js"); | ||
test("../path/file.js", "/path/file.js"); | ||
test("#ref", "/unit/"); | ||
test("?val=1", "/unit/"); | ||
test("", "/unit/"); | ||
test("../../../../file.js", "/file.js"); | ||
}); | ||
}); | ||
}); |
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