Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(116)

Unified Diff: remoting/webapp/unittests/apps_v2_migration_unittest.js

Issue 937593002: Changed identity API to use promises instead of callbacks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed bad merge Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: remoting/webapp/unittests/apps_v2_migration_unittest.js
diff --git a/remoting/webapp/unittests/apps_v2_migration_unittest.js b/remoting/webapp/unittests/apps_v2_migration_unittest.js
index 8ee2a3a0b8ef3b1e347241b008f75bf54d85be46..6bc8db9a2ca0703e8b04859489a1baabc989b1d4 100644
--- a/remoting/webapp/unittests/apps_v2_migration_unittest.js
+++ b/remoting/webapp/unittests/apps_v2_migration_unittest.js
@@ -26,13 +26,20 @@ function fail() {
* @param {boolean} v1HasHost
*/
function setMigrationData_(v1UserName, v1UserEmail, v1HasHosts) {
- remoting.identity.getUserInfo = function(onDone, onError) {
+ remoting.identity.getUserInfo = function() {
if (base.isAppsV2()) {
- onDone('v2user@gmail.com','v2userName');
+ return Promise.resolve(
+ {email: 'v2user@gmail.com', name: 'v2userName'});
} else {
- onDone(v1UserEmail, v1UserName);
+ return Promise.resolve(
+ {email: v1UserEmail, name: v1UserName});
}
};
+ remoting.identity.getEmail = function() {
+ return remoting.identity.getUserInfo().then(function(info) {
+ return info.email;
+ });
+ };
mockIsAppsV2.returns(false);
if (v1HasHosts) {
« no previous file with comments | « remoting/webapp/crd/js/wcs_sandbox_container.js ('k') | remoting/webapp/unittests/it2me_helpee_channel_unittest.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698