Changeset 84171 in webkit


Ignore:
Timestamp:
Apr 18, 2011 12:49:26 PM (13 years ago)
Author:
yi.4.shen@nokia.com
Message:

2011-04-18 Yi Shen <yi.4.shen@nokia.com>

Reviewed by Laszlo Gombos.

[Qt] Fix Api tests for QWebPage on Symbian
https://bugs.webkit.org/show_bug.cgi?id=56924

Ignores the style attribute that selectedHtml() returns.

  • tests/qwebpage/tst_qwebpage.cpp: (tst_QWebPage::cursorMovements): (tst_QWebPage::textSelection): (tst_QWebPage::findText):
Location:
trunk/Source/WebKit/qt
Files:
2 edited

Legend:

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

    r84168 r84171  
     12011-04-18  Yi Shen  <yi.4.shen@nokia.com>
     2
     3        Reviewed by Laszlo Gombos.
     4
     5        [Qt] Fix Api tests for QWebPage on Symbian
     6        https://bugs.webkit.org/show_bug.cgi?id=56924
     7
     8        Ignores the style attribute that selectedHtml() returns.
     9
     10        * tests/qwebpage/tst_qwebpage.cpp:
     11        (tst_QWebPage::cursorMovements):
     12        (tst_QWebPage::textSelection):
     13        (tst_QWebPage::findText):
     14
    1152011-04-18  Andreas Kling  <kling@webkit.org>
    216
  • trunk/Source/WebKit/qt/tests/qwebpage/tst_qwebpage.cpp

    r83108 r84171  
    987987    page->mainFrame()->evaluateJavaScript(script);
    988988    QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
    989     QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>"));
     989
     990    QRegExp regExp(" style=\".*\"");
     991    regExp.setMinimal(true);
     992    QCOMPARE(page->selectedHtml().trimmed().replace(regExp, ""), QString::fromLatin1("<span class=\"Apple-style-span\"><p id=\"one\">The quick brown fox</p></span>"));
    990993
    991994    // these actions must exist
     
    12181221    page->mainFrame()->evaluateJavaScript(selectScript);
    12191222    QCOMPARE(page->selectedText().trimmed(), QString::fromLatin1("The quick brown fox"));
    1220     QCOMPARE(page->selectedHtml().trimmed(), QString::fromLatin1("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \"><p id=\"one\">The quick brown fox</p></span>"));
     1223    QRegExp regExp(" style=\".*\"");
     1224    regExp.setMinimal(true);
     1225    QCOMPARE(page->selectedHtml().trimmed().replace(regExp, ""), QString::fromLatin1("<span class=\"Apple-style-span\"><p id=\"one\">The quick brown fox</p></span>"));
    12211226
    12221227    // Make sure hasSelection returns true, since there is selected text now...
     
    26722677    QVERIFY(m_page->selectedHtml().isEmpty());
    26732678    QStringList words = (QStringList() << "foo" << "bar");
     2679    QRegExp regExp(" style=\".*\"");
     2680    regExp.setMinimal(true);
    26742681    foreach (QString subString, words) {
    26752682        m_page->findText(subString, QWebPage::FindWrapsAroundDocument);
    26762683        QCOMPARE(m_page->selectedText(), subString);
    2677         QCOMPARE(m_page->selectedHtml(), QString("<span class=\"Apple-style-span\" style=\"border-collapse: separate; color: rgb(0, 0, 0); font-family: Times; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; \">%1</span>").arg(subString));
     2684        QCOMPARE(m_page->selectedHtml().trimmed().replace(regExp, ""), QString("<span class=\"Apple-style-span\">%1</span>").arg(subString));
    26782685        m_page->findText("");
    26792686        QVERIFY(m_page->selectedText().isEmpty());
Note: See TracChangeset for help on using the changeset viewer.