diff options
author | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
---|---|---|
committer | Matt A. Tobin <email@mattatobin.com> | 2018-02-03 06:00:38 -0500 |
commit | 8148615da179fdd60f19018e13b4e94b95609cc6 (patch) | |
tree | 771fccdd99fa3adf35fdd2c81d8197b415a89b91 /browser/components/places/tests/unit/test_browserGlue_migrate.js | |
parent | 494802c1be7888025b95260d23db187467d2b9dd (diff) | |
download | UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.gz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.lz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.tar.xz UXP-8148615da179fdd60f19018e13b4e94b95609cc6.zip |
Remove browser tests - Part 1: The Tests (except for experiments)
Diffstat (limited to 'browser/components/places/tests/unit/test_browserGlue_migrate.js')
-rw-r--r-- | browser/components/places/tests/unit/test_browserGlue_migrate.js | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/browser/components/places/tests/unit/test_browserGlue_migrate.js b/browser/components/places/tests/unit/test_browserGlue_migrate.js deleted file mode 100644 index 817f10c81..000000000 --- a/browser/components/places/tests/unit/test_browserGlue_migrate.js +++ /dev/null @@ -1,70 +0,0 @@ -/* Any copyright is dedicated to the Public Domain. - http://creativecommons.org/publicdomain/zero/1.0/ */ - -/** - * Tests that nsBrowserGlue does not overwrite bookmarks imported from the - * migrators. They usually run before nsBrowserGlue, so if we find any - * bookmark on init, we should not try to import. - */ - -const PREF_SMART_BOOKMARKS_VERSION = "browser.places.smartBookmarksVersion"; - -function run_test() { - // Create our bookmarks.html from bookmarks.glue.html. - create_bookmarks_html("bookmarks.glue.html"); - - // Remove current database file. - clearDB(); - - run_next_test(); -} - -do_register_cleanup(remove_bookmarks_html); - -add_task(function* test_migrate_bookmarks() { - // Initialize Places through the History Service and check that a new - // database has been created. - Assert.equal(PlacesUtils.history.databaseStatus, - PlacesUtils.history.DATABASE_STATUS_CREATE); - - // A migrator would run before nsBrowserGlue Places initialization, so mimic - // that behavior adding a bookmark and notifying the migration. - let bg = Cc["@mozilla.org/browser/browserglue;1"].getService(Ci.nsIObserver); - bg.observe(null, "initial-migration-will-import-default-bookmarks", null); - - yield PlacesUtils.bookmarks.insert({ - parentGuid: PlacesUtils.bookmarks.menuGuid, - index: PlacesUtils.bookmarks.DEFAULT_INDEX, - type: PlacesUtils.bookmarks.TYPE_BOOKMARK, - url: "http://mozilla.org/", - title: "migrated" - }); - - let promise = promiseTopicObserved("places-browser-init-complete"); - bg.observe(null, "initial-migration-did-import-default-bookmarks", null); - yield promise; - - let bm = yield PlacesUtils.bookmarks.fetch({ - parentGuid: PlacesUtils.bookmarks.toolbarGuid, - index: 0 - }); - yield checkItemHasAnnotation(bm.guid, SMART_BOOKMARKS_ANNO); - - // Check the created bookmark still exists. - bm = yield PlacesUtils.bookmarks.fetch({ - parentGuid: PlacesUtils.bookmarks.menuGuid, - index: SMART_BOOKMARKS_ON_MENU - }); - Assert.equal(bm.title, "migrated"); - - // Check that we have not imported any new bookmark. - Assert.ok(!(yield PlacesUtils.bookmarks.fetch({ - parentGuid: PlacesUtils.bookmarks.menuGuid, - index: SMART_BOOKMARKS_ON_MENU + 1 - }))); - - Assert.ok(!(yield PlacesUtils.bookmarks.fetch({ - parentGuid: PlacesUtils.bookmarks.toolbarGuid, - index: SMART_BOOKMARKS_ON_MENU - }))); -}); |