diff options
author | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
---|---|---|
committer | Matt A. Tobin <mattatobin@localhost.localdomain> | 2018-02-02 04:16:08 -0500 |
commit | 5f8de423f190bbb79a62f804151bc24824fa32d8 (patch) | |
tree | 10027f336435511475e392454359edea8e25895d /toolkit/components/places/tests/migration/test_current_from_v19.js | |
parent | 49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff) | |
download | UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip |
Add m-esr52 at 52.6.0
Diffstat (limited to 'toolkit/components/places/tests/migration/test_current_from_v19.js')
-rw-r--r-- | toolkit/components/places/tests/migration/test_current_from_v19.js | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/toolkit/components/places/tests/migration/test_current_from_v19.js b/toolkit/components/places/tests/migration/test_current_from_v19.js new file mode 100644 index 000000000..b8d837e68 --- /dev/null +++ b/toolkit/components/places/tests/migration/test_current_from_v19.js @@ -0,0 +1,42 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +const ANNO_LEGACYGUID = "placesInternal/GUID"; + +var getTotalGuidAnnotationsCount = Task.async(function* (db) { + let rows = yield db.execute( + `SELECT count(*) + FROM moz_items_annos a + JOIN moz_anno_attributes b ON a.anno_attribute_id = b.id + WHERE b.name = :attr_name + `, { attr_name: ANNO_LEGACYGUID }); + return rows[0].getResultByIndex(0); +}); + +add_task(function* setup() { + yield setupPlacesDatabase("places_v19.sqlite"); +}); + +add_task(function* initial_state() { + let path = OS.Path.join(OS.Constants.Path.profileDir, DB_FILENAME); + let db = yield Sqlite.openConnection({ path: path }); + + Assert.equal((yield getTotalGuidAnnotationsCount(db)), 1, + "There should be 1 obsolete guid annotation"); + yield db.close(); +}); + +add_task(function* database_is_valid() { + Assert.equal(PlacesUtils.history.databaseStatus, + PlacesUtils.history.DATABASE_STATUS_UPGRADED); + + let db = yield PlacesUtils.promiseDBConnection(); + Assert.equal((yield db.getSchemaVersion()), CURRENT_SCHEMA_VERSION); +}); + +add_task(function* test_bookmark_guid_annotation_removed() +{ + let db = yield PlacesUtils.promiseDBConnection(); + Assert.equal((yield getTotalGuidAnnotationsCount(db)), 0, + "There should be no more obsolete GUID annotations."); +}); |