+2012-01-24 Zeno Albisser <zeno@webkit.org>
+
+ [Qt][WK2] Add test for application URL schemes.
+ https://bugs.webkit.org/show_bug.cgi?id=74933
+
+ Add a test that checks handling of url strings.
+ Add a test that verifies replies in case of multiple
+ available application url schemes.
+
+ Reviewed by Kenneth Rohde Christiansen.
+
+ * UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml:
+
2012-01-24 Carlos Garcia Campos <cgarcia@igalia.com>
[GTK] Fix /webkit2/WebKitWebView/reload after r105688
reply.data = "<html><head><title>Test Application Scheme</title></head><body>A test page.</body></html>"
reply.send()
}
+ },
+ UrlSchemeDelegate {
+ scheme: "scheme1"
+ onReceivedRequest: {
+ reply.data = "<html><head><title>Scheme1 Reply</title></head><body>A test page.</body></html>"
+ reply.send()
+ }
+ },
+ UrlSchemeDelegate {
+ scheme: "scheme2"
+ onReceivedRequest: {
+ reply.data = "<html><head><title>Scheme2 Reply</title></head><body>A test page.</body></html>"
+ reply.send()
+ }
+ },
+ UrlSchemeDelegate {
+ scheme: "scheme3"
+ onReceivedRequest: {
+ if (request.url == "scheme3://url1")
+ reply.data = "<html><head><title>Scheme3 Reply1</title></head><body>A test page.</body></html>"
+ else if (request.url == "scheme3://url2")
+ reply.data = "<html><head><title>Scheme3 Reply2</title></head><body>A test page.</body></html>"
+ else
+ reply.data = "<html><head><title>Should not happen</title></head><body>A test page.</body></html>"
+ reply.send()
+ }
}
]
}
name: "WebViewApplicationSchemes"
function test_applicationScheme() {
+ spyTitle.clear()
compare(spyTitle.count, 0)
var testUrl = "applicationScheme://something"
webView.load(testUrl)
spyTitle.wait()
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.load(testUrl)
+ spyTitle.wait()
+ compare(webView.title, "Scheme2 Reply")
+
+ testUrl = "scheme1://some-url-string"
+ webView.load(testUrl)
+ spyTitle.wait()
+ compare(webView.title, "Scheme1 Reply")
+
+ compare(spyTitle.count, 2)
+ }
+
+ function test_multipleUrlsForScheme() {
+ spyTitle.clear()
+ compare(spyTitle.count, 0)
+ var testUrl = "scheme3://url1"
+ webView.load(testUrl)
+ spyTitle.wait()
+ compare(webView.title, "Scheme3 Reply1")
+
+ testUrl = "scheme3://url2"
+ webView.load(testUrl)
+ spyTitle.wait()
+ compare(webView.title, "Scheme3 Reply2")
+
+ compare(spyTitle.count, 2)
+ }
+ }
}