Skip to content

Commit

Permalink
Fix nativeMethods.performanceNow in IE9 (closes #670) (#671)
Browse files Browse the repository at this point in the history
* fix nativeMethods.performanceNow in IE9 (closes #670)

* Bump version

* small test refactoring
  • Loading branch information
AlexanderMoskovkin authored and churkin committed Jul 8, 2016
1 parent 6de3e57 commit a81c7cc
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "testcafe-hammerhead",
"description": "A powerful web-proxy used as a core for the TestCafe testing framework (https://github.com/DevExpress/testcafe).",
"version": "9.3.0",
"version": "9.3.1",
"homepage": "https://github.com/DevExpress/testcafe-hammerhead",
"bugs": {
"url": "https://github.com/DevExpress/testcafe-hammerhead/issues"
Expand Down
3 changes: 2 additions & 1 deletion src/client/sandbox/native-methods.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ class NativeMethods {
var nativePerformance = win.performance;
var nativePerformanceNow = win.performance.now || win.Performance.prototype.now;

this.performanceNow = (...args) => nativePerformanceNow.apply(nativePerformance, args);
if (nativePerformanceNow)
this.performanceNow = (...args) => nativePerformanceNow.apply(nativePerformance, args);
}

// Fetch
Expand Down
9 changes: 9 additions & 0 deletions test/client/fixtures/sandbox/native-methods-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
var nativeMethods = hammerhead.nativeMethods;

if (nativeMethods.performanceNow) {
test('performanceNow', function () {
var now = nativeMethods.performanceNow();

ok(!isNaN(parseFloat(now)));
});
}

0 comments on commit a81c7cc

Please sign in to comment.