diff options
author | Peter Varga <pvarga@inf.u-szeged.hu> | 2018-02-07 17:05:37 +0100 |
---|---|---|
committer | Peter Varga <pvarga@inf.u-szeged.hu> | 2018-02-21 14:51:19 +0000 |
commit | 732d09331c1e4efa51501aae9bcd6924eecdd5c3 (patch) | |
tree | 2376a15e9a7f91f91087f9681e09f4ce2c6961ca /tests/auto/quick/qmltests/data/tst_loadHtml.qml | |
parent | 5983f75003dde37b5429b126149b3bcc6c02d4dc (diff) |
Expose actual URL for data URLs instead of the virtual URL in the API
Chromium considers the actual URL as "scary" therefore prefers to pass a
simpler URL via the WebContents::GetVisibleURL() content API function.
For data URLs, use the actual URL instead to keep their anchor
information.
Task-number: QTBUG-64972
Change-Id: I74db3e5dd22a728656a58e50a4e3fba93b82dae2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'tests/auto/quick/qmltests/data/tst_loadHtml.qml')
-rw-r--r-- | tests/auto/quick/qmltests/data/tst_loadHtml.qml | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tests/auto/quick/qmltests/data/tst_loadHtml.qml b/tests/auto/quick/qmltests/data/tst_loadHtml.qml index f814822dc..73b6139e2 100644 --- a/tests/auto/quick/qmltests/data/tst_loadHtml.qml +++ b/tests/auto/quick/qmltests/data/tst_loadHtml.qml @@ -35,8 +35,15 @@ TestWebEngineView { width: 200 height: 400 + SignalSpy { + id: urlChangedSpy + target: webEngineView + signalName: "urlChanged" + } + TestCase { name: "WebEngineViewLoadHtml" + when: windowShown function test_loadProgressAfterLoadHtml() { compare(webEngineView.loadProgress, 0) @@ -44,5 +51,18 @@ TestWebEngineView { verify(webEngineView.waitForLoadSucceeded()) compare(webEngineView.loadProgress, 100) } + + function test_dataURLFragment() { + webEngineView.loadHtml("<html><body>" + + "<a id='link' href='#anchor'>anchor</a>" + + "</body></html>"); + verify(webEngineView.waitForLoadSucceeded()); + + urlChangedSpy.clear(); + var center = getElementCenter("link"); + mouseClick(webEngineView, center.x, center.y); + urlChangedSpy.wait(); + compare(webEngineView.url.toString().split("#")[1], "anchor"); + } } } |