Commit Graph

490 Commits

Author SHA1 Message Date
Benoit Pierre
f1b522acb9 tests: factorize UI related helpers 2024-12-25 17:29:40 +01:00
Benoit Pierre
480eb7e142 tests: speedup random tests 2024-12-25 17:29:40 +01:00
Benoit Pierre
d568b8fbbc tests: cleanup filemanager test
Remove dead code.
2024-12-25 17:29:40 +01:00
Benoit Pierre
e0562f72e5 tests: speedup document tests 2024-12-25 17:29:40 +01:00
Benoit Pierre
646ed9a07f tests: avoid loading unnecessary plugins 2024-12-25 17:29:40 +01:00
Benoit Pierre
cb2d67aac9 tests: drop package.unloadAll workaround
Unnecessary, busted auto-insulation already insulate each test file run.
2024-12-25 17:29:40 +01:00
Benoit Pierre
7a5465bfe6 tests: drop workaround for older busted versions
No necessary anymore, now that we ship our own up-to-date version.
2024-12-25 17:29:40 +01:00
Martín Fernández
e503cc4b9c add provider module (#12641)
* implements a Provider singleton, to be used by thirdparty plugins
* exporter: support for thirdparty providers
* splits plugin loading into two steps: discovery and load
  1. get a list of all candidate plugins to load for the different paths
  2. sort providers before on the rest of them and try to load them
2024-12-18 19:40:22 +01:00
hius07
7444ec53e9 Remove onSetFullScreen() (#12871) 2024-12-09 12:33:16 +02:00
Martín Fernández
162685df50 remove autofrontlight + backgroundrunner (#12809)
* remove autofrontlight
* remove background-runner

thirparty plugins that rely on the backgroundrunner no longer work.
2024-12-06 21:28:56 +01:00
Eric P Hutchins
76a7633531 Translator: add romanizations setting in Translation settings (#12829)
This adds a new setting in "Translation settings" called "Show romanizations" which tells the translation popup to include in the query the parameter dt=rm and then extracts romanizations from the results to display.
2024-12-02 23:05:52 +01:00
Benoit Pierre
d4cc87c502 tests: rename PDF benchmark file
So it's picked up by the bench testsuite.
2024-11-25 22:55:57 +01:00
Benoit Pierre
de676292f6 tests: drop nocov tags 2024-11-25 22:55:57 +01:00
Benoit Pierre
e10017042e tests: tweak tags
Drop `nocov` tag for tests already tagged with `notest`
(already ignored when doing a coverage run).
2024-11-25 22:55:57 +01:00
Benoit Pierre
8c839d9ead tests: improve frontend testsuite isolation 2024-11-25 22:55:57 +01:00
Benoit Pierre
8005275388 tests: improve PDF benchmarks
Factorize and use a proper separate test for each benchmark.

Note: only open the 9 fist pages (reduce memory so benchmarks
can be run on more limited memory devices, like the Kindle).
2024-11-25 22:55:57 +01:00
Benoit Pierre
64dabfa605 tests: speedup persist huge tables test (#12786)
For example on my machine:

| test duration (ms) |  master  |             PR |
| :-                 | -:       | -:             |
| regular run        |   859.82 |  104.38 (÷8.2) |
| coverage run       | 40735.60 | 4151.34 (÷9.8) |
2024-11-23 19:28:57 +01:00
Benoit Pierre
fbde771306 tests: speedup readhistory reduce test (#12785)
For example on my machine:

| test duration (ms) |  master  |             PR |
| :-                 | -:       | -:             |
| regular run        |  2645.94 | 106.83 (÷24.8) |
| coverage run       | 26133.27 | 641.59 (÷40.7) |
2024-11-23 17:54:46 +01:00
hius07
47feaaa1df Highlights: page boxes cache (#12768) 2024-11-23 14:05:05 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
Benoit Pierre
0c0d2ab9f1 input: drop use of ffi/input
Get rid of the weird interaction between device implementations,
`ffi.util` (`isSDL`, `noSDL`) and the device input code: each
device knows if it's using SDL or not, so rely on that to load
the right underlying input implementation.
2024-09-24 16:08:58 +02:00
NiLuJe
da74691515 Chore: Don't cache static data tables (ui/elements, ui/data, kb layouts & co) (#12519)
Using `require` didn't make much sense since most of them are only used in a single place anyway, and it takes care of a few weird interactions in the process (besides not polluting `package.loaded` with useless crap ;)).
2024-09-16 17:11:42 +02:00
hius07
e5fb836a81 ReaderFooter: improve (#12243) 2024-08-01 13:11:28 +03:00
Benoit Pierre
99d45d7584 djvu: honor render mode when reflowing 2024-07-19 21:32:20 +02:00
Benoit Pierre
36154f4747 tests/opds: fix no longer valid feedbooks.com URLs (#12185) 2024-07-19 18:58:32 +02:00
Benoit Pierre
99447414dc mupdf: update to 1.24.2 (#11940)
Depends on https://github.com/koreader/koreader-base/pull/1805.

Closes:
- #5422 
- #9927
- #10879
2024-06-01 13:22:02 +02:00
Benoit Pierre
5a465f413b tweaks for new build system
- forward unknown make targets to base
- add `cmake` and `staging` directories to ignored output artifacts
- drop `package.path` and `package.cpath` luarocks specific entries
2024-05-29 22:02:06 +02:00
SomeGuy
e859109885 Status bar: major UI makeover (#11678) 2024-05-21 21:13:53 +02:00
Benoit Pierre
075edf9980 tests/readerhighlight: speedup
Reduce time to run those tests by 74% on my machine (~8.8s → ~2.3s).
2024-05-09 14:04:57 +02:00
Benoit Pierre
554e8daf99 tests/readerhighlight: avoid changing versioned files
Work on a copy of `test/sample.pdf`.
2024-05-09 14:04:57 +02:00
Benoit Pierre
089c19cb39 tests/readerbookmark: avoid changing versioned files
Work on a copy of `test/sample.pdf`.
2024-05-09 14:04:57 +02:00
Benoit Pierre
3e809b6c7b tests/readerlink: speedup
Reduce time to run those tests by 95% on my machine (~17s → 0.8s).
2024-05-09 14:04:57 +02:00
Benoit Pierre
fdf19e98c3 tests/readerlink: factorize setup/teardown code 2024-05-09 14:04:57 +02:00
Benoit Pierre
d0ca04c48d tests/readerlink: reorganize
Group tests by file type (EPUB or PDF).
2024-05-09 14:04:57 +02:00
Benoit Pierre
b67c6147d5 tests: ensure successive testsuite runs work
Don't carry over some old settings. Additionally, avoid clobbering the standard reader settings.
2024-05-09 14:04:57 +02:00
Benoit Pierre
821120828b tests: fix EPUB test (#11776)
The `droid sans fallback` test incorrectly assumes `Droid Sans Mono`
will be the first font in the list of fallback fonts, but the list
is alphabetically sorted.

Cf. https://github.com/koreader/koreader/pull/10566
2024-05-08 20:03:40 +02:00
hius07
d82815952e Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
2024-05-03 09:08:57 +03:00
hugleo
b026f84949 ReaderZooming: make auto-crop default be page content (#11438) 2024-03-14 00:15:10 +01:00
NiLuJe
33b54f5574 Kindle: Add a hasLightSensor devcap, and use it in the AutoFrontlight plugin (#11255)
Add the Scribe to the list while we're there
2023-12-24 17:15:30 +01:00
hius07
aabd6d7a26 File browser, Collection: improve group actions (#11178)
Maintain correct records in History and Favorites when moving/deleting folders or group of files.
Optimize Collection module to minimize storage requests.
2023-12-10 08:05:34 +02:00
NiLuJe
9af3e95d9d Kindle: Fix a smattering of frontlight bugs
* afterResume had *two* different implementations, so the historical one
  that handled frontlight fixups no longer ran
  (regression since #10426)
* isFrontlightOn was completely broken, for a couple of reasons:
  * There was no is isFrontlightOnHW implementation, so when it ran, it
    mostly always thought the frontlight was on, because
    self.fl_intensity doesn't change on toggle off.
  * _decideFrontlightState was never called on Kindle,
    so isFrontlightOnHW was never really called, making isFrontlightOn
    completely useless. Call it in setIntensityHW's coda, as it ought to
    be. And properly document that.

Generic *was* calling _decideFrontlightState is setIntensity, but
*before* actually setting the frontlight, which makes no goddamn sense,
so get rid of that, too.

* Also fix frontlight toggle notifications (regression since #10305)

TL;DR: The PowerD API being a mess strikes again.
2023-11-25 20:53:36 +01:00
Wim de With
17a4aa962f Fix connection bug with non-ASCII SSIDs in wpa_supplicant (#11089)
* Bump base

includes:

koreader/koreader-base#1691
koreader/koreader-base#1692
koreader/koreader-base#1689
koreader/koreader-base#1690
koreader/koreader-base#1693

* Integrate decoding of SSIDs within wpa_supplicant

The UTF-8 decoding of SSIDs is specific to wpa_supplicant. In this
patch, we move all of this decoding logic to the wpa_supplicant module.
We expose the raw bytes of the SSID to the NetworkMgr code, and make
sure to always fix bad UTF-8 before we display the SSID to the user.

Within the wpa_supplicant module, we replace the call to the
wpa_passphrase binary to get the PSK with a direct function call to
OpenSSL. This allows us to calculate the PSK over any arbitrary bytes,
including UTF-8. In the same vein, we use the hex-encoded SSID to
communicate with wpa_supplicant when setting up the network to support
arbitrary bytes in the SSID.

Unfortunately, we also remove the tests, as there is no way to unit test
local functions.
2023-11-09 21:08:26 +01:00
hius07
b70f866656 DocSettings (again) (#11020)
Cleaning and optimizing Docsettings code.
2023-10-31 07:30:39 +02:00
hius07
2ed2c2c23d md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
2023-10-15 07:47:09 +03:00
poire-z
5ec736ae96 ReaderToc: rework getChapterPageCount/Left/Done()
Rework the way they are computed, fixing issues with hidden
flows when they don't coincide with chapter starts.
2023-10-09 00:15:05 +02:00
Benoit Pierre
8f6fae81fa tests: tag tests relying on a working internet access (#10939)
So they can easily be filtered-out when offline.
2023-09-24 18:18:03 +02:00
Wim de With
599a3034ca NetworkManager: Decode SSID to UTF-8 (#10864)
wpa_supplicant returns all non-ASCII SSIDs as raw bytes in the form
\x0a. We interpret these bytes as UTF-8, and make sure that all invalid
characters are replaced with a �.
2023-08-31 19:29:30 +02:00
NiLuJe
a15fc0e9a5 Revert "Test: Fiw readerhighlight test"
This reverts commit c23c422f62.
2023-08-15 21:24:11 +02:00
NiLuJe
66d2930e5e Revert "Tests: "Unbreak" some more tests"
This reverts commit f4dd0f92b2.
2023-08-15 21:24:11 +02:00
NiLuJe
e63c613626 Tests: "Unbreak" some more tests
This is horrible and needs to burn in a fire.
2023-08-15 21:24:11 +02:00