tests: Check args for loadFinished signals.
This commit is contained in:
parent
c1951a8f15
commit
e78d2a8399
@ -628,8 +628,9 @@ class TestJavascriptEscape:
|
|||||||
with open(path, encoding='utf-8') as f:
|
with open(path, encoding='utf-8') as f:
|
||||||
html_source = f.read().replace('%INPUT%', escaped)
|
html_source = f.read().replace('%INPUT%', escaped)
|
||||||
|
|
||||||
with qtbot.waitSignal(webframe.loadFinished, raising=True):
|
with qtbot.waitSignal(webframe.loadFinished, raising=True) as blocker:
|
||||||
webframe.setHtml(html_source)
|
webframe.setHtml(html_source)
|
||||||
|
assert blocker.args == [True]
|
||||||
|
|
||||||
result = webframe.evaluateJavaScript('window.qute_test_result')
|
result = webframe.evaluateJavaScript('window.qute_test_result')
|
||||||
assert result is not None
|
assert result is not None
|
||||||
|
@ -94,8 +94,10 @@ class JSTester:
|
|||||||
**kwargs: Passed to jinja's template.render().
|
**kwargs: Passed to jinja's template.render().
|
||||||
"""
|
"""
|
||||||
template = self._jinja_env.get_template(path)
|
template = self._jinja_env.get_template(path)
|
||||||
with self._qtbot.waitSignal(self.webview.loadFinished, raising=True):
|
with self._qtbot.waitSignal(self.webview.loadFinished,
|
||||||
|
raising=True) as blocker:
|
||||||
self.webview.setHtml(template.render(**kwargs))
|
self.webview.setHtml(template.render(**kwargs))
|
||||||
|
assert blocker.args == [True]
|
||||||
|
|
||||||
def run_file(self, filename):
|
def run_file(self, filename):
|
||||||
"""Run a javascript file.
|
"""Run a javascript file.
|
||||||
|
Loading…
Reference in New Issue
Block a user