Fix tests in IE which doesn't support location.origin