Add spy on getComputedStyle()

This commit is contained in:
Gaël Métais
2015-03-20 11:30:20 +01:00
parent a6813a7ec1
commit 7b74df7f04
4 changed files with 46 additions and 6 deletions
@@ -323,6 +323,22 @@ exports.module = function(phantomas) {
phantomas.leaveContext();
});
phantomas.spy(window, 'getComputedStyle', function(element, pseudoElement) {
var target = phantomas.getDOMPath(element);
phantomas.enterContext({
type: 'getComputedStyle',
callDetails: {
arguments: [target, pseudoElement]
},
backtrace: phantomas.getBacktrace()
});
}, function(result, args) {
phantomas.leaveContext();
});
})(window.__phantomas);
});
});