Commit Graph

413 Commits

Author SHA1 Message Date
Atul Varma
90d243db16 Refactored test_service and module code so that the weave service constructor is called, and auth is done more accurately. 2008-06-17 19:54:09 -07:00
Atul Varma
945a8b782a The manage.py test-runner now compares expected results to actual results if a '<test-name>.log.expected' file exists in the test directory; if they don't match, a unified diff is displayed. Note that this is only done via manage.py, it's not currently implemented in the Makefile test framework because makefiles make me barf. 2008-06-17 12:04:40 -07:00
Atul Varma
a6cca49fc3 Added a fake preference service to test_service. 2008-06-17 11:45:13 -07:00
Atul Varma
6b20868829 Fixed a minor typo, though there's a better way to do the unary getter which Myk told me about; will probably substitute that soon. 2008-06-17 11:11:56 -07:00
Atul Varma
f9463209a2 Added a fixme/todo in the code. 2008-06-17 10:23:35 -07:00
Dan Mills
dec04b1bc3 merge upstream changes 2008-06-17 18:04:16 +09:00
Dan Mills
0c3a240876 make RemoteStore a but more Store-like (wrap, wipe methods); fix a missing yield 2008-06-17 18:03:02 +09:00
Dan Mills
5e07cb98d5 Don't allow re-entrance! Fail to lock when we already hold a lock. 2008-06-17 18:01:48 +09:00
Atul Varma
245e6492da Fixed a strict warning in util.js. 2008-06-16 18:11:41 -07:00
Atul Varma
b0ca747fe2 Added test_service, which currently tests the case in which the server's meta/version and private/privkey files are correct, as well as all authentication information. 2008-06-16 18:08:37 -07:00
Dan Mills
99e6994409 merge upstream changes 2008-06-17 09:51:25 +09:00
Dan Mills
5c196a641a treat paths beginning with '/' as absolute 2008-06-17 09:51:02 +09:00
Atul Varma
8d40fc280b Refactored test suites based on recent changes. 2008-06-16 16:53:53 -07:00
Atul Varma
459e94fa97 Factored out fake-timer code into a separate class and moved it to head.js. 2008-06-16 16:42:32 -07:00
Atul Varma
de38af3819 Refactored head.js for unit tests so that we now have an 'initTestLogging()' function. 2008-06-16 16:22:00 -07:00
Atul Varma
2675855ed4 Defined Cu -> Components.utils in head.js so that test files don't have to put it in as boilerplate. 2008-06-16 14:06:05 -07:00
Dan Mills
f8a841ee5e move more remote-interaction code into RemoteStore (and out of Engine) 2008-06-17 01:04:23 +09:00
Dan Mills
f74b9f910f catch 404s from initSession and do an initial upload; fix some bugs (missing yields, references to Engine properties) in RemoteStore.initialize 2008-06-16 00:21:44 +09:00
Dan Mills
a8ad7d2804 merge upstream changes 2008-06-15 13:42:10 +09:00
Dan Mills
561b27a92c merge upstream changes 2008-06-14 17:10:40 +09:00
Dan Mills
049ecf1de3 Move remote init code ('fullUpload') into RemoteStore; make RemoteStore hold an Engine object (tightly coupling them); make the server prefix and identity properties of Engine public 2008-06-14 17:07:06 +09:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
9805cdce23 Merged 2008-06-13 16:22:04 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
835100b96d Fixed some minor bugs -- the name of the incoming shared folder is parsed correctly, and xmppClient now catches bounce errors that were previously parsed as messages. 2008-06-13 16:20:43 -07:00
Atul Varma
92583fc5ff Fixed an 'outstanding callbacks' warning and simplified the code a tiny bit. 2008-06-13 15:39:06 -07:00
Myk Melez
b12f3d03db use nsIXMLHttpRequest::mozBackgroundRequest instead of DummyAuthProvider to suppress authentication dialogs and ensure XMLHttpRequests succeed even when the window that originated the request goes away 2008-06-13 13:08:36 -07:00
Dan Mills
589f3222eb To avoid some async.js warnings: Turn some 'yield' calls into 'return' ones, and don't call 'self.cb' twice in a row when constructing event listeners for XHRs. 2008-06-13 15:49:18 +09:00
Dan Mills
9812ba557e Make some 'debug' log calls into 'trace' ones. Use the frame formatter, which will remove long paths to extension dirs from the output. Don't warn about outstanding callbacks if we caught an exception from the generator. 2008-06-13 15:47:41 +09:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
5c8481de3d Merged 2008-06-12 17:35:57 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
c548d4b940 Made the initialization of the xmppClient an asynchronous call. This included modifying xmppClient.js so that connect() can be passed a callback function that will get called once the connection has succeeded or failed. For most of our purposes this is probably a better API than what we had before where you call waitForConnection() and it busy-waits until the connection has succeeded or failed. 2008-06-12 17:35:44 -07:00
Myk Melez
b4967c8831 work around XmlHttpRequest bug 317600 by pausing for a 0ms timeout before trying to log in 2008-06-12 16:23:59 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
b462aad4a5 Merged changes. 2008-06-12 14:30:46 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
2b055a3b87 Fixed the server URL for xmpp connections. 2008-06-12 14:30:39 -07:00
Myk Melez
18d8e8fcd7 bug 410550: stop running scheduled sync when the user is not logged into weave 2008-06-12 12:36:58 -07:00
Atul Varma
9d32240087 Changed some of the debug() logging statements I added a few commits ago into trace() statemetns b/c they were drowning the log. 2008-06-12 12:00:19 -07:00
Myk Melez
f47209b9d2 only retrieve score once per engine when doing a scheduled sync, since retrieving the score can be a non-negligible cost for trackers that calculate the score on-demand (like the tab tracker) 2008-06-11 20:07:35 -07:00
Myk Melez
669e57136f Automated merge with ssh://hg.mozilla.org/labs/weave/ 2008-06-11 20:00:59 -07:00
Myk Melez
5d50fffd37 don't sync tab entry IDs, which change with every session, to avoid generating edit commands for every tab on restart even when the tabs haven't actually changed 2008-06-11 20:00:48 -07:00
Atul Varma
4864f07ae2 async.js now keeps track of how many outstanding callbacks it has and uses this information to log warnings about coroutines that may have yielded without an outstanding callback, and coroutines that may have finished while a callback is still outstanding. These are merely 'warnings' rather than certainties because this code assumes that there is a 1:1 correspondence between accesses to self.cb and yields, and also that self.cb's are actually passed to asynchronous functions. It'd be really cool if we could actually keep track of whether a callback got garbage collected before it was called or something, though I don't know how much it'd help in the end. 2008-06-11 19:19:16 -07:00
Atul Varma
7d98a5dbeb Added a few log messages to hopefully make the debugging of generators easier. Also added an id component to generators, which is part of their name, to help distinguish between concurrent instances of the same generator function. The following debug output represents the new logging infomation:
--
Async.Generator	DEBUG	 runTestGenerator-0: self.cb generated at test_async_missing_yield.js:28
Async.Generator	DEBUG	 secondGen-1: self.cb generated at test_async_missing_yield.js:20
Async.Generator	DEBUG	 secondGen-1: done() called.
Async.Generator	DEBUG	 runTestGenerator-0: self.cb() called, resuming coroutine.
Async.Generator	DEBUG	 runTestGenerator-0: done() called.
Async.Generator	DEBUG	 secondGen-1: self.cb() called, resuming coroutine.
Async.Generator	DEBUG	 secondGen-1: done() called.
Async.Generator	ERROR	 Async method 'secondGen-1' is missing a 'yield' call (or called done() after being finalized)
--

