mirror of
git://github.com/kovidgoyal/calibre.git
synced 2025-12-28 17:06:02 +01:00
Add build test for Qt WebEngine
This commit is contained in:
parent
921110eb46
commit
f70eed9da3
1 changed files with 18 additions and 0 deletions
|
|
@ -218,7 +218,25 @@ def test_qt(self):
|
|||
if iswindows:
|
||||
from PyQt5.Qt import QtWin
|
||||
QtWin
|
||||
p = QWebEnginePage()
|
||||
|
||||
def callback(result):
|
||||
callback.result = result
|
||||
if hasattr(print_callback, 'result'):
|
||||
Application.instance().quit()
|
||||
|
||||
def print_callback(result):
|
||||
print_callback.result = result
|
||||
if hasattr(callback, 'result'):
|
||||
Application.instance().quit()
|
||||
|
||||
p.runJavaScript('1 + 1', callback)
|
||||
p.printToPdf(print_callback)
|
||||
app.exec_()
|
||||
self.assertEqual(callback.result, 2)
|
||||
self.assertIn(b'Skia/PDF', bytes(print_callback.result))
|
||||
del na
|
||||
del p
|
||||
del app
|
||||
del QWebEnginePage
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue