ohos: Emit a load failure when a local file cannot be loaded


Loading a non-existent local file never reached a terminal load status:
the web view stayed in the loading state indefinitely and no LoadFailed
signal was emitted.

The native ArkWeb Web component rejects a missing or otherwise invalid
local path synchronously: loadUrl() throws "Invalid resource path or
file type" instead of delivering the asynchronous onPageBegin and
onErrorReceive callbacks that the load-status signals are built on. As a
result tryLoadUrl() returned false and setUrl() only logged a warning,
leaving the load without any terminal state.

Treat a failing tryLoadUrl() as a load failure and synthesize the
terminal state in setUrl(), so the load always reaches a terminal
status.

The synthesized failure emits a Started status followed by a Failed
status asynchronously, matching the ordering and timing of the native
callback path and the existing stop() implementation.

This makes tst_QWebView::loadNonexistentFileUrl() and the LoadFailed
case of tst_QWebView::loadRequest() pass on OHOS.

Task-number: QTBUG-146838
Pick-to: 6.12
Change-Id: If4e326d6e78ca06b5ad5bdb3b5848b2167353ef5
Reviewed-by: Zbigniew Chyla <zbigniew.chyla@qt.io>
Reviewed-by: SanthoshKumar Selvaraj <santhosh.kumar.selvaraj@qt.io>
commit4635137088d7de90a7301ae12db906e39875fb55
parent34aa91edea523212987345a40ab2ea0c25ffe860
authorDennis Kim <dennis.kim@qt.io>
committerDennis Kim <dennis.kim@qt.io>
commit timeMon, 29 Jun 2026 16:11:30 +0000