forked from koreader/koreader
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[feat] DocumentRegistry: add getProviders() and preferred by weight
This is step one toward "open with". References koreader#3345 * Fix up some mimetypes * Add XHTML to supported filetypes
- Loading branch information
Showing
6 changed files
with
91 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
describe("document registry module", function() | ||
local DocumentRegistry | ||
|
||
setup(function() | ||
require("commonrequire") | ||
DocumentRegistry = require("document/documentregistry") | ||
end) | ||
|
||
it("should get preferred rendering engine", function() | ||
assert.is_equal("Cool Reader Engine", | ||
DocumentRegistry:getProvider("bla.epub").provider_name) | ||
assert.is_equal("MuPDF", | ||
DocumentRegistry:getProvider("bla.pdf").provider_name) | ||
end) | ||
|
||
it("should return all supported rendering engines", function() | ||
local providers = DocumentRegistry:getProviders("bla.epub") | ||
assert.is_equal("Cool Reader Engine", | ||
providers[1].provider.provider_name) | ||
assert.is_equal("MuPDF", | ||
providers[2].provider.provider_name) | ||
end) | ||
end) |