Making test-api.js compatible with xpcshell tests in mozilla-central