Bug 573015 - Get rid of 'attic' and 'need-work' tests [r=mconnor]

This commit is contained in:
Philipp von Weitershausen 2010-06-18 09:39:03 -07:00
Родитель 52ec13eb30
Коммит fc5e76f590
16 изменённых файлов: 0 добавлений и 1439 удалений

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

@ -1,121 +0,0 @@
Cu.import("resource://services-sync/async.js");
Cu.import("resource://services-sync/engines/bookmarks.js");
Cu.import("resource://services-sync/sharing.js");
Cu.import("resource://services-sync/util.js");
Function.prototype.async = Async.sugar;
load("bookmark_setup.js");
function FakeMicrosummaryService() {
return {hasMicrosummary: function() { return false; }};
}
function FakeAnnotationService() {
this._annotations = {};
}
FakeAnnotationService.prototype = {
EXPIRE_NEVER: 0,
getItemAnnotation: function (aItemId, aName) {
if (this._annotations[aItemId] != undefined)
if (this._annotations[aItemId][aName])
return this._annotations[aItemId][aName];
return null;
},
setItemAnnotation: function (aItemId, aName, aValue, aFlags, aExpiration) {
if (this._annotations[aItemId] == undefined)
this._annotations[aItemId] = {};
this._annotations[aItemId][aName] = aValue;
dump( "Annotated item " + aItemId + " with " + aName + " = " + aValue + "\n");
//ignore flags and expiration
},
getItemsWithAnnotation: function(aName, resultCount, results) {
var list = [];
for ( var x in this._annotations) {
if (this._annotations[x][aName] != undefined) {
return x;
}
}
return list;
}
}
function FakeSharingApi() {
}
FakeSharingApi.prototype = {
shareWithUsers: function FakeSharingApi_shareWith(path, users, onComplete) {
// TODO just set a flag on the fake DAV thing.
}
}
Sharing.Api = FakeSharingApi;
var annoSvc = new FakeAnnotationService();
function makeBookmarksEngine() {
let engine = new BookmarksEngine();
engine._store.__ms = new FakeMicrosummaryService();
let shareManager = engine._sharing;
shareManager.__annoSvc = annoSvc; // use fake annotation service
return engine;
}
function run_test() {
let bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
var syncTesting = new SyncTestingInfrastructure( makeBookmarksEngine );
let folderName = "Funny Pictures of Manatees and Walruses";
let folderToShare = bms.createFolder( bms.bookmarksMenuFolder,
folderName, -1 );
let lolrusBm = bms.insertBookmark(folderToShare,
uri("http://www.lolrus.com"),
-1, "LOLrus" );
let lolateeBm = bms.insertBookmark(folderToShare,
uri("http://www.lolatee.com"),
-1, "LOLatee" );
// Note xmpp.enabled is set to false by the SyncTestingInfrastructure.
let username = "rusty";
let engine = makeBookmarksEngine();
let shareManager = engine._sharing;
function setupShare(cb) {
// TODO: Passing in folderToShare won't work at the time of writing
// this because folderToShare is expected to be a DOM node, not a
// Places ID.
shareManager._share.async( shareManager, cb, folderToShare, "jonas" );
}
/*
syncTesting.runAsyncFunc("Share folder with Jonas", setupShare);
dump( "folderToShare = " + folderToShare + "\n");
// Get the server path from folder annotation...
let serverPath = annoSvc.getItemAnnotation( folderToShare,
"weave/shared-server-path" );
dump( "Shared it to server path " + serverPath + "\n");
// get off rusty's computer, switch to Jonas's computer:
syncTesting.saveClientState( "rusty computer 1" );
syncTesting.resetClientState();
// These next two lines simulate what would happen when jonas received
// the xmpp message and clicked "accept".
shareManager._createIncomingShare(username, serverPath, folderName);
shareManager._updateAllIncomingShares();
// now look for a bookmark folder with an incoming-share annotation
let a = annoSvc.getItemsWithAnnotation("weave/shared-incoming",
{});
do_check_eq( a.length, 1); // should be just one
// TODO next look at its children:
*/
}

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

@ -1,29 +0,0 @@
Cu.import("resource://services-sync/identity.js");
Cu.import("resource://services-sync/sharing.js");
Cu.import("resource://services-sync/util.js");
function runTestGenerator() {
let self = yield;
ID.set("blarg", new Identity("realm", "myusername", "mypass"));
let fakeDav = {
identity: "blarg",
POST: function fakeDav_POST(url, data, callback) {
do_check_true(data.indexOf("uid=myusername") != -1);
do_check_true(data.indexOf("password=mypass") != -1);
do_check_true(data.indexOf("/fake/dir") != -1);
do_check_true(data.indexOf("johndoe") != -1);
let result = {status: 200, responseText: "OK"};
Utils.makeTimerForCall(function() { callback(result); });
}
};
let api = new Sharing.Api(fakeDav);
api.shareWithUsers("/fake/dir", ["johndoe"], self.cb);
let result = yield;
do_check_eq(result.wasSuccessful, true);
self.done();
}
var run_test = makeAsyncTestRunner(runTestGenerator);

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

