-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 (#…
…3651) This is step one toward "open with". References #3345 * Fix up some mimetypes * Add XHTML to supported filetypes * Add a few image files to MuPDF * ".bmp", * ".gif", * ".hdp", * ".j2k", * ".jp2", * ".jpeg", * ".jpg", * ".jpx", * ".jxr", * ".pam", * ".pbm", * ".pgm", * ".png", * ".pnm", * ".ppm", * ".tif", * ".tiff", * ".wdp",
- Loading branch information
Showing
6 changed files
with
119 additions
and
32 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) |