From dc2fe37c666bb7df0fbb4bca10dc1e0e002fbb25 Mon Sep 17 00:00:00 2001 From: Thom Chiovoloni Date: Tue, 28 Nov 2017 17:35:51 -0500 Subject: [PATCH] Bug 1421452 - Fix deprecation warning in test_bookmark_engine by passing an osfile path instead of nsifile. r=markh MozReview-Commit-ID: 4XrzA0kUXzE --HG-- extra : rebase_source : bed7a594b854969dd1932449f43ade4dc068ffeb --- services/sync/tests/unit/test_bookmark_engine.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/services/sync/tests/unit/test_bookmark_engine.js b/services/sync/tests/unit/test_bookmark_engine.js index 7da8d175ac0e..1fff0a46d413 100644 --- a/services/sync/tests/unit/test_bookmark_engine.js +++ b/services/sync/tests/unit/test_bookmark_engine.js @@ -4,6 +4,7 @@ Cu.import("resource://gre/modules/BookmarkHTMLUtils.jsm"); Cu.import("resource://gre/modules/BookmarkJSONUtils.jsm"); Cu.import("resource://gre/modules/Log.jsm"); +Cu.import("resource://gre/modules/osfile.jsm"); Cu.import("resource://services-common/utils.js"); Cu.import("resource://services-sync/constants.js"); Cu.import("resource://services-sync/engines.js"); @@ -253,13 +254,12 @@ async function test_restoreOrImport(aReplace) { }); _(`Get Firefox!: ${bmk1.guid}`); - let backupFile = Services.dirsvc.get("TmpD", Ci.nsIFile); + let backupFilePath = OS.Path.join( + OS.Constants.Path.tmpDir, `t_b_e_${Date.now()}.json`); _("Make a backup."); - backupFile.append("t_b_e_" + Date.now() + ".json"); - _(`Backing up to file ${backupFile.path}`); - await bookmarkUtils.exportToFile(backupFile.path); + await bookmarkUtils.exportToFile(backupFilePath); _("Create a different record and sync."); let bmk2 = await PlacesUtils.bookmarks.insert({ @@ -289,7 +289,7 @@ async function test_restoreOrImport(aReplace) { do_check_eq(wbos[0], bmk2.guid); _(`Now ${verb} from a backup.`); - await bookmarkUtils.importFromFile(backupFile, aReplace); + await bookmarkUtils.importFromFile(backupFilePath, aReplace); let bookmarksCollection = server.user("foo").collection("bookmarks"); if (aReplace) {