@ -1,104 +0,0 @@
Cu.import( "resource://services-sync/xmpp/xmppClient.js" );
function LOG(aMsg) {
dump("TEST_XMPP: " + aMsg + "\n");
}
var serverUrl = "http://localhost:5280/http-poll";
var jabberDomain = "localhost";
var timer = Cc["@mozilla.org/timer;1"].createInstance( Ci.nsITimer );
var threadManager = Cc["@mozilla.org/thread-manager;1"].getService();
function run_test() {
// FIXME: this test hangs when you don't have a server, disabling for now
return;
/* First, just see if we can connect: */
var transport = new HTTPPollingTransport(serverUrl, false, 4000);
var auth = new PlainAuthenticator();
var alice = new XmppClient("alice", jabberDomain, "iamalice",
transport, auth);
// test connection
LOG("connecting");
alice.connect( jabberDomain );
alice.waitForConnection();
do_check_eq( alice._connectionStatus, alice.CONNECTED);
LOG("connected");
// test disconnection
LOG("disconnecting");
alice.disconnect();
do_check_eq( alice._connectionStatus, alice.NOT_CONNECTED);
LOG("disconnected");
// test re-connection
LOG("reconnecting");
alice.connect( jabberDomain );
alice.waitForConnection();
LOG("reconnected");
do_check_eq( alice._connectionStatus, alice.CONNECTED);
alice.disconnect();
// test connection failure - bad domain
alice.connect( "bad domain" );
alice.waitForConnection();
do_check_eq( alice._connectionStatus, alice.FAILED );
/*
// re-connect and move on
alice.connect( jabberDomain );
alice.waitForConnection();
do_check_eq( alice._connectionStatus, alice.CONNECTED);
// The talking-to-myself test:
var testIsOver = false;
var sometext = "bla bla how you doin bla";
var transport2 = new HTTPPollingTransport( serverUrl, false, 4000 );
var auth2 = new PlainAuthenticator();
var bob = new XmppClient( "bob", jabberDomain, "iambob", transport2, auth2 );
// Timer that will make the test fail if message is not received after
// a certain amount of time
var timerResponder = {
notify: function( timer ) {
testIsOver = true;
do_throw( "Timed out waiting for message." );
}
};
timer.initWithCallback( timerResponder, 20000, timer.TYPE_ONE_SHOT );
// Handler that listens for the incoming message:
var aliceMessageHandler = {
handle: function( msgText, from ) {
dump( "Alice got a message.\n" );
do_check_eq( msgText, sometext );
do_check_eq( from, "bob@" + jabberDomain );
timer.cancel();
testIsOver = true;
}
};
alice.registerMessageHandler( aliceMessageHandler );
// Start both clients
bob.connect( jabberDomain );
bob.waitForConnection();
do_check_neq( bob._connectionStatus, bob.FAILED );
alice.connect( jabberDomain );
alice.waitForConnection();
do_check_neq( alice._connectionStatus, alice.FAILED );
// Send the message
bob.sendMessage( "alice@" + jabberDomain, sometext );
// Wait until either the message is received, or the timeout expires.
var currentThread = threadManager.currentThread;
while( !testIsOver ) {
currentThread.processNextEvent( true );
}
alice.disconnect();
bob.disconnect();
*/
};

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

@ -1,71 +0,0 @@
function LOG(aMsg) {
dump("TEST_XMPP_SIMPLE: " + aMsg + "\n");
}
Components.utils.import( "resource://services-sync/xmpp/xmppClient.js" );
var serverUrl = "http://localhost:5280/http-poll";
var jabberDomain = "localhost";
function run_test() {
// FIXME: this test hangs when you don't have a server, disabling for now
return;
// async test
do_test_pending();
var testMessage = "Hello Bob.";
var aliceHandler = {
handle: function(msgText, from) {
LOG("ALICE RCVD from " + from + ": " + msgText);
}
};
var aliceClient = getClientForUser("alice", "iamalice", aliceHandler);
var bobHandler = {
handle: function(msgText, from) {
LOG("BOB RCVD from " + from + ": " + msgText);
do_check_eq(from.split("/")[0], "alice@" + jabberDomain);
do_check_eq(msgText, testMessage);
LOG("messages checked out");
aliceClient.disconnect();
bobClient.disconnect();
LOG("disconnected");
do_test_finished();
}
};
var bobClient = getClientForUser("bob", "iambob", bobHandler);
bobClient.announcePresence();
// Send a message
aliceClient.sendMessage("bob@" + jabberDomain, testMessage);
}
function getClientForUser(aName, aPassword, aHandler) {
// "false" tells the transport not to use session keys. 4000 is the number of
// milliseconds to wait between attempts to poll the server.
var transport = new HTTPPollingTransport(serverUrl, false, 4000);
var auth = new PlainAuthenticator();
var client = new XmppClient(aName, jabberDomain, aPassword,
transport, auth);
client.registerMessageHandler(aHandler);
// Connect
client.connect(jabberDomain);
client.waitForConnection();
// this will block until our connection attempt has either succeeded or failed.
// Check if connection succeeded:
if ( client._connectionStatus == client.FAILED ) {
do_throw("connection failed");
}
return client;
}

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

