Changeset 87818 in webkit


Ignore:
Timestamp:
Jun 1, 2011 9:58:35 AM (13 years ago)
Author:
caio.oliveira@openbossa.org
Message:

2011-06-01 Caio Marcelo de Oliveira Filho <caio.oliveira@openbossa.org>

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):
Location:
trunk/Source/WebKit/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/qt/ChangeLog

    r87797 r87818  
     12011-06-01  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
     2
     3        Reviewed by Kenneth Rohde Christiansen.
     4
     5        [Qt]Fix tst_QWebFrame::setUrlToInvalid() autotest after r84762
     6        https://bugs.webkit.org/show_bug.cgi?id=59345
     7
     8        KURL and QUrl disagree whether certain URLs are valid or not. The regression here
     9        was caused by the fact that now KURL accepts "http:/example.com" (note only one
     10        slash) and our test case used a strange edge case that's transformed into a
     11        "one-slash" URL that now KURL can handle.
     12
     13        QtWebKit approach in this case is to do a best effort and accept the QUrl if KURL
     14        can understand it. So I've updated the test to use a more meaningful example and
     15        show that an invalid URL gets converted to a valid URL if possible.
     16
     17        * tests/qwebframe/tst_qwebframe.cpp:
     18        (tst_QWebFrame::setUrlToInvalid):
     19
    1202011-06-01  Andreas Kling  <kling@webkit.org>
    221
  • trunk/Source/WebKit/qt/tests/qwebframe/tst_qwebframe.cpp

    r87767 r87818  
    34573457    QWebFrame* frame = page.mainFrame();
    34583458
    3459     const QUrl invalidUrl("http://strange;hostname/here");
     3459    const QUrl invalidUrl("http:/example.com");
    34603460    QVERIFY(!invalidUrl.isEmpty());
    34613461    QVERIFY(!invalidUrl.isValid());
    34623462    QVERIFY(invalidUrl != QUrl());
    34633463
     3464    // QWebFrame will do its best to accept the URL, possible converting it to a valid equivalent URL.
     3465    const QUrl validUrl("http://example.com/");
    34643466    frame->setUrl(invalidUrl);
    3465     QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
    3466     QCOMPARE(frame->url(), invalidUrl);
    3467     QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
    3468     QCOMPARE(frame->requestedUrl(), invalidUrl);
    3469     QEXPECT_FAIL("", "https://bugs.webkit.org/show_bug.cgi?id=59345", Continue);
    3470     QCOMPARE(frame->baseUrl(), invalidUrl);
     3467    QCOMPARE(frame->url(), validUrl);
     3468    QCOMPARE(frame->requestedUrl(), validUrl);
     3469    QCOMPARE(frame->baseUrl(), validUrl);
    34713470
    34723471    // QUrls equivalent to QUrl() will be treated as such.
Note: See TracChangeset for help on using the changeset viewer.