Use same representation in webview and quteprocess

Otherwise the "page loaded" message will not be recognized.

Also use percent-encoding to avoid unicode-related bugs on different
systems.
This commit is contained in:
Daniel Schadt 2015-11-20 19:10:14 +01:00
parent 0a9a75c337
commit b776aeac84
2 changed files with 5 additions and 3 deletions

View File

@ -159,7 +159,7 @@ class WebView(QWebView):
return page
def __repr__(self):
url = utils.elide(self.url().toDisplayString(), 100)
url = utils.elide(self.url().toDisplayString(QUrl.EncodeUnicode), 100)
return utils.get_repr(self, tab_id=self.tab_id, url=url)
def __del__(self):

View File

@ -35,7 +35,7 @@ from PyQt5.QtCore import pyqtSignal, QUrl
import testprocess # pylint: disable=import-error
from qutebrowser.misc import ipc
from qutebrowser.utils import log
from qutebrowser.utils import log, utils
def is_ignored_qt_message(message):
@ -229,7 +229,9 @@ class QuteProc(testprocess.Process):
def wait_for_load_finished(self, path, timeout=15000):
"""Wait until any tab has finished loading."""
url = self._path_to_url(path)
url = QUrl(url).toString()
# We really need the same representation that the webview uses in its
# __repr__
url = utils.elide(QUrl(url).toDisplayString(QUrl.EncodeUnicode), 100)
pattern = re.compile(
r"(load status for <qutebrowser.browser.webview.WebView "
r"tab_id=\d+ url='{url}'>: LoadStatus.success|fetch: "