@ -1,55 +0,0 @@
function LOG(aMsg) {
dump("TEST_XMPP_TRANSPORT_HTTP: " + aMsg + "\n");
}
Components.utils.import( "resource://services-sync/xmpp/xmppClient.js" );
var tests = [];
// test connection failure - no server
tests.push(function run_test_bad_server() {
LOG("starting test: bad server");
var transport = new HTTPPollingTransport("this is not a server URL", false, 4000);
transport.connect();
transport.setCallbackObject({
onIncomingData: function(aData) {
do_throw("onIncomingData was called instead of onTransportError, for a bad URL");
},
onTransportError: function(aErrorMessage) {
do_check_true(/^Unable to send message to server:/.test(aErrorMessage));
// continue test suite
tests.shift()();
}
});
transport.send();
});
tests.push(function run_test_bad_url() {
LOG("starting test: bad url");
// test connection failure - server up, bad URL
var serverUrl = "http://localhost:5280/http-polly-want-a-cracker";
var transport = new HTTPPollingTransport(serverUrl, false, 4000);
transport.connect();
transport.setCallbackObject({
onIncomingData: function(aData) {
do_throw("onIncomingData was called instead of onTransportError, for a bad URL");
},
onTransportError: function(aErrorMessage) {
LOG("ERROR: " + aErrorMessage);
do_check_true(/^Provided URL is not valid./.test(aErrorMessage));
do_test_finished();
}
});
transport.send();
});
function run_test() {
// FIXME: this test hangs when you don't have a server, disabling for now
return;
// async test
do_test_pending();
tests.shift()();
}

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

@ -1,131 +0,0 @@
Cu.import("resource://services-sync/async.js");
Cu.import("resource://services-sync/engines/bookmarks.js");
Cu.import("resource://services-sync/util.js");
Function.prototype.async = Async.sugar;
load("bookmark_setup.js");
// ----------------------------------------
// Test Logic
// ----------------------------------------
function FakeMicrosummaryService() {
return {hasMicrosummary: function() { return false; }};
}
function makeBookmarksEngine() {
let engine = new BookmarksEngine();
engine._store.__ms = new FakeMicrosummaryService();
return engine;
}
function run_test() {
// -----
// Setup
// -----
var syncTesting = new SyncTestingInfrastructure(makeBookmarksEngine);
let bms = Cc["@mozilla.org/browser/nav-bookmarks-service;1"].
getService(Ci.nsINavBookmarksService);
function bmId(url) {
var bookmarks = bms.getBookmarkIdsForURI(uri(url), {});
do_check_eq(bookmarks.length, 1);
return bookmarks[0];
}
cleanUp();
// -----------
// Test Proper
// -----------
let boogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.boogle.com"),
-1,
"Boogle");
bms.setItemGUID(boogleBm, "boogle-bookmark-guid");
syncTesting.doSync("initial sync w/ one bookmark");
syncTesting.doSync("trivial re-sync");
let yoogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.yoogle.com"),
-1,
"Yoogle");
bms.setItemGUID(yoogleBm, "yoogle-bookmark-guid");
syncTesting.doSync("add bookmark and re-sync");
bms.moveItem(yoogleBm,
bms.bookmarksMenuFolder,
0);
syncTesting.doSync("swap bookmark order and re-sync");
syncTesting.saveClientState("first computer");
do_check_true(bms.isBookmarked(uri("http://www.boogle.com")));
do_check_true(bms.isBookmarked(uri("http://www.yoogle.com")));
syncTesting.resetClientState();
do_check_false(bms.isBookmarked(uri("http://www.boogle.com")));
do_check_false(bms.isBookmarked(uri("http://www.yoogle.com")));
syncTesting.doSync("re-sync on second computer");
do_check_true(bms.isBookmarked(uri("http://www.boogle.com")));
do_check_true(bms.isBookmarked(uri("http://www.yoogle.com")));
let zoogleBm = bms.insertBookmark(bms.bookmarksMenuFolder,
uri("http://www.zoogle.com"),
-1,
"Zoogle");
bms.setItemGUID(zoogleBm, "zoogle-bookmark-guid");
syncTesting.doSync("add bookmark on second computer and resync");
syncTesting.saveClientState("second computer");
do_check_true(bms.isBookmarked(uri("http://www.zoogle.com")));
syncTesting.restoreClientState("first computer");
do_check_false(bms.isBookmarked(uri("http://www.zoogle.com")));
syncTesting.doSync("re-sync on first computer");
do_check_true(bms.isBookmarked(uri("http://www.zoogle.com")));
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");
do_check_eq(bms.getItemGUID(bmId("http://www.bink.com")),
"bink-bookmark-guid-1");
// --------
// Teardown
// --------
cleanUp();
}

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

