This commit is contained in:
Atul Varma 2008-06-26 16:28:55 -07:00
Родитель f07cb3970d d80752f41a
Коммит 361206ff0d
3 изменённых файлов: 112 добавлений и 1 удалений

Просмотреть файл

@ -168,7 +168,8 @@ SnapshotStore.prototype = {
delete this._data[oldGUID]; delete this._data[oldGUID];
for (let GUID in this._data) { for (let GUID in this._data) {
if (this._data[GUID].parentGUID == oldGUID) if (("parentGUID" in this._data[GUID]) &&
(this._data[GUID].parentGUID == oldGUID))
this._data[GUID].parentGUID = newGUID; this._data[GUID].parentGUID = newGUID;
} }
} }

Просмотреть файл

@ -74,9 +74,30 @@ function run_test() {
syncTesting.doSync("add bookmark on second computer and resync"); syncTesting.doSync("add bookmark on second computer and resync");
syncTesting.saveClientState("second computer");
syncTesting.restoreClientState("first computer"); syncTesting.restoreClientState("first computer");
syncTesting.doSync("re-sync on first computer"); syncTesting.doSync("re-sync on first computer");
let binkBm1 = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.bink.com"),
-1,
"Bink");
bms.setItemGUID(binkBm1, "bink-bookmark-guid-1");
syncTesting.doSync("add bookmark 'bink' on first computer and resync");
syncTesting.restoreClientState("second computer");
let binkBm2 = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.bink.com"),
-1,
"Bink");
bms.setItemGUID(binkBm2, "bink-bookmark-guid-2");
syncTesting.doSync("Manually add same bookmark 'bink', but with " +
+ "different GUID, to second computer and resync");
// -------- // --------
// Teardown // Teardown
// -------- // --------

Просмотреть файл

@ -263,6 +263,95 @@ Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine DEBUG Actual changes for server: [] Service.BmkEngine DEBUG Actual changes for server: []
Service.BmkEngine INFO Sync complete Service.BmkEngine INFO Sync complete
Testing INFO Step 're-sync on first computer' succeeded. Testing INFO Step 're-sync on first computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add bookmark 'bink' on first computer and resync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 3
Service.BmkEngine INFO Server maxVersion: 3
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 1 against 0 commands
Service.BmkEngine INFO Changes for client: 0
Service.BmkEngine INFO Predicted changes for server: 1
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Actual changes for server: 1
Service.BmkEngine DEBUG Actual changes for server: [{"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}]
Service.BmkEngine INFO Uploading changes to server
Service.JsonFilter DEBUG Encoding data as JSON
Service.CryptoFilter DEBUG Encrypting data
Service.Crypto DEBUG NOT encrypting data
Testing INFO HTTP PUT to user-data/bookmarks/deltas/4 with data: [{"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/bookmarks/status.json with data: {"GUID":"fake-guid-0","formatVersion":2,"snapVersion":0,"maxVersion":4,"snapEncryption":"none","deltasEncryption":"none","itemCount":7}
Service.Resource DEBUG PUT request successful
Service.BmkEngine INFO Successfully updated deltas and status on server
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":4,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null},"bink-bookmark-guid-1":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'add bookmark 'bink' on first computer and resync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'restore client state of second computer' starting.
Testing INFO -----------------------------------------
Service.BStore TRACE Processing command: {"action":"create","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Yoogle"
Service.BStore TRACE Processing command: {"action":"create","GUID":"boogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Boogle"
Service.BStore TRACE Processing command: {"action":"create","GUID":"zoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}
Service.BStore DEBUG -> creating bookmark "Zoogle"
Testing INFO Step 'restore client state of second computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'Manually add same bookmark 'bink', but with NaN' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/bookmarks.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.BmkEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/bookmarks/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/bookmarks/status.json, returning status 200
Service.Resource DEBUG GET request successful
Service.JsonFilter DEBUG Decoding JSON data
Service.RemoteStore DEBUG Downloading status file... done
Service.BmkEngine INFO Local snapshot version: 3
Service.BmkEngine INFO Server maxVersion: 4
Service.RemoteStore DEBUG Using last sync snapshot as starting point for server snapshot
Service.RemoteStore INFO Downloading server deltas
Testing INFO HTTP GET from user-data/bookmarks/deltas/4, returning status 200
Service.ResourceSet DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"bink-bookmark-guid-1","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 1 against 1 commands
Service.BmkEngine INFO Changes for client: 1
Service.BmkEngine INFO Predicted changes for server: 0
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Applying changes locally
Service.SnapStore TRACE Processing command: {"action":"edit","GUID":"bink-bookmark-guid-2","data":{"GUID":"bink-bookmark-guid-1"}}
Service.BStore TRACE Processing command: {"action":"edit","GUID":"bink-bookmark-guid-2","data":{"GUID":"bink-bookmark-guid-1"}}
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/bookmarks.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/bookmarks.json': {"version":4,"GUID":"fake-guid-0","snapshot":{"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"},"bink-bookmark-guid-1":{"parentGUID":"menu","index":3,"type":"bookmark","title":"Bink","URI":"http://www.bink.com/","tags":[],"keyword":null}}}
Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine DEBUG Actual changes for server: []
Service.BmkEngine INFO Sync complete
Testing INFO Step 'Manually add same bookmark 'bink', but with NaN' succeeded.
*** test finished *** test finished
*** exiting *** exiting
*** PASS *** *** PASS ***