Closed Bug 1074640 Opened 10 years ago Closed 10 years ago

More tests for bookmarks

Categories

(Cloud Services Graveyard :: cloudSync, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla35

People

(Reporter: akligman, Assigned: akligman)

Details

Attachments

(1 file, 1 obsolete file)

Add some additional xpcshell tests for bookmarks.
Keywords: checkin-needed
Did somebody r+ this?
Keywords: checkin-needed
Attachment #8497303 - Flags: review?(rnewman)
Status: NEW → ASSIGNED
OS: Linux → All
Hardware: x86_64 → All
Comment on attachment 8497303 [details] [diff] [review]
0001-CLOUDSYNC-more-tests.patch

Review of attachment 8497303 [details] [diff] [review]:
-----------------------------------------------------------------

::: services/cloudsync/tests/xpcshell/test_bookmarks.js
@@ +13,5 @@
>    let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
> +  ok(rootFolder.id, "root folder id is ok");
> +
> +  let items = [
> +  	{"id":"G_UL4ZhOyX8m","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 1","uri":"http://www.reddit.com",index:2},

Could you make sure there's non-ASCII in here?

@@ +14,5 @@
> +  ok(rootFolder.id, "root folder id is ok");
> +
> +  let items = [
> +  	{"id":"G_UL4ZhOyX8m","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 1","uri":"http://www.reddit.com",index:2},
> +    {"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com?1",index:1},

Nit: alignment.

@@ +19,5 @@
> +  ];
> +  yield rootFolder.mergeRemoteItems(items);
> +
> +  let localItems = yield rootFolder.getLocalItems();
> +  equal(Object.keys(localItems).length, items.length, "found merged items");

Test contents?

@@ +30,5 @@
> +  ok(rootFolder.id, "root folder id is ok");
> +
> +  let items = [
> +  	{"id":"G_UL4ZhOyX8m","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 1","uri":"http://www.reddit.com",index:2},
> +    {"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,parent:"G_UL4ZhOyX8x","title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com/?1",index:1},

Alignment again.

@@ +42,5 @@
> +  localItems.forEach(function(item) {
> +    ok(item.id == "G_UL4ZhOyX8m" ||
> +       item.id == "G_UL4ZhOyX8n" ||
> +       item.id == "G_UL4ZhOyX8x");
> +    if(item.id == "G_UL4ZhOyX8n") {

Nit: "if ("

@@ +60,5 @@
> +  equal(bookmark.title, "reddit: the front page of the internet 2");
> +  equal(bookmark.index, 0);
> +  equal(bookmark.uri, "http://www.reddit.com/?1");
> +
> +  yield CloudSync().bookmarks.deleteRootFolder("TEST");

This won't run if the earlier code throws, right? Put this in a cleanup function (for toplevel; IIRC, that's do_register_cleanup in xpcshell) or finally.
Attachment #8497303 - Flags: review?(rnewman) → review+
Attachment #8497303 - Attachment is obsolete: true
Attachment #8497761 - Flags: review+
Keywords: checkin-needed
Note that this is blocking an uplift to Aurora (bug#993584).
Alan: when things are urgent, it's best not to rely on checkin-needed. Try pinging a sheriff in #developers, or finding someone you know has commit access.

(I'm afk for the next few hours, else I'd do it.)
Richard: Thanks, I've pinged a sheriff.
https://hg.mozilla.org/mozilla-central/rev/7c28c8e03229
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
Whiteboard: [fixed-in-fx-team]
Target Milestone: --- → mozilla35
Product: Cloud Services → Cloud Services Graveyard
You need to log in before you can comment on or make changes to this bug.