@ -1,350 +0,0 @@
*** test pending
Testing INFO -----------------------------------------
Testing INFO Step 'initial sync w/ one bookmark' starting.
Testing INFO -----------------------------------------
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 404
Service.BmkEngine INFO Initial upload to server
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/bookmarks/keys.json with data: {"ring":{},"bulkIV":null}
Service.Resource DEBUG PUT request successful
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/snapshot.json with data: {"boogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}
Service.Resource 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":3,"snapVersion":0,"maxVersion":0,"snapEncryption":"none","deltasEncryption":"none","itemCount":4}
Service.Resource DEBUG PUT request successful
Service.RemoteStore INFO Full upload to server successful
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":0,"GUID":"fake-guid-0","snapshot":{"boogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Testing INFO Step 'initial sync w/ one bookmark' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'trivial re-sync' 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: 0
Service.BmkEngine INFO Server maxVersion: 0
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 Sync complete: no changes needed on client or server
Testing INFO Step 'trivial re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add bookmark and re-sync' 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: 0
Service.BmkEngine INFO Server maxVersion: 0
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 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/1 with data: [{"action":"create","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.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":3,"snapVersion":0,"maxVersion":1,"snapEncryption":"none","deltasEncryption":"none","itemCount":5}
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":1,"GUID":"fake-guid-0","snapshot":{"boogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"yoogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'add bookmark and re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'swap bookmark order and re-sync' 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: 1
Service.BmkEngine INFO Server maxVersion: 1
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 2 against 0 commands
Service.BmkEngine INFO Changes for client: 0
Service.BmkEngine INFO Predicted changes for server: 2
Service.BmkEngine INFO Client conflicts: 0
Service.BmkEngine INFO Server conflicts: 0
Service.BmkEngine INFO Actual changes for server: 2
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/2 with data: [{"action":"edit","GUID":"boogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"index":1,"type":"bookmark"}},{"action":"edit","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"index":0,"type":"bookmark"}}]
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":3,"snapVersion":0,"maxVersion":2,"snapEncryption":"none","deltasEncryption":"none","itemCount":5}
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":2,"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},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'swap bookmark order and re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 're-sync on second computer' starting.
Testing INFO -----------------------------------------
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 DEBUG Remote/local sync GUIDs do not match. Forcing initial sync.
Service.BmkEngine INFO Local snapshot version: -1
Service.BmkEngine INFO Server maxVersion: 2
Service.RemoteStore TRACE Getting latest from snap --> scratch
Service.RemoteStore INFO Downloading all server data from scratch
Testing INFO HTTP GET from user-data/bookmarks/snapshot.json, returning status 200
Service.Resource DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Testing INFO HTTP GET from user-data/bookmarks/deltas/1, 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":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null}}
Testing INFO HTTP GET from user-data/bookmarks/deltas/2, 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":"edit","GUID":"boogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"index":1,"type":"bookmark"}}
Service.SnapStore TRACE Processing command: {"action":"edit","GUID":"yoogle-bookmark-guid","depth":1,"parents":["menu"],"data":{"index":0,"type":"bookmark"}}
Service.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 3 against 5 commands
Service.BmkEngine INFO Changes for client: 2
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":"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.SnapStore 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 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":"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.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":2,"GUID":"fake-guid-0","snapshot":{"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"},"boogle-bookmark-guid":{"parentGUID":"menu","index":1,"type":"bookmark","title":"Boogle","URI":"http://www.boogle.com/","tags":[],"keyword":null},"yoogle-bookmark-guid":{"parentGUID":"menu","index":0,"type":"bookmark","title":"Yoogle","URI":"http://www.yoogle.com/","tags":[],"keyword":null}}}
Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine INFO Sync complete
Testing INFO Step 're-sync on second computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add bookmark on second 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: 2
Service.BmkEngine INFO Server maxVersion: 2
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 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/3 with data: [{"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.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":3,"snapVersion":0,"maxVersion":3,"snapEncryption":"none","deltasEncryption":"none","itemCount":6}
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":3,"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"}}}
Service.BmkEngine INFO Sync complete
Testing INFO Step 'add bookmark on second computer and resync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'restore client state of first 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"
Testing INFO Step 'restore client state of first computer' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 're-sync on first computer' 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: 2
Service.BmkEngine INFO Server maxVersion: 3
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/3, 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":"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.BmkEngine INFO Reconciling client/server updates
Service.BMSync DEBUG Reconciling 0 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":"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 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"
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":3,"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},"menu":{"type":"folder"},"toolbar":{"type":"folder"},"unfiled":{"type":"folder"},"zoogle-bookmark-guid":{"parentGUID":"menu","index":2,"type":"bookmark","title":"Zoogle","URI":"http://www.zoogle.com/","tags":[],"keyword":null}}}
Service.BmkEngine INFO Actual changes for server: 0
Service.BmkEngine INFO Sync complete
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 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":3,"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 different GUID, to second 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: 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 INFO Sync complete
Testing INFO Step 'Manually add same bookmark 'bink', but with different GUID, to second computer and resync' succeeded.
*** test finished
*** exiting
*** PASS ***

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

