[Qt][WK2] Fix zero sized views in all QML tests
[WebKit.git] / Source / WebKit2 / UIProcess / API / qt / tests / qmltests / WebView / tst_loadProgressSignal.qml
1 import QtQuick 2.0
2 import QtTest 1.0
3 import QtWebKit 3.0
4
5 WebView {
6     id: webView
7     width: 400
8     height: 300
9
10     SignalSpy {
11         id: spy
12         target: webView
13         signalName: "loadSucceeded"
14     }
15
16     SignalSpy {
17         id: spyProgress
18         target: webView
19         signalName: "loadProgressChanged"
20     }
21
22     TestCase {
23         name: "WebViewLoadProgressSignal"
24
25         function test_loadProgressSignal() {
26             compare(spyProgress.count, 0)
27             compare(webView.loadProgress, 0)
28             webView.load(Qt.resolvedUrl("../common/test1.html"))
29             spyProgress.wait()
30             compare(true, webView.loadProgress > -1 && webView.loadProgress < 101)
31             if (webView.loadProgress > 0 && webView.loadProgress < 100) {
32                 spy.wait()
33                 spyProgress.wait()
34                 compare(webView.loadProgress, 100)
35             }
36         }
37     }
38 }