| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 (function() { | 5 (function() { |
| 6 | 6 |
| 7 'use strict'; | 7 'use strict'; |
| 8 | 8 |
| 9 var testUsername = 'testUsername@gmail.com'; | 9 var testUsername = 'testUsername@gmail.com'; |
| 10 var testToken = 'testToken'; | 10 var testToken = 'testToken'; |
| (...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 sinon.assert.calledWith( | 131 sinon.assert.calledWith( |
| 132 sendMessage, | 132 sendMessage, |
| 133 '<stream:stream to="google.com" version="1.0" xmlns="jabber:client" ' + | 133 '<stream:stream to="google.com" version="1.0" xmlns="jabber:client" ' + |
| 134 'xmlns:stream="http://etherx.jabber.org/streams">' + | 134 'xmlns:stream="http://etherx.jabber.org/streams">' + |
| 135 '<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>'); | 135 '<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls"/>'); |
| 136 sendMessage_spy.reset(); | 136 sendMessage_spy.reset(); |
| 137 | 137 |
| 138 loginHandler.onDataReceived(base.encodeUtf8( | 138 loginHandler.onDataReceived(base.encodeUtf8( |
| 139 '<stream:stream from="google.com" id="78A87C70559EF28A" version="1.0" ' + | 139 '<stream:stream from="google.com" id="78A87C70559EF28A" version="1.0" ' + |
| 140 'xmlns:stream="http://etherx.jabber.org/streams"' + | 140 'xmlns:stream="http://etherx.jabber.org/streams" ' + |
| 141 'xmlns="jabber:client">' + | 141 'xmlns="jabber:client">' + |
| 142 '<stream:features>' + | 142 '<stream:features>' + |
| 143 '<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">' + | 143 '<starttls xmlns="urn:ietf:params:xml:ns:xmpp-tls">' + |
| 144 '<required/>' + | 144 '<required/>' + |
| 145 '</starttls>' + | 145 '</starttls>' + |
| 146 '<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">' + | 146 '<mechanisms xmlns="urn:ietf:params:xml:ns:xmpp-sasl">' + |
| 147 '<mechanism>X-OAUTH2</mechanism>' + | 147 '<mechanism>X-OAUTH2</mechanism>' + |
| 148 '<mechanism>X-GOOGLE-TOKEN</mechanism>' + | 148 '<mechanism>X-GOOGLE-TOKEN</mechanism>' + |
| 149 '</mechanisms>' + | 149 '</mechanisms>' + |
| 150 '</stream:features>')); | 150 '</stream:features>')); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 169 | 169 |
| 170 QUnit.test('should return UNEXPECTED error when failed to parse stream', | 170 QUnit.test('should return UNEXPECTED error when failed to parse stream', |
| 171 function() { | 171 function() { |
| 172 handshakeBase(); | 172 handshakeBase(); |
| 173 loginHandler.onDataReceived( | 173 loginHandler.onDataReceived( |
| 174 base.encodeUtf8('BAD DATA')); | 174 base.encodeUtf8('BAD DATA')); |
| 175 sinon.assert.calledWith(onError, remoting.Error.unexpected()); | 175 sinon.assert.calledWith(onError, remoting.Error.unexpected()); |
| 176 }); | 176 }); |
| 177 | 177 |
| 178 })(); | 178 })(); |
| OLD | NEW |