@ -1,150 +0,0 @@
Components.utils.import("resource://services-sync/engines/cookies.js");
function FakeCookie( host, path, name, value,
isSecure, isHttpOnly, isSession, expiry ) {
this._init( host, path, name, value,
isSecure, isHttpOnly, isSession, expiry );
}
FakeCookie.prototype = {
_init: function( host, path, name, value,
isSecure, isHttpOnly, isSession, expiry) {
this.host = host;
this.path = path;
this.name = name;
this.value = value;
this.isSecure = isSecure;
this.isHttpOnly = isHttpOnly;
this.isSession = isSession;
},
QueryInterface: function( aIID ) {
if ( !aIID.equals( Components.interfaces.nsICookie2 ) ) {
throw Components.results.NS_ERROR_NO_INTERFACE;
}
return this;
}
};
function StubEnumerator( list ) {
this._init( list );
}
StubEnumerator.prototype = {
_init: function( list ) {
this._list = list;
this._pointer = 0;
},
hasMoreElements: function() {
return ( this._list.length > this._pointer );
},
getNext: function() {
var theThing = this._list[ this._pointer ];
this._pointer++;
return theThing;
}
};
function FakeCookieManager() {
this._init();
}
FakeCookieManager.prototype = {
_init: function() {
this._cookieList = [];
},
add: function( host, path, name, value,
isSecure, isHttpOnly, isSession, expiry) {
var newCookie = new FakeCookie( host,
path,
name,
value,
isSecure,
isHttpOnly,
isSession,
expiry );
this._cookieList.push( newCookie );
},
remove: function( host, name, path, alwaysBlock ) {
for (var x in this._cookieList ) {
var cookie = this._cookieList[x];
if ( cookie.host == host &&
cookie.name == name &&
cookie.path == path ) {
this._cookieList.splice( x, 1 );
break;
}
}
},
get enumerator() {
var stubEnum = new StubEnumerator( this._cookieList );
return stubEnum;
},
removeAll: function() {
this._cookieList = [];
}
};
function sub_test_cookie_tracker() {
var ct = new CookieTracker();
// gonna have to use the real cookie manager here...
var cookieManager = Cc["@mozilla.org/cookiemanager;1"].
getService(Ci.nsICookieManager2);
var d = new Date();
d.setDate( d.getDate() + 1 );
cookieManager.add( "www.evilbrainjono.net",
"/blog/",
"comments",
"on",
false,
true,
false,
d.getTime() );
cookieManager.add( "www.evilbrainjono.net",
"/comic/",
"lang",
"jp",
false,
true,
false,
d.getTime() );
cookieManager.add( "www.evilbrainjono.net",
"/blog/",
"comments",
"off",
false,
true,
true, // session
d.getTime() );
// score is 10 per cookie changed, but we should be ignoring the
// session cookie, so we should be at 20 now.
do_check_eq( ct.score, 20 );
};
function run_test() {
/* Set a persistent cookie and a non-persistent cookie
then call cookieStore.wrap() and make sure it returns the persistent
one and not the non-persistent one */
// My stub object to replace the real cookieManager:
var fakeCookieManager = new FakeCookieManager();
// add a persistent cookie:
var d = new Date();
d.setDate( d.getDate() + 1 );
fakeCookieManager.add( "evilbrainjono.net", "/", "login", "jono",
false, true, false, d.getTime() );
// and a session cookie:
fakeCookieManager.add( "humanized.com", "/", "langauge", "en",
false, true, true, 0 );
var myStore = new CookieStore( fakeCookieManager );
var json = myStore.wrap();
// The json should include only the persistent cookie, not the session
// cookie:
var jsonGuids = [ guid for ( guid in json ) ];
do_check_eq( jsonGuids.length, 1 );
do_check_eq( jsonGuids[0], "evilbrainjono.net:/:login" );
sub_test_cookie_tracker();
}

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

@ -1,46 +0,0 @@
Cu.import("resource://services-sync/async.js");
Cu.import("resource://services-sync/crypto.js");
Cu.import("resource://services-sync/dav.js");
Cu.import("resource://services-sync/identity.js");
Function.prototype.async = Async.sugar;
let __fakeCryptoID = {
keypairAlg: "RSA",
// This private key is encrypted with the passphrase 'passphrase',
// contained in our testing infrastructure.
privkey: "3ytj94K6Wo0mBjAVsiIwjm5x2+ENvpKTDUqLCz19iXbESf8RT6O8PmY7Pqcndpn+adqaQdvmr0T1JQ5bfLEHev0WBfo8oWJb+OS4rKoCWxDNzGwrOlW5hCfxSekw0KrKjqZyDZ0hT1Qt9vn6thlV2v9YWfmyn0OIxNC9hUqGwU3Wb2F2ejM0Tw40+IIW4eLEvFxLGv0vnEXpZvesPt413proL6FGQJe6vyapBg+sdX1JMYGaKZY84PUGIiDPxTbQg7yIWTSe3WlDhJ001khFiyEoTZvPhiAGXfML9ycrCRZUWkHp/cfS7QiusJXs6co0tLjrIk/rTk8h4mHBnyPkFIxh4YrfC7Bwf9npwomhaZCEQ32VK+a8grTDsGYHPZexDm3TcD2+d+hZ/u4lUOHFscQKX4w83tq942yqFtElCD2yQoqEDr1Z9zge5XBnLcYiH9hL0ozfpxBlTtpR1kSH663JHqlYim0qhuk0zrGAPkHna07UMFufxvgQBSd/YUqWCimJFGi+5QeOOFO20Skj882Bh1QDYsmbxZ/JED5ocGNHWSqpaOL2ML1F9nD5rdtffI0BsTe+j9h+HV4GlvzUz0Jd6RRf9xN4RyxqfENb8iGH5Pwbry7Qyk16rfm0s6JgG8pNb/8quKD+87RAtQFybZtdQ9NfGg+gyRiU9pbb6FPuPnGp+KpktaHu/K3HnomrVUoyLQALfCSbPXg2D9ta6dRV0JRqOZz4w52hlHIa62iJO6QecbdBzPYGT0QfOy/vp6ndRDR+2xMD/BmlaQwm3+58cqhIw9SVV5h/Z5PVaXxAOqg5vpU1NjrbF4uIFo5rmR0PyA/6qtxZaBY6w3I4sUWdDkIer8QsyrFrO7MIEdxksvDoFIeIM5eN8BufLu3ymS5ZXBiFr/iRxlYcQVHK2hz0/7syWUYsrz5/l1mj+qbWGx+6daWOk3xt4SH+p0hUpMC4FbJ9m/xr4im+X5m5ZYiajaF1QPOXTTny2plE0vfqMVlwX1HFFTJrAP+E85sZI8LPHAYO80qhSi3tV/LHjxCnC1LHJXaRkG202pQFWF1yVT/o82HBt9OC1xY6TVcy4Uh+6piNIQ9FxXGWrzjz0AUkxwkSN3Foqlfiq+mqJmNwzIdEQTmNAcBBsN3vWngU4elHjYI5qFZBzxJIkH8tfvivOshrOZIZB9TD9GIRhQwIBWc6i4fnqE9GUK2Jle6werdFATiMU4msQg7ClURaMn/p3MOLoxTmsPd1iBYPQkqnJgEAdNfKj3KRqSc6M/x09hGDSzK2d9Y03pyDGPh2sopcMFdCQbMy8VOld2/hEGakMJv6BPoRfhKmJbgGVf5x4B9dWZNa8WCmlcxaZ7KG43UA0zLm1VgfTcDW5qazDFoxIcfhmO5KoRI3q8vNs+Wh+smLC6yFODdF9HzrPimEYSc6OWHWgUcuiIBRjKeo5gBTbExWmri2VG+cn005vQNxK+0s7JVyFB8TzZ96pV3nFjkYy9OUkaiJxGd6OVGcvhbbrcNsKkaZff7OsLqczf6x0bhwh+y8+bLjLkuusGYUdBvdeiuv12IfeRupvwD8Z3aZOgcD7d+8VTyTyd/KX9fu8P7tD5SojJ5joRPjcv4Q8/mhRgtwx1McMIL3YnKHG+U=",
privkeyWrapIV: "fZ7CB/KQAUjEhkmrEkns4Q==",
passphraseSalt: "JFs5h2RKX9m0Op9DlQIcCOSfOH1MuDrrrHxCx+CpCUU=",
pubkey: "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAxxwObnXIoYeQKMG9RbvLkgsu/idDo25qOX87jIEiXkgW1wLKp/1D/DBLUEW303tVszNGVt6bTyAXOIj6skpmYoDs9Z48kvU3+g7Vi4QXEw5moSS4fr+yFpKiYd2Kx1+jCFGvGZjBzAAvnjsWmWrSA+LHJSrFlKY6SM3kNg8KrE8dxUi3wztlZnhZgo1ZYe7/VeBOXUfThtoadIl1VdREw2e79eiMQpPa0XLv4grCaMd/wLRs0be1/nPt7li4NyT0fnYFWg75SU3ni/xSaq/zR4NmW/of5vB2EcKyUG+/mvNplQ0CX+v3hRBCdhpCyPmcbHKUluyKzj7Ms9pKyCkwxwIDAQAB"
};
function testGenerator() {
let self = yield;
let id = ID.get("WeaveCryptoID");
for (name in __fakeCryptoID)
id[name] = __fakeCryptoID[name];
Crypto.isPassphraseValid.async(Crypto, self.cb, id);
let result = yield;
do_check_eq(result, true);
id.setTempPassword("incorrect passphrase");
Crypto.isPassphraseValid.async(Crypto, self.cb, id);
result = yield;
do_check_eq(result, false);
self.done();
}
function run_test() {
let syncTesting = new SyncTestingInfrastructure();
syncTesting.runAsyncFunc(
"Ensuring isPassphraseValid() works",
function runTest(cb) { testGenerator.async({}, cb); }
);
}

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

