Title: [105728] trunk/Source/WebKit2
Revision
105728
Author
[email protected]
Date
2012-01-24 04:28:31 -0800 (Tue, 24 Jan 2012)

Log Message

[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:

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (105727 => 105728)


--- trunk/Source/WebKit2/ChangeLog	2012-01-24 12:25:13 UTC (rev 105727)
+++ trunk/Source/WebKit2/ChangeLog	2012-01-24 12:28:31 UTC (rev 105728)
@@ -1,3 +1,16 @@
+2012-01-24  Zeno Albisser  <[email protected]>
+
+        [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  <[email protected]>
 
         [GTK] Fix /webkit2/WebKitWebView/reload after r105688

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml (105727 => 105728)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml	2012-01-24 12:25:13 UTC (rev 105727)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qmltests/WebView/tst_applicationScheme.qml	2012-01-24 12:28:31 UTC (rev 105728)
@@ -16,6 +16,32 @@
                     reply.data = "" Application Scheme</title></head><body>A test page.</body></html>"
                     reply.send()
                 }
+            },
+            UrlSchemeDelegate {
+                scheme: "scheme1"
+                onReceivedRequest: {
+                    reply.data = "" Reply</title></head><body>A test page.</body></html>"
+                    reply.send()
+                }
+            },
+            UrlSchemeDelegate {
+                scheme: "scheme2"
+                onReceivedRequest: {
+                    reply.data = "" Reply</title></head><body>A test page.</body></html>"
+                    reply.send()
+                }
+            },
+            UrlSchemeDelegate {
+                scheme: "scheme3"
+                onReceivedRequest: {
+                    if (request.url == "scheme3://url1")
+                        reply.data = "" Reply1</title></head><body>A test page.</body></html>"
+                    else if (request.url == "scheme3://url2")
+                        reply.data = "" Reply2</title></head><body>A test page.</body></html>"
+                    else
+                        reply.data = "" not happen</title></head><body>A test page.</body></html>"
+                    reply.send()
+                }
             }
         ]
     }
@@ -30,12 +56,45 @@
         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)
+        }
     }
-
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to