diff options
author | Moonchild <mcwerewolf@wolfbeast.com> | 2018-12-12 11:01:48 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-12 11:01:48 +0100 |
commit | bc8a25f5e33700f700b1e07b238bef5dae22f1ad (patch) | |
tree | c1f1ec816f1a85459d05bd6a4cf4f6170b01c602 /services/sync/tests/unit/test_bookmark_invalid.js | |
parent | f2d4bd1e395f903355cc157a1de7207e5b22b7fb (diff) | |
parent | 9697bfa68f32984b196748e388d743dddbe6aa7b (diff) | |
download | UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.gz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.lz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.tar.xz UXP-bc8a25f5e33700f700b1e07b238bef5dae22f1ad.zip |
Merge pull request #898 from MoonchildProductions/Sync-weave
Remove FxA Phase 1
Diffstat (limited to 'services/sync/tests/unit/test_bookmark_invalid.js')
-rw-r--r-- | services/sync/tests/unit/test_bookmark_invalid.js | 63 |
1 files changed, 0 insertions, 63 deletions
diff --git a/services/sync/tests/unit/test_bookmark_invalid.js b/services/sync/tests/unit/test_bookmark_invalid.js deleted file mode 100644 index af476a7f9..000000000 --- a/services/sync/tests/unit/test_bookmark_invalid.js +++ /dev/null @@ -1,63 +0,0 @@ -Cu.import("resource://gre/modules/PlacesUtils.jsm"); -Cu.import("resource://gre/modules/Log.jsm"); -Cu.import("resource://gre/modules/Task.jsm"); -Cu.import("resource://services-sync/engines.js"); -Cu.import("resource://services-sync/engines/bookmarks.js"); -Cu.import("resource://services-sync/service.js"); -Cu.import("resource://services-sync/util.js"); - -Service.engineManager.register(BookmarksEngine); - -var engine = Service.engineManager.get("bookmarks"); -var store = engine._store; -var tracker = engine._tracker; - -add_task(function* test_ignore_invalid_uri() { - _("Ensure that we don't die with invalid bookmarks."); - - // First create a valid bookmark. - let bmid = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId, - Services.io.newURI("http://example.com/", null, null), - PlacesUtils.bookmarks.DEFAULT_INDEX, - "the title"); - - // Now update moz_places with an invalid url. - yield PlacesUtils.withConnectionWrapper("test_ignore_invalid_uri", Task.async(function* (db) { - yield db.execute( - `UPDATE moz_places SET url = :url, url_hash = hash(:url) - WHERE id = (SELECT b.fk FROM moz_bookmarks b - WHERE b.id = :id LIMIT 1)`, - { id: bmid, url: "<invalid url>" }); - })); - - // Ensure that this doesn't throw even though the DB is now in a bad state (a - // bookmark has an illegal url). - engine._buildGUIDMap(); -}); - -add_task(function* test_ignore_missing_uri() { - _("Ensure that we don't die with a bookmark referencing an invalid bookmark id."); - - // First create a valid bookmark. - let bmid = PlacesUtils.bookmarks.insertBookmark(PlacesUtils.unfiledBookmarksFolderId, - Services.io.newURI("http://example.com/", null, null), - PlacesUtils.bookmarks.DEFAULT_INDEX, - "the title"); - - // Now update moz_bookmarks to reference a non-existing places ID - yield PlacesUtils.withConnectionWrapper("test_ignore_missing_uri", Task.async(function* (db) { - yield db.execute( - `UPDATE moz_bookmarks SET fk = 999999 - WHERE id = :id` - , { id: bmid }); - })); - - // Ensure that this doesn't throw even though the DB is now in a bad state (a - // bookmark has an illegal url). - engine._buildGUIDMap(); -}); - -function run_test() { - initTestLogging('Trace'); - run_next_test(); -} |