+2012-04-13 Dinu Jacob <dinu.jacob@nokia.com>
+
+ [Qt][WK2] Title in MiniBrowser is not updated for a page with no title
+ https://bugs.webkit.org/show_bug.cgi?id=82483
+
+ Reviewed by Noam Rosenthal.
+
+ This fixes API tests broken by r113715.
+
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml:
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_preferences.qml:
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_titleChanged.qml:
+
2012-04-13 Sheriff Bot <webkit.review.bot@gmail.com>
Unreviewed, rolling out r113714.
import QtWebKit 3.0
import QtWebKit.experimental 1.0
import Test 1.0
+import "../common"
-WebView {
+TestWebView {
id: webView
width: 400
height: 300
]
}
- SignalSpy {
- id: spyTitle
- target: webView
- signalName: "titleChanged"
- }
-
ByteArrayTestData {
id: byteArrayHelper
}
name: "WebViewApplicationSchemes"
function test_applicationScheme() {
- spyTitle.clear()
- compare(spyTitle.count, 0)
var testUrl = "applicationScheme://something"
webView.url = testUrl
- spyTitle.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Test Application Scheme")
}
function test_multipleSchemes() {
// Test if we receive the right reply when defining multiple schemes.
- spyTitle.clear()
- compare(spyTitle.count, 0)
var testUrl = "scheme2://some-url-string"
webView.url = testUrl
- spyTitle.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Scheme2 Reply")
testUrl = "scheme1://some-url-string"
webView.url = testUrl
- spyTitle.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Scheme1 Reply")
-
- compare(spyTitle.count, 2)
}
function test_multipleUrlsForScheme() {
- spyTitle.clear()
- compare(spyTitle.count, 0)
var testUrl = "scheme3://url1"
- webView.url = testUrl
- spyTitle.wait()
+ webView.url = testUrl
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Scheme3 Reply1")
testUrl = "scheme3://url2"
- webView.url = testUrl
- spyTitle.wait()
+ webView.url = testUrl
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Scheme3 Reply2")
- compare(spyTitle.count, 2)
}
- function test_charsets() {
- spyTitle.clear()
- compare(spyTitle.count, 0)
+ function test_charsets() {
var testUrl = "schemeCharset://latin1"
webView.url = testUrl
- spyTitle.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "title with copyright ©")
testUrl = "schemeCharset://utf-8"
webView.url = testUrl
- spyTitle.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "title with copyright ©")
}
}
function test_standardFontFamilyChanged() {
var url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-family")
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, defaultStandardFontFamily)
standardFontFamilySpy.wait()
compare(standardFontFamilySpy.count, 1)
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, "foobar")
}
function test_fontSizeChanged() {
var url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-size")
webView.url = url
- titleSpy.wait()
- compare(webView.title, "Original Title")
+ verify(webView.waitForLoadSucceeded())
+ compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, defaultFontSize.toString() + "px")
defaultFontSizeSpy.wait()
compare(defaultFontSizeSpy.count, 1)
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, (defaultFontSize + 1).toString() + "px")
}
function test_fixedFontSizeChanged() {
var url = Qt.resolvedUrl("../common/font-preferences.html?fixed#font-size")
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, defaultFixedFontSize.toString() + "px")
defaultFixedFontSizeSpy.wait()
compare(defaultFixedFontSizeSpy.count, 1)
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, (defaultFixedFontSize + 1).toString() + "px")
webView.url = Qt.resolvedUrl("../common/font-preferences.html?standard#font-size")
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, defaultFontSize.toString() + "px")
}
verify(defaultMinimumFontSize < defaultFontSize)
var url = Qt.resolvedUrl("../common/font-preferences.html?minimum#font-size")
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
var smallerFontSize = webView.title
smallerFontSize = smallerFontSize.substring(0, smallerFontSize.length - 2)
minimumFontSizeSpy.wait()
compare(minimumFontSizeSpy.count, 1)
webView.url = url
- titleSpy.wait()
+ verify(webView.waitForLoadSucceeded())
compare(webView.title, "Original Title")
+ titleSpy.clear()
+
titleSpy.wait()
compare(webView.title, defaultFontSize.toString() + "px")
}