diff --git a/addon-sdk/source/test/addons/places/lib/places-helper.js b/addon-sdk/source/test/addons/places/lib/places-helper.js index 8107b4eae0b..fb6cc631328 100644 --- a/addon-sdk/source/test/addons/places/lib/places-helper.js +++ b/addon-sdk/source/test/addons/places/lib/places-helper.js @@ -143,6 +143,11 @@ function createBookmark (data) { } exports.createBookmark = createBookmark; +function historyBatch () { + hsrv.runInBatchMode(() => {}, null); +} +exports.historyBatch = historyBatch; + function createBookmarkItem (data) { let deferred = defer(); data = data || {}; diff --git a/addon-sdk/source/test/addons/places/lib/test-places-events.js b/addon-sdk/source/test/addons/places/lib/test-places-events.js index 7cdff1812cc..e31385238ff 100644 --- a/addon-sdk/source/test/addons/places/lib/test-places-events.js +++ b/addon-sdk/source/test/addons/places/lib/test-places-events.js @@ -29,7 +29,7 @@ const { search } = require('sdk/places/history'); const { invalidResolve, invalidReject, createTree, createBookmark, compareWithHost, addVisits, resetPlaces, createBookmarkItem, - removeVisits + removeVisits, historyBatch } = require('./places-helper'); const { save, MENU, UNSORTED } = require('sdk/places/bookmarks'); const { promisedEmitter } = require('sdk/places/utils'); @@ -236,9 +236,8 @@ exports['test history-start-batch, history-end-batch, history-start-clear'] = fu on(startEvent, 'data', startHandler); on(clearEvent, 'data', clearHandler); - createBookmark().then(() => { - resetPlaces(complete); - }) + historyBatch(); + resetPlaces(complete); }; exports['test history-visit, history-title-changed'] = function (assert, done) {