Commit graph

115 commits

Author SHA1 Message Date
Adomas Ven
747c11c917 Improves proxy support (#1129)
Improves proxy support

- Automatically detect and dehyphenise https proxies which use EZProxy
  HttpsHyphens
- Web translators now pass around Zotero.Proxy instances which can
  proxify/deproxify urls passed to `translate.setLocation()` before calling
  `translate.getTranslators()`/ translate.detect()`. The proxy passing is
  done within connector background/injected processes and between
  standalone and connectors.
- Proxy protocol unified with connectors. Connectors can now pass
  proxies to `/connector/save_items`. The proxies will be used to resolve
  true item and attachment urls when saving.

Closes zotero/zotero#578, zotero/zotero#721

Relevant zotero/zotero#34, zotero/zotero#556
2016-12-12 14:29:59 +02:00
Dan Stillman
4f44cc10ce Avoid CustomizableUI warnings in console after resetDB() during tests 2016-11-30 21:18:31 -05:00
Dan Stillman
8f0ed56ae2 Test fixes after 5bceebf56c 2016-11-29 03:52:07 -05:00
Dan Stillman
5bceebf56c Reset Zotero prefs after each suite and when resetting DB
But keep prefs set in runtests.sh
2016-11-29 03:27:44 -05:00
Dan Stillman
a735d5dd41 Remove Travis debugging 2016-11-27 20:02:53 -05:00
Dan Stillman
3a9cd31d42 Travis debugging 2016-11-27 19:46:12 -05:00
Dan Stillman
5a6f1eef63 Update deprecated uses of Zotero.getZoteroDirectory()/getZoteroDatabase()
The Zotero.DataDirectory equivalents return string paths instead of nsIFile
instances, so some of these calls now just use Zotero.File.pathToFile(), which
can be removed when the surrounding code is updated to OS.File,
2016-11-27 00:17:56 -05:00
Dan Stillman
4c0abb6816 Point other profiles to new data dir after migration (+ code reorg)
Look for other profiles, from both apps (Firefox and Standalone), that
point to the data directory being migrated and update prefs.js in those
profiles to point to the new location.

Also reorganize code into Zotero.Profile and Zotero.DataDirectory
namespaces
2016-11-27 00:17:56 -05:00
Dan Stillman
6d07cb44df Fix Travis errors due to broken DirectoryIterator 2016-11-19 18:52:10 -05:00
Adomas Venčkauskas
5d17ff3f53 Implements #1021 on Z4fx extension 2016-09-27 17:43:56 +03:00
Adomas Venčkauskas
7608e127f1 Fix nested translators that rely on child translator tags 2016-09-21 11:54:56 +03:00
Adomas Venčkauskas
e83bbbad4e Fix getTranslatorCode bugs
- /connector/getTranslatorCode used to respond with empty content
- CodeGetter froze connectors by issuing hundreds of simultanious XHR
  requests
2016-09-20 15:55:58 +03:00
Dan Stillman
08b62f41e0 Log opened windows in waitForWindow() test support function 2016-09-06 19:16:30 -04:00
Dan Stillman
0eb6dc9ca5 Merge branch '4.0' 2016-08-09 01:52:21 -04:00
Dan Stillman
ed9e655871 Pass correct event name to removeEventListener in support function 2016-07-23 16:27:44 -04:00
Dan Stillman
ac34f2c4f4 Allow additional options for support test functions
- libraryVersion for createGroup()
- Zotero.Item save options for importFileAttachment()
2016-07-19 18:54:37 -04:00
Dan Stillman
c1f7a188e2 Fix error modifying existing saved search with more than 1 condition
Closes #1056, which wasn't actually the problem
2016-07-07 07:55:15 -04:00
Dan Stillman
5740d4729d Use random title in search condition in createDataObject() test function
Can be retrieved with search.getConditions()[0].value and included in an item
title to have an item match the created search
2016-07-06 02:04:53 -04:00
Dan Stillman
7e5b46b146 Merge pull request #1048 from adomasven/fix/linux-test-failures
Fixes freezing occuring on linux while running tests
2016-06-25 07:30:35 -04:00
Dan Stillman
2d88b07855 Set Zotero.automatedTest flag instead of .noUserInput on Travis
And don't skip alerts in Zotero.alert() during automated tests. (That
was intended to avoid long timeouts after unexpected failures, but,
e.g., PDF metadata lookups (which are currently disabled in automated
tests) should just be mocked so they don't intermittently fail.)
2016-06-24 18:28:32 -04:00
Adomas Venčkauskas
3f25d64984 Fixes freezing occuring on linux while running tests
server_connectorTest - alternating port prevents
exceptions not catchable in JS for httpd server when the socket
and the port remains open after httpd.stop() callback

support - changes the window on which `setTimeout()` is ran in dialogs.
If the timeout is ran on the main window the `dialog` object appears to
lose certain properties and not respond to interactions completely.
2016-06-23 16:15:48 +03:00
Dan Stillman
c2dd531cec Fix waitForDialog() with modal dialogs in popup windows (e.g., prefs) 2016-06-22 15:46:44 -04:00
Dan Stillman
6b0be91bf4 Clear lastViewedFolder pref when resetting DB during tests 2016-05-23 00:59:16 -04:00
Dan Stillman
2a8cd27b49 Increase default test timeout to 10000 2016-04-26 21:46:05 -04:00
Dan Stillman
4e50b7ddc2 Increase default test timeout to 10 seconds on Travis
Maybe this will fix some of the intermittent failures...
2016-04-26 02:43:44 -04:00
Dan Stillman
0469d6506a Show toolbar icon and collections pane while items are loading
Items in a library are now loaded only when a library is clicked on and
at sync time. There might be some other areas where they need to be
loaded or where this causes problems (e.g., drag and drop, word
processor integration).
2016-04-10 19:01:36 -04:00
Dan Stillman
35530af1fb Gzip-compress API uploads larger than 1000 characters 2016-03-28 02:38:28 -04:00
Dan Stillman
b7b246e741 Saved search fixes
- Fix saved search editing
- Refresh items list on search change
- Generate correct conditions array for search JSON
2016-03-26 04:14:56 -04:00
Dan Stillman
6c43e75d26 Merge pull request #902 from adomasven/feature/feed-reader-UI
Feed Reader UI

(I squashed a bunch of commits from the PR.)
2016-03-22 07:31:03 -04:00
Adomas Venčkauskas
12fc6cfbe8 Various feeds changes
- Hide notes, tags and related for feed items in itembox
- Add feed support for <enclosure> elements
- Add feed syncing methods for synced settings (additional work is
  needed on the sync architecture to download synced settings from the
  server)
- Change feed item clear policy to be less aggressive
- Adjust for deasyncification
- Disable translate-on-select
- Close adomasven/zotero#7, Remove context menu items from feeds
2016-03-22 06:56:36 -04:00
Adomas Venčkauskas
e6ede4b36f Various feeds changes
And move Z.Attachments.cleanAttachmentURI() to Z.Utilities.cleanURL()
2016-03-22 06:56:30 -04:00
Adomas Venčkauskas
8a2dc6e7f2 Adds Zotero.FeedReader tests 2016-03-22 06:56:29 -04:00
Dan Stillman
74cf2a3c22 Fix hang on import that includes an HTML attachment
Closes #734, for the moment
2016-03-22 01:31:20 -04:00
Dan Stillman
e70f2164c1 Fix broken support test after 220cf2c29 2016-03-21 01:33:37 -04:00
Dan Stillman
20ece48a57 Fix saving of single files to library root via save button 2016-03-21 01:30:16 -04:00
Dan Stillman
b9444892a0 Ring bell on test error if interactive shell 2016-03-15 01:18:55 -04:00
Dan Stillman
6b509820b3 Fixes #918, Enabling "Show Unfiled Items" or "Show Duplicates" breaks UI 2016-03-13 20:31:15 -04:00
Dan Stillman
daf4a8fe4d Deasyncification 🔙 😢
While trying to get translation and citing working with asynchronously
generated data, we realized that drag-and-drop support was going to
be...problematic. Firefox only supports synchronous methods for
providing drag data (unlike, it seems, the DataTransferItem interface
supported by Chrome), which means that we'd need to preload all relevant
data on item selection (bounded by export.quickCopy.dragLimit) and keep
the translate/cite methods synchronous (or maintain two separate
versions).

What we're trying instead is doing what I said in #518 we weren't going
to do: loading most object data on startup and leaving many more
functions synchronous. Essentially, this takes the various load*()
methods described in #518, moves them to startup, and makes them operate
on entire libraries rather than individual objects.

The obvious downside here (other than undoing much of the work of the
last many months) is that it increases startup time, potentially quite a
lot for larger libraries. On my laptop, with a 3,000-item library, this
adds about 3 seconds to startup time. I haven't yet tested with larger
libraries. But I'm hoping that we can optimize this further to reduce
that delay. Among other things, this is loading data for all libraries,
when it should be able to load data only for the library being viewed.
But this is also fundamentally just doing some SELECT queries and
storing the results, so it really shouldn't need to be that slow (though
performance may be bounded a bit here by XPCOM overhead).

If we can make this fast enough, it means that third-party plugins
should be able to remain much closer to their current designs. (Some
things, including saving, will still need to be made asynchronous.)
2016-03-07 17:03:58 -05:00
Dan Stillman
e119e5bf0d Extra logging for waitForWindow() support function 2016-02-03 01:20:11 -05:00
Dan Stillman
e873617890 Fix trashing of descendant items when deleting a collection
Also allows 'collections' property to be passed to
createDataObject()/createUnsavedDataObject() in tests.
2016-01-18 13:50:46 -05:00
Dan Stillman
07fbda2b72 Add "[FAIL]" to test failures, for easier searching of output 2016-01-07 16:49:12 -05:00
Dan Stillman
c5a9987f37 WebDAV file sync overhaul for 5.0
Also:

- Remove last-sync-time mechanism for both WebDAV and ZFS, since it can
  be determined by storage properties (mtime/md5) in data sync
- Add option to include synced storage properties in item toJSON()
  instead of local file properties
- Set "Fake-Server-Match" header in setHTTPResponse() test support
  function, which can be used for request count assertions -- see
  resetRequestCount() and assertRequestCount() in webdavTest.js
- Allow string (e.g., 'to_download') instead of constant in
  Zotero.Sync.Data.Local.setSyncState()
- Misc storage tweaks
2015-12-30 05:14:50 -05:00
Dan Stillman
cfee7ea9d2 Merge pull request #879 from adomasven/feature/transparent-api-keygen
Restores the functionality of 4.0 for sync settings
2015-12-14 19:28:56 -05:00
Adomas Venčkauskas
ffd9a07164 Restores sync credential functionality of 4.0.
Improves UX of sync authentication.
The account is now linked and unlinked and an API key related to
the client is generated transparently in the background.
The API key is deleted on unlinking.
No sync options are allowed before linking an account.
2015-12-14 23:55:28 +00:00
Dan Stillman
177dac3fd2 Closes #805, Translation shouldn't create new item in My Publications
And in download overlay, save and switch to My Library if My
Publications is selected.
2015-12-10 01:11:41 -05:00
Dan Stillman
18349b2232 Restore certificate checking for API syncing errors
Closes #864

This adds a 'channel' property to Zotero.HTTP.UnexpectedStatusException,
because the 'channel' property of the XHR can be garbage-collected
before handling, and the channel's 'securityInfo' property is necessary
to detect certificate errors.
2015-12-09 04:11:27 -05:00
Dan Stillman
57dfd1885d Allowing passing window to loadZoteroPane() support function 2015-11-15 17:49:31 -05:00
Dan Stillman
ae277391b6 Miscellaneous tweaks 2015-11-12 02:48:41 -05:00
Dan Stillman
7633c7de30 Set test timeout in resetDB() instead of separate this.timeout() calls
'thisArg: this' should be passed to resetDB to have it adjust the
timeout
2015-09-29 04:42:12 -04:00
Aurimas Vinckevicius
d122323dbf Fix fullText tests on Windows 2015-09-21 17:08:22 -05:00