summaryrefslogtreecommitdiffstats
path: root/services/cloudsync/tests/xpcshell
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@wolfbeast.com>2019-03-13 09:50:54 +0100
committerwolfbeast <mcwerewolf@wolfbeast.com>2019-03-13 09:50:54 +0100
commit4c431486433428b18610c3578b693f3e1f1136eb (patch)
tree671b9cb9dc4c1abb5cd3525ca35beff2c762fc66 /services/cloudsync/tests/xpcshell
parentbf0413359245579e9509146d42cd5547e35da695 (diff)
downloadUXP-4c431486433428b18610c3578b693f3e1f1136eb.tar
UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.gz
UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.lz
UXP-4c431486433428b18610c3578b693f3e1f1136eb.tar.xz
UXP-4c431486433428b18610c3578b693f3e1f1136eb.zip
Remove CloudSync
Tag #812
Diffstat (limited to 'services/cloudsync/tests/xpcshell')
-rw-r--r--services/cloudsync/tests/xpcshell/head.js10
-rw-r--r--services/cloudsync/tests/xpcshell/test_bookmarks.js73
-rw-r--r--services/cloudsync/tests/xpcshell/test_lazyload.js18
-rw-r--r--services/cloudsync/tests/xpcshell/test_module.js19
-rw-r--r--services/cloudsync/tests/xpcshell/test_tabs.js29
-rw-r--r--services/cloudsync/tests/xpcshell/xpcshell.ini10
6 files changed, 0 insertions, 159 deletions
diff --git a/services/cloudsync/tests/xpcshell/head.js b/services/cloudsync/tests/xpcshell/head.js
deleted file mode 100644
index bd517cafa..000000000
--- a/services/cloudsync/tests/xpcshell/head.js
+++ /dev/null
@@ -1,10 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-var {classes: Cc, interfaces: Ci, results: Cr, utils: Cu} = Components;
-
-"use strict";
-
-(function initCloudSyncTestingInfrastructure () {
- do_get_profile();
-}).call(this);
diff --git a/services/cloudsync/tests/xpcshell/test_bookmarks.js b/services/cloudsync/tests/xpcshell/test_bookmarks.js
deleted file mode 100644
index d4e1d2b75..000000000
--- a/services/cloudsync/tests/xpcshell/test_bookmarks.js
+++ /dev/null
@@ -1,73 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/CloudSync.jsm");
-
-function run_test () {
- run_next_test();
-}
-
-function cleanup () {
-
-}
-
-add_task(function* test_merge_bookmarks_flat () {
- try {
- 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},
- {"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,"title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com?1",index:1},
- ];
- yield rootFolder.mergeRemoteItems(items);
-
- let localItems = yield rootFolder.getLocalItems();
- equal(Object.keys(localItems).length, items.length, "found merged items");
- } finally {
- yield CloudSync().bookmarks.deleteRootFolder("TEST");
- }
-});
-
-add_task(function* test_merge_bookmarks_in_folders () {
- try {
- 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},
- {"id":"G_UL4ZhOyX8n","type":rootFolder.BOOKMARK,parent:"G_UL4ZhOyX8x","title":"reddit: the front page of the internet 2","uri":"http://www.reddit.com/?a=å%20ä%20ö",index:1},
- {"id":"G_UL4ZhOyX8x","type":rootFolder.FOLDER},
- ];
- yield rootFolder.mergeRemoteItems(items);
-
- let localItems = yield rootFolder.getLocalItems();
- equal(localItems.length, items.length, "found merged items");
-
- localItems.forEach(function(item) {
- ok(item.id == "G_UL4ZhOyX8m" ||
- item.id == "G_UL4ZhOyX8n" ||
- item.id == "G_UL4ZhOyX8x");
- if (item.id == "G_UL4ZhOyX8n") {
- equal(item.parent, "G_UL4ZhOyX8x")
- } else {
- equal(item.parent, rootFolder.id);
- }
- });
-
- let folder = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8x"]))[0];
- equal(folder.id, "G_UL4ZhOyX8x");
- equal(folder.type, rootFolder.FOLDER);
-
- let bookmark = (yield rootFolder.getLocalItemsById(["G_UL4ZhOyX8n"]))[0];
- equal(bookmark.id, "G_UL4ZhOyX8n");
- equal(bookmark.parent, "G_UL4ZhOyX8x");
- equal(bookmark.title, "reddit: the front page of the internet 2");
- equal(bookmark.index, 0);
- equal(bookmark.uri, "http://www.reddit.com/?a=%C3%A5%20%C3%A4%20%C3%B6");
- } finally {
- yield CloudSync().bookmarks.deleteRootFolder("TEST");
- }
-}); \ No newline at end of file
diff --git a/services/cloudsync/tests/xpcshell/test_lazyload.js b/services/cloudsync/tests/xpcshell/test_lazyload.js
deleted file mode 100644
index 5928875d5..000000000
--- a/services/cloudsync/tests/xpcshell/test_lazyload.js
+++ /dev/null
@@ -1,18 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/CloudSync.jsm");
-
-function run_test() {
- run_next_test();
-}
-
-add_task(function test_lazyload() {
- ok(!CloudSync.ready, "CloudSync.ready is false before CloudSync() invoked");
- let cs1 = CloudSync();
- ok(CloudSync.ready, "CloudSync.ready is true after CloudSync() invoked");
- let cs2 = CloudSync();
- ok(cs1 === cs2, "CloudSync() returns the same instance on multiple invocations");
-});
diff --git a/services/cloudsync/tests/xpcshell/test_module.js b/services/cloudsync/tests/xpcshell/test_module.js
deleted file mode 100644
index 6d31345ed..000000000
--- a/services/cloudsync/tests/xpcshell/test_module.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/CloudSync.jsm");
-
-function run_test () {
- run_next_test();
-}
-
-add_task(function test_module_load () {
- ok(CloudSync);
- let cloudSync = CloudSync();
- ok(cloudSync.adapters);
- ok(cloudSync.bookmarks);
- ok(cloudSync.local);
- ok(cloudSync.tabs);
-});
diff --git a/services/cloudsync/tests/xpcshell/test_tabs.js b/services/cloudsync/tests/xpcshell/test_tabs.js
deleted file mode 100644
index 50f7a73de..000000000
--- a/services/cloudsync/tests/xpcshell/test_tabs.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/* Any copyright is dedicated to the Public Domain.
- * http://creativecommons.org/publicdomain/zero/1.0/ */
-
-"use strict";
-
-Cu.import("resource://gre/modules/CloudSync.jsm");
-
-function run_test () {
- run_next_test();
-}
-
-add_task(function* test_get_remote_tabs () {
- let cloudSync = CloudSync();
- let clients = yield cloudSync.tabs.getRemoteTabs();
- equal(clients.length, 0);
-
- yield cloudSync.tabs.mergeRemoteTabs({
- id: "001",
- name: "FakeClient",
- },[
- {url:"https://www.google.ca?a=å%20ä%20ö",title:"Google Canada",icon:"https://www.google.ca/favicon.ico",lastUsed:0},
- {url:"http://www.reddit.com",title:"Reddit",icon:"http://www.reddit.com/favicon.ico",lastUsed:1},
- ]);
- ok(cloudSync.tabs.hasRemoteTabs());
-
- clients = yield cloudSync.tabs.getRemoteTabs();
- equal(clients.length, 1);
- equal(clients[0].tabs.size, 2);
-});
diff --git a/services/cloudsync/tests/xpcshell/xpcshell.ini b/services/cloudsync/tests/xpcshell/xpcshell.ini
deleted file mode 100644
index 08d2eff3a..000000000
--- a/services/cloudsync/tests/xpcshell/xpcshell.ini
+++ /dev/null
@@ -1,10 +0,0 @@
-[DEFAULT]
-head = head.js
-tail =
-firefox-appdir = browser
-skip-if = toolkit == 'android'
-
-[test_module.js]
-[test_tabs.js]
-[test_bookmarks.js]
-[test_lazyload.js]