commit 640aaa15576e23bc85aefe8872c11896c5e7de75
parent b732a82d556501e772c6ff3a19d21491732c7bca
Author: Dan Stillman <dstillman@zotero.org>
Date: Mon, 13 Mar 2017 15:59:50 -0700
Add loadPrefPane(paneName) support function
E.g., loadPrefPane('sync') to open the prefs and select the
'zotero-pane-sync' pane
Diffstat:
1 file changed, 16 insertions(+), 0 deletions(-)
diff --git 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,