@ -1,37 +0,0 @@
Cu.import("resource://services-sync/engines/passwords.js");
load("fake_login_manager.js");
// ----------------------------------------
// Test Logic
// ----------------------------------------
function run_test() {
function passwdFactory() { return new PasswordEngine(); }
var syncTesting = new SyncTestingInfrastructure(passwdFactory);
var fakeLoginManager = new FakeLoginManager(fakeSampleLogins);
syncTesting.doSync("initial sync");
syncTesting.doSync("trivial re-sync");
fakeLoginManager.fakeLogins.push(
{hostname: "www.yoogle.com",
formSubmitURL: "http://www.yoogle.com/search",
httpRealm: "",
username: "",
password: "",
usernameField: "test_person2",
passwordField: "test_password2"}
);
syncTesting.doSync("add user and re-sync");
fakeLoginManager.fakeLogins.pop();
syncTesting.doSync("remove user and re-sync");
syncTesting.resetClientState();
syncTesting.doSync("resync on second computer");
}

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

@ -1,174 +0,0 @@
*** test pending
Testing INFO -----------------------------------------
Testing INFO Step 'initial sync' starting.
Testing INFO -----------------------------------------
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/status.json, returning status 404
Service.PasswordEngine INFO Initial upload to server
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/keys.json with data: {"ring":{},"bulkIV":null}
Service.Resource DEBUG PUT request successful
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/passwords/snapshot.json with data: {"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}
Service.Resource DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":3,"snapVersion":0,"maxVersion":0,"snapEncryption":"none","deltasEncryption":"none","itemCount":1}
Service.Resource DEBUG PUT request successful
Service.RemoteStore INFO Full upload to server successful
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/passwords.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/passwords.json': {"version":0,"GUID":"fake-guid-0","snapshot":{"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}}
Testing INFO Step 'initial sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'trivial re-sync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/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.PasswordEngine INFO Local snapshot version: 0
Service.PasswordEngine INFO Server maxVersion: 0
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.PasswordEngine INFO Sync complete: no changes needed on client or server
Testing INFO Step 'trivial re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'add user and re-sync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/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.PasswordEngine INFO Local snapshot version: 0
Service.PasswordEngine INFO Server maxVersion: 0
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.PasswordEngine INFO Reconciling client/server updates
Service.PasswordSync DEBUG Reconciling 1 against 0 commands
Service.PasswordEngine INFO Changes for client: 0
Service.PasswordEngine INFO Predicted changes for server: 1
Service.PasswordEngine INFO Client conflicts: 0
Service.PasswordEngine INFO Server conflicts: 0
Service.PasswordEngine INFO Actual changes for server: 1
Service.PasswordEngine 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/passwords/deltas/1 with data: [{"action":"create","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":3,"snapVersion":0,"maxVersion":1,"snapEncryption":"none","deltasEncryption":"none","itemCount":2}
Service.Resource DEBUG PUT request successful
Service.PasswordEngine INFO Successfully updated deltas and status on server
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/passwords.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/passwords.json': {"version":1,"GUID":"fake-guid-0","snapshot":{"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"},"1b3869fc36234b39cd354f661ed1d7d148394ca3":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}}
Service.PasswordEngine INFO Sync complete
Testing INFO Step 'add user and re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'remove user and re-sync' starting.
Testing INFO -----------------------------------------
Testing INFO Opening 'weave/snapshots/passwords.json' for reading.
Testing INFO Reading from stream.
Service.SnapStore INFO Read saved snapshot from disk
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/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.PasswordEngine INFO Local snapshot version: 1
Service.PasswordEngine INFO Server maxVersion: 1
Service.RemoteStore DEBUG Using last sync snapshot as server snapshot (snap version == max version)
Service.RemoteStore TRACE Local snapshot version == server maxVersion
Service.PasswordEngine INFO Reconciling client/server updates
Service.PasswordSync DEBUG Reconciling 1 against 0 commands
Service.PasswordEngine INFO Changes for client: 0
Service.PasswordEngine INFO Predicted changes for server: 1
Service.PasswordEngine INFO Client conflicts: 0
Service.PasswordEngine INFO Server conflicts: 0
Service.PasswordEngine INFO Actual changes for server: 1
Service.PasswordEngine 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/passwords/deltas/2 with data: [{"action":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}]
Service.ResourceSet DEBUG PUT request successful
Service.JsonFilter DEBUG Encoding data as JSON
Testing INFO HTTP PUT to user-data/passwords/status.json with data: {"GUID":"fake-guid-0","formatVersion":3,"snapVersion":0,"maxVersion":2,"snapEncryption":"none","deltasEncryption":"none","itemCount":1}
Service.Resource DEBUG PUT request successful
Service.PasswordEngine INFO Successfully updated deltas and status on server
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/passwords.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/passwords.json': {"version":2,"GUID":"fake-guid-0","snapshot":{"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}}
Service.PasswordEngine INFO Sync complete
Testing INFO Step 'remove user and re-sync' succeeded.
Testing INFO -----------------------------------------
Testing INFO Step 'resync on second computer' starting.
Testing INFO -----------------------------------------
Service.PasswordEngine INFO Beginning sync
Testing INFO HTTP MKCOL on user-data/passwords/deltas
Service.RemoteStore DEBUG Downloading status file
Testing INFO HTTP GET from user-data/passwords/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.PasswordEngine DEBUG Remote/local sync GUIDs do not match. Forcing initial sync.
Service.PasswordEngine INFO Local snapshot version: -1
Service.PasswordEngine INFO Server maxVersion: 2
Service.RemoteStore TRACE Getting latest from snap --> scratch
Service.RemoteStore INFO Downloading all server data from scratch
Testing INFO HTTP GET from user-data/passwords/snapshot.json, returning status 200
Service.Resource DEBUG GET request successful
Service.CryptoFilter DEBUG Decrypting data
Service.Crypto DEBUG NOT decrypting data
Service.JsonFilter DEBUG Decoding JSON data
Testing INFO HTTP GET from user-data/passwords/deltas/1, 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":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[],"data":{"hostname":"www.yoogle.com","formSubmitURL":"http://www.yoogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person2","passwordField":"test_password2"}}
Testing INFO HTTP GET from user-data/passwords/deltas/2, 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":"remove","GUID":"1b3869fc36234b39cd354f661ed1d7d148394ca3","depth":0,"parents":[]}
Service.PasswordEngine INFO Reconciling client/server updates
Service.PasswordSync DEBUG Reconciling 0 against 1 commands
Service.PasswordEngine INFO Changes for client: 1
Service.PasswordEngine INFO Predicted changes for server: 0
Service.PasswordEngine INFO Client conflicts: 0
Service.PasswordEngine INFO Server conflicts: 0
Service.PasswordEngine INFO Applying changes locally
Service.SnapStore TRACE Processing command: {"action":"create","GUID":"805ec58eb8dcded602999967e139be21acd0f194","depth":0,"parents":[],"data":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}
Service.PasswordStore TRACE Processing command: {"action":"create","GUID":"805ec58eb8dcded602999967e139be21acd0f194","depth":0,"parents":[],"data":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}
Service.PasswordStore INFO PasswordStore got createCommand: [object Object]
Testing INFO nsILoginManager.addLogin() called with hostname 'www.boogle.com'.
Service.SnapStore INFO Saving snapshot to disk
Testing INFO Opening 'weave/snapshots/passwords.json' for writing.
Testing INFO Writing data to local file 'weave/snapshots/passwords.json': {"version":2,"GUID":"fake-guid-0","snapshot":{"805ec58eb8dcded602999967e139be21acd0f194":{"hostname":"www.boogle.com","formSubmitURL":"http://www.boogle.com/search","httpRealm":"","username":"","password":"","usernameField":"test_person","passwordField":"test_password"}}}
Service.PasswordEngine INFO Actual changes for server: 0
Service.PasswordEngine INFO Sync complete
Testing INFO Step 'resync on second computer' succeeded.
*** test finished
*** exiting
*** PASS ***

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

@ -1,23 +0,0 @@
load("fake_login_manager.js");
var loginMgr = new FakeLoginManager(fakeSampleLogins);
// The JS module we're testing, with all members exposed.
var passwords = loadInSandbox("resource://services-sync/engines/passwords.js");
function test_hashLoginInfo_works() {
var pwStore = new passwords.PasswordStore();
var fakeUserHash = pwStore._hashLoginInfo(fakeSampleLogins[0]);
do_check_eq(typeof fakeUserHash, 'string');
do_check_eq(fakeUserHash.length, 40);
}
function test_synccore_itemexists_works() {
var pwStore = new passwords.PasswordStore();
var fakeUserHash = pwStore._hashLoginInfo(fakeSampleLogins[0]);
var psc = new passwords.PasswordSyncCore();
/* wrap needs to be called before _itemExists */
pwStore.wrap();
do_check_false(pwStore._itemExists("invalid guid"));
do_check_true(pwStore._itemExists(fakeUserHash));
}

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

@ -1,58 +0,0 @@
Cu.import("resource://services-sync/async.js");
Cu.import("resource://services-sync/crypto.js");
Cu.import("resource://services-sync/log4moz.js");
Function.prototype.async = Async.sugar;
let __fakePrefs = {
"log.logger.async" : "Debug",
"username" : "foo",
"serverURL" : "https://example.com/",
"encryption" : "aes-256-cbc",
"enabled" : true,
"schedule" : 0
};
let __fakeDAVContents = {
"meta/version" : "3",
"private/privkey" : '{"version":1,"algorithm":"RSA"}',
"public/pubkey" : '{"version":1,"algorithm":"RSA"}'
};
let Service = loadInSandbox("resource://services-sync/service.js");
function TestService() {
this.__superclassConstructor = Service.WeaveSvc;
this.__superclassConstructor([]);
}
TestService.prototype = {
_initLogs: function TS__initLogs() {
this._log = Log4Moz.Service.getLogger("Service.Main");
}
};
TestService.prototype.__proto__ = Service.WeaveSvc.prototype;
Crypto.isPassphraseValid = function fake_isPassphraseValid(id) {
let self = yield;
do_check_eq(id.password, "passphrase");
self.done(true);
};
function test_login_works() {
var syncTesting = new SyncTestingInfrastructure();
syncTesting.fakeDAVService.fakeContents = __fakeDAVContents;
for (name in __fakePrefs)
syncTesting.fakePrefService.fakeContents[name] = __fakePrefs[name];
var testService = new TestService();
function login(cb) {
testService.login(cb);
}
syncTesting.runAsyncFunc("Logging in", login);
}

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

@ -1,18 +0,0 @@
*** test pending
Running test: test_login_works
Service.Main INFO Weave Sync Service Initializing
Testing INFO -----------------------------------------
Testing INFO Step 'Logging in' starting.
Testing INFO -----------------------------------------
Service.Main DEBUG Logging in user foo
Service.Main INFO Using server URL: https://example.com/user/foo
Testing INFO HTTP GET from meta/version, returning status 200
Service.Main TRACE Retrieving keypair from server
Testing INFO HTTP GET from private/privkey, returning status 200
Testing INFO HTTP GET from public/pubkey, returning status 200
Service.Main INFO Weave scheduler disabled
Testing INFO Step 'Logging in' succeeded.
1 of 1 tests passed.
*** test finished
*** exiting
*** PASS ***

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

@ -1,36 +0,0 @@
Cu.import("resource://services-sync/util.js");
function _reportException(e) {
dump("Exception caught.\n");
dump("Exception: " + Utils.exceptionStr(e) + "\n");
dump("Traceback:\n\n" + Utils.stackTrace(e) + "\n");
}
function test_stackTrace_works_with_error_object() {
try {
dump("Throwing new Error object.\n");
throw new Error("Error!");
} catch (e) {
_reportException(e);
}
}
function test_stackTrace_works_with_bare_string() {
try {
dump("Throwing bare string.\n");
throw "Error!";
} catch (e) {
_reportException(e);
}
}
function test_stackTrace_works_with_nsIException() {
try {
dump("Throwing a wrapped nsIException.\n");
let dirSvc = Cc["@mozilla.org/file/directory_service;1"].
getService(Ci.nsIProperties);
dirSvc.get("nonexistentPropertyName");
} catch (e) {
_reportException(e);
}
}

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

@ -1,36 +0,0 @@
*** test pending
Running test: test_stackTrace_works_with_error_object
Throwing new Error object.
Exception caught.
Exception: Error! (file 'test_util_tracebacks.js', line 12)
Traceback:
Error("Error!")@:0
test_stackTrace_works_with_error_object()@test_util_tracebacks.js:12
_find_and_run_tests()@../harness/head.js:106
_execute_test(_find_and_run_tests)@../harness/head.js:144
@../harness/tail.js:38
Running test: test_stackTrace_works_with_bare_string
Throwing bare string.
Exception caught.
Exception: Error!
Traceback:
No traceback available.
Running test: test_stackTrace_works_with_nsIException
Throwing a wrapped nsIException.
Exception caught.
Exception: Not enough arguments [nsIProperties.get] (JS frame :: test_util_tracebacks.js :: test_stackTrace_works_with_nsIException :: line 32)
Traceback:
JS frame :: test_util_tracebacks.js :: test_stackTrace_works_with_nsIException :: line 32
JS frame :: ../harness/head.js :: _find_and_run_tests :: line 106
JS frame :: ../harness/head.js :: _execute_test :: line 144
JS frame :: ../harness/tail.js :: <TOP_LEVEL> :: line 38
3 of 3 tests passed.
*** test finished
*** exiting
*** PASS ***