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) { |