arlolra / ctypes-otr

js-ctypes wrapper for libotr
Mozilla Public License 2.0
29 stars 7 forks source link

add functions to libotr & otr #80

Closed vqhuy closed 8 years ago

arlolra commented 8 years ago

Thanks, I may try to do something about #78 first, so bear with me.

arlolra commented 8 years ago

I added the test harness is eb385719. You should be able to add some tests in addon/test/test-libotr.js for the libotr.js changes here. Don't worry about the otr.js stuff for now.

And let me know if that presents any problems. It's new, so likely some edges to be smoothed out.

arlolra commented 8 years ago

Should be able to test the otr.js stuff as well now ... and canonical testing is in test/ now. The addon/ directory is all symlinks.

vqhuy commented 8 years ago

I have some troubles in writing tests that call otr.generatePrivateKey, it seems like there is no ways to delay the execution until this function returns.

arlolra commented 8 years ago

You mean, since it's asynchronous? I think you just add a magic done argument.

See https://developer.mozilla.org/en-US/Add-ons/SDK/Low-Level_APIs/test_utils#Before_and_After

arlolra commented 8 years ago

I added a test to demonstrate in 529dee31c10c89513ba0ba6bbb477e28034728e8.

arlolra commented 8 years ago

Also, worth asking, how much of this stuff are you still using after the discussion in the email thread?

vqhuy commented 8 years ago

Also, worth asking, how much of this stuff are you still using after the discussion in the email thread?

For now, only otr. privateKeyFingerprintRaw and base64 encode & decode functions. Should I remove unused functions?

arlolra commented 8 years ago

Should I remove unused functions?

Yeah, let's keep it to what's being used.

vqhuy commented 8 years ago

Yeah, let's keep it to what's being used.

I updated it in 1cd138ec0d67005c992a4afe02561f6f1e167909. cc @arlolra

arlolra commented 8 years ago

I merged part of this in 8cd27e82c9a3836a210500df8256f31417a4cb4b, but I have some questions about the b64 stuff.

arlolra commented 8 years ago

I merged the b64 stuff in 50aeb2493906140f32f26ee1d58495214c9e02d3. Changed a few variable names and added some comments.

Thanks Huy!