Title: [87818] trunk/Source/WebKit/qt
Revision
87818
Author
[email protected]
Date
2011-06-01 09:58:35 -0700 (Wed, 01 Jun 2011)

Log Message

2011-06-01  Caio Marcelo de Oliveira Filho  <[email protected]>

        Reviewed by Kenneth Rohde Christiansen.

        [Qt]Fix tst_QWebFrame::setUrlToInvalid() autotest after r84762
        https://bugs.webkit.org/show_bug.cgi?id=59345

        KURL and QUrl disagree whether certain URLs are valid or not. The regression here
        was caused by the fact that now KURL accepts "http:/example.com" (note only one
        slash) and our test case used a strange edge case that's transformed into a
        "one-slash" URL that now KURL can handle.

        QtWebKit approach in this case is to do a best effort and accept the QUrl if KURL
        can understand it. So I've updated the test to use a more meaningful example and
        show that an invalid URL gets converted to a valid URL if possible.

        * tests/qwebframe/tst_qwebframe.cpp:
        (tst_QWebFrame::setUrlToInvalid):

Modified Paths

Diff

Modified: trunk/Source/WebKit/qt/ChangeLog (87817 => 87818)


--- trunk/Source/WebKit/qt/ChangeLog	2011-06-01 16:27:21 UTC (rev 87817)
+++ trunk/Source/WebKit/qt/ChangeLog	2011-06-01 16:58:35 UTC (rev 87818)
@@ -1,3 +1,22 @@
+2011-06-01  Caio Marcelo de Oliveira Filho  <[email protected]>
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        [Qt]Fix tst_QWebFrame::setUrlToInvalid() autotest after r84762
+        https://bugs.webkit.org/show_bug.cgi?id=59345
+
+        KURL and QUrl disagree whether certain URLs are valid or not. The regression here
+        was caused by the fact that now KURL accepts "http:/example.com" (note only one
+        slash) and our test case used a strange edge case that's transformed into a
+        "one-slash" URL that now KURL can handle.
+
+        QtWebKit approach in this case is to do a best effort and accept the QUrl if KURL
+        can understand it. So I've updated the test to use a more meaningful example and
+        show that an invalid URL gets converted to a valid URL if possible.
+
+        * tests/qwebframe/tst_qwebframe.cpp:
+        (tst_QWebFrame::setUrlToInvalid):
+
 2011-06-01  Andreas Kling  <[email protected]>
 
         Reviewed by Benjamin Poulain.

Modified: trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp (87817 => 87818)


--- trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2011-06-01 16:27:21 UTC (rev 87817)
+++ trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp	2011-06-01 16:58:35 UTC (rev 87818)
@@ -3456,18 +3456,17 @@
     QWebPage page;
     QWebFrame* frame = page.mainFrame();
 
-    const QUrl invalidUrl("http://strange;hostname/here");
+    const QUrl invalidUrl("http:/example.com");
     QVERIFY(!invalidUrl.isEmpty());
     QVERIFY(!invalidUrl.isValid());
     QVERIFY(invalidUrl != QUrl());
 
+    // QWebFrame will do its best to accept the URL, possible converting it to a valid equivalent URL.
+    const QUrl validUrl("http://example.com/");
     frame->setUrl(invalidUrl);
-    QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
-    QCOMPARE(frame->url(), invalidUrl);
-    QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
-    QCOMPARE(frame->requestedUrl(), invalidUrl);
-    QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
-    QCOMPARE(frame->baseUrl(), invalidUrl);
+    QCOMPARE(frame->url(), validUrl);
+    QCOMPARE(frame->requestedUrl(), validUrl);
+    QCOMPARE(frame->baseUrl(), validUrl);
 
     // QUrls equivalent to QUrl() will be treated as such.
     const QUrl aboutBlank("about:blank");
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to