Skip to content

Commit

Permalink
Misc test framework fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
querymetrics authored and nicjansma committed Apr 4, 2018
1 parent 9f097ee commit d0b7382
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 28 deletions.
17 changes: 13 additions & 4 deletions tests/boomerang-test-framework.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,11 @@
});
}

// initialize boomerang
BOOMR.addVar("h.cr", "test");
BOOMR.init(config);
if (window.BOOMR_LOGN_always !== true) {
// initialize boomerang if LOGN is disabled
BOOMR.addVar("h.cr", "test");
BOOMR.init(config);
}

if (config.onBoomerangLoaded) {
config.onBoomerangLoaded();
Expand Down Expand Up @@ -267,7 +269,9 @@
};

t.isResourceTimingSupported = function() {
return (window.performance && typeof window.performance.getEntriesByType === "function");
return (window.performance &&
typeof window.performance.getEntriesByType === "function" &&
typeof window.PerformanceResourceTiming !== "undefined");
};

t.isServerTimingSupported = function() {
Expand All @@ -283,6 +287,7 @@
};

t.isUserTimingSupported = function() {
// don't check for PerformanceMark or PerformanceMeasure, they aren't polyfilled in usertiming.js
return (window.performance &&
typeof window.performance.getEntriesByType === "function" &&
typeof window.performance.mark === "function" &&
Expand Down Expand Up @@ -736,4 +741,8 @@

window.BOOMR_test = t;

// force LOGN plugin not to run. Individual tests will override this if needed.
// This only works if the test framework is loaded before boomerang
window.BOOMR_LOGN_always = false;

}(window));
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<%= header %>
<%= boomerangSnippet %>
<%= boomerangScript %> <!-- load bomerang sync so that we can check if AutoXHR is avail -->
<script src="33-xhr-filters-custom-context.js" type="text/javascript"></script>

<script type="text/javascript">
Expand Down Expand Up @@ -44,14 +44,13 @@
}
setTimeout(function() {
var xhr1 = new XMLHttpRequest();
xhr1.open("GET", "/pages/07-autoxhr/support/img.jpg");
xhr1.send(null);

xhr1.addEventListener("load", function() {
var xhr2 = new XMLHttpRequest();
xhr2.open("GET", "/pages/07-autoxhr/support/script200.js");
xhr2.send(null);
});
xhr1.open("GET", "/pages/07-autoxhr/support/img.jpg");
xhr1.send(null);
}, 100);
}
});
Expand Down
20 changes: 0 additions & 20 deletions tests/server/config/05-angular-103-96463.js

This file was deleted.

0 comments on commit d0b7382

Please sign in to comment.