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

Unified Diff: remoting/webapp/crd/js/xmpp_login_handler_unittest.js

Issue 1004513002: Eliminated named constants for instances of remoting.Error. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 9 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/crd/js/xmpp_login_handler_unittest.js
diff --git a/remoting/webapp/crd/js/xmpp_login_handler_unittest.js b/remoting/webapp/crd/js/xmpp_login_handler_unittest.js
index 14216512bdd615358e548ce21841e1e308edad93..dfd1a61a3eb18536736f6582779288d96d0c1282 100644
--- a/remoting/webapp/crd/js/xmpp_login_handler_unittest.js
+++ b/remoting/webapp/crd/js/xmpp_login_handler_unittest.js
@@ -162,7 +162,8 @@ test('should return AUTHENTICATION_FAILED error when failed to authenticate',
loginHandler.onDataReceived(
base.encodeUtf8('<failure xmlns="urn:ietf:params:xml:ns:xmpp-sasl">' +
'<not-authorized/></failure>'));
- sinon.assert.calledWith(onError, remoting.Error.AUTHENTICATION_FAILED);
+ sinon.assert.calledWith(onError, new remoting.Error(
+ remoting.Error.Tag.AUTHENTICATION_FAILED));
Jamie 2015/03/12 21:40:11 Does this work? Can calledWith match two error ins
John Williams 2015/03/13 00:26:35 The tests pass, so I assume this method is doing a
});
test('should return UNEXPECTED error when failed to parse stream',
@@ -170,7 +171,7 @@ test('should return UNEXPECTED error when failed to parse stream',
handshakeBase();
loginHandler.onDataReceived(
base.encodeUtf8('BAD DATA'));
- sinon.assert.calledWith(onError, remoting.Error.UNEXPECTED);
+ sinon.assert.calledWith(onError, remoting.Error.unexpected());
});
})();

Powered by Google App Engine
This is Rietveld 408576698