Fix scroll_anchor in javascript tests.

It seems scrollRequested doesn't actually get emitted.
This commit is contained in:
Florian Bruhin 2015-06-07 10:38:58 +02:00
parent d887623377
commit e98a05e53d

View File

@ -80,8 +80,10 @@ class JSTester:
def scroll_anchor(self, name):
"""Scroll the main frame to the given anchor."""
page = self.webview.page()
with self._qtbot.waitSignal(page.scrollRequested, raising=True):
page.mainFrame().scrollToAnchor(name)
old_pos = page.mainFrame().scrollPosition()
page.mainFrame().scrollToAnchor(name)
new_pos = page.mainFrame().scrollPosition()
assert old_pos != new_pos
def load(self, path, **kwargs):
"""Load and display the given test data.