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>