Skip to content

Commit bfdf117

Browse files
committed
BUG: Fix py_WebEngine test
git-svn-id: http://svn.slicer.org/Slicer4/trunk@27716 3bd1e089-480b-0410-8dfb-8563597acbee
1 parent aa5b875 commit bfdf117

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Applications/SlicerApp/Testing/Python/WebEngine.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,14 @@ def test_WebEngine1(self):
170170
webWidget.evalJS("valueFromSlicer;");
171171

172172
iteration = 0
173-
while not self.gotResponse:
174-
self.delayDisplay('Waiting for response...')
173+
while not self.gotResponse and iteration < 3:
174+
# Specify an explicit delay to ensure async execution by the
175+
# webengine has completed.
176+
self.delayDisplay('Waiting for response...', msec=500)
175177
iteration += 1
176178
webWidget.disconnect("evalResult(QString,QString)", self.onEvalResult)
177179

178-
if iteration >= 10:
180+
if not self.gotResponse:
179181
raise RuntimeError("Never got response from evalJS")
180182

181183
if not self.gotCorrectResponse:

0 commit comments

Comments
 (0)