[Qt][WK2] Implement loadHtml API for QQuickWebView
[WebKit.git] / Source / WebKit2 / UIProcess / API / qt / tests / qmltests / WebView / tst_loadHtml.qml
1 import QtQuick 2.0
2 import QtTest 1.0
3 import QtWebKit 3.0
4
5 WebView {
6     id: webView
7     width: 200
8     height: 400
9
10     SignalSpy {
11         id: loadSpy
12         target: webView
13         signalName: "loadSucceeded"
14     }
15
16     TestCase {
17         name: "WebViewLoadHtml"
18
19         function test_loadProgressAfterLoadHtml() {
20             loadSpy.clear()
21             compare(loadSpy.count, 0)
22             compare(webView.loadProgress, 0)
23             webView.loadHtml("<html><head><title>Test page 1</title></head><body>Hello.</body></html>")
24             loadSpy.wait()
25             compare(webView.loadProgress, 100)
26         }
27     }
28 }