As you can see, I've added log messages whenever the Generator's 'cb' property is accessed--this is almost guaranteed to be very close to a 'yield' statement, and therefore provides us with a decently accurate idea of where the generator 'stopped'.  We also log a message when the generator continues, and by doing so we get an idea of how the coroutines interleave.

Another idea I had was to actually match calls to self.cb with calls to 'yield' to automatically detect e.g. two yields in a row (which will ordinarily result in a generator 'hanging'), a generator exiting while a self.cb still hasn't been called, but I'm not sure what kinds of reprecussions it may have.
2008-06-11 18:58:30 -07:00
Myk Melez
a850ec7b70 numChanged should be the number of shared items whose data is different, not the same 2008-06-11 18:47:56 -07:00
Atul Varma
28a0971380 Merged changes. 2008-06-11 18:03:11 -07:00
Atul Varma
78c2bba04d Added test_async_missing_yield. It's very messy right now and duplicates code from other tests, but I've got some ideas about how to write better tests for async ops that I'll commit soon. 2008-06-11 18:02:46 -07:00
Maria Emerson
7da4259fee bug 438033: implement a better first-run wizard process; r=myk 2008-06-11 17:56:02 -07:00
Myk Melez
f9ef596828 Automated merge with ssh://hg.mozilla.org/labs/weave/ 2008-06-11 17:45:54 -07:00
Myk Melez
0a15090c8c bug 437529: yield after starting to put the status file to the server so we don't finalize the sync until the PUT request completes 2008-06-11 17:44:08 -07:00
Atul Varma
d32ba01952 Modified test_async_exceptions to use a fake nsiTimer. 2008-06-11 17:10:39 -07:00
Atul Varma
561d94aa66 Added a unit test for async exceptions. 2008-06-11 16:38:22 -07:00
jonathandicarlo@jonathan-dicarlos-macbook-pro.local
97f788bb51 Fixed Utils.prefs.getStringPref (should be getCharPref) 2008-06-11 15:43:12 -07:00
Myk Melez
8182b10abf resetting the score is not an asynchronous operation, so Service::_syncEngine shouldn't yield after calling it 2008-06-11 15:23:54 -07:00
Myk Melez
633afe0864 clarify wording in scheduled sync threshold debug statements 2008-06-11 14:16:03 -07:00