diff --git a/test/content/support.js b/test/content/support.js index 0e70ac5e3..a53346a8c 100644 --- a/test/content/support.js +++ b/test/content/support.js @@ -58,6 +58,22 @@ var loadZoteroPane = Zotero.Promise.coroutine(function* (win) { return win; }); +var loadPrefPane = Zotero.Promise.coroutine(function* (paneName) { + var id = 'zotero-prefpane-' + paneName; + var win = yield loadWindow("chrome://zotero/content/preferences/preferences.xul", { + pane: id + }); + var doc = win.document; + var defer = Zotero.Promise.defer(); + var pane = doc.getElementById(id); + if (!pane.loaded) { + pane.addEventListener('paneload', () => defer.resolve()); + yield defer.promise; + } + return win; +}); + + /** * Waits for a window with a specific URL to open. Returns a promise for the window, and * optionally passes the window to a callback immediately for use with modal dialogs,