Commit graph

6 commits

Author SHA1 Message Date
Matt Corallo
899d756469 Split tests between libtextsecure and main 2015-01-14 09:35:57 -10:00
Matt Corallo
2b0866ee1f Bring protocol_test back in-line with new APIs 2015-01-12 21:34:12 -10:00
lilia
4518d03f43 Move protocol test to end of suite and extend timeout
The keygen test works without native client, but it takes a loooooong
tiiiiiiime.
2014-11-09 19:20:33 -08:00
lilia
a1a528ccdd Finish abstracting native client
Firstly, don't initialize textsecure.nativclient unless the browser
supports it. The mimetype-check trick is hewn from nacl-common.js.

Secondly, nativeclient crypto functions will all automatically wait for
the module to load before sending messages, so we needn't register any
onload callbacks outside nativeclient.js. (Previously, if you wanted to
do crypto with native client, you would have to register a call back and
wait for the module to load.) Now that the native client crypto is
encapsulated behind a nice interface, it can handle all that
onload-callback jazz internally: if the module isn't loaded when you
call a nativeclient function, return a promise that waits for the load
callback, and eventually resolves with the result of the requested
command. This removes the need for textsecure.registerOnLoadCallback.

Finally, although native client has its quirks, it's significantly
faster than the alternative (emscripten compiled js), so this commit
also lets the crypto backend use native client opportunistically, if
it's available, falling back to js if not, which should make us
compatible with older versions of chrome and chromium.
2014-11-09 15:23:23 -08:00
lilia
7c25ff845b Simplify a test
Protobufs are loaded already
2014-11-06 18:34:08 -08:00
lilia
df0e52a893 Split crypto_test into crypto, protocol and helpers tests 2014-11-06 14:33:16 -08:00