Bug 1036198 - rejection not defined in _handleGetAssertionError. r=spenrose

This commit is contained in:
Jed Parsons 2014-07-08 18:00:25 -07:00
Родитель fb9054eae3
Коммит 013b94f495
2 изменённых файлов: 22 добавлений и 3 удалений

Просмотреть файл

@ -11,8 +11,11 @@ Cu.import("resource://services-common/utils.js");
Cu.import("resource://testing-common/httpd.js");
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsMgmtService",
"resource://gre/modules/FxAccountsMgmtService.jsm",
"FxAccountsMgmtService");
"resource://gre/modules/FxAccountsMgmtService.jsm",
"FxAccountsMgmtService");
XPCOMUtils.defineLazyModuleGetter(this, "FxAccountsManager",
"resource://gre/modules/FxAccountsManager.jsm");
// At end of test, restore original state
const ORIGINAL_AUTH_URI = Services.prefs.getCharPref("identity.fxaccounts.auth.uri");
@ -158,6 +161,22 @@ add_test(function test_invalidEmailCase_signIn() {
});
});
add_test(function testHandleGetAssertionError_defaultCase() {
do_test_pending();
FxAccountsManager.getAssertion(null).then(
success => {
// getAssertion should throw with invalid audience
ok(false);
},
reason => {
equal("INVALID_AUDIENCE", reason.error);
do_test_finished();
run_next_test();
}
)
});
// End of tests
// Utility functions follow

Просмотреть файл

@ -204,7 +204,7 @@ this.FxAccountsManager = {
}
);
}
return rejection;
return Promise.reject(reason);
},
_getAssertion: function(aAudience) {