From: noam.rosenthal@nokia.com Date: Mon, 2 Jul 2012 19:12:23 +0000 (+0000) Subject: [Qt][WK2] New API tests introduced in r121620 fail X-Git-Tag: 070512121124~198 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=314267553469de16b7ca14f0d8fc45c60319041f;p=profile%2Fivi%2Fwebkit-efl.git [Qt][WK2] New API tests introduced in r121620 fail https://bugs.webkit.org/show_bug.cgi?id=90372 Reviewed by Luiz Agostini. Updated the pixel comparison to produce more predictable results. * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp: (compareImages): git-svn-id: http://svn.webkit.org/repository/webkit/trunk@121698 268f45cc-cd09-0410-ab3c-d52691b4dbfc --- diff --git a/Source/WebKit2/ChangeLog b/Source/WebKit2/ChangeLog index 07cb39a..b1ea874 100644 --- a/Source/WebKit2/ChangeLog +++ b/Source/WebKit2/ChangeLog @@ -1,3 +1,15 @@ +2012-07-02 No'am Rosenthal + + [Qt][WK2] New API tests introduced in r121620 fail + https://bugs.webkit.org/show_bug.cgi?id=90372 + + Reviewed by Luiz Agostini. + + Updated the pixel comparison to produce more predictable results. + + * UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp: + (compareImages): + 2012-07-02 Alexis Menard [Qt] Fix WebProcess crash on Mac when accessing a site with video tag. diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp b/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp index ae015e3..9f68881 100644 --- a/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp +++ b/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp @@ -119,26 +119,19 @@ void WebView::finishLoadForFrame(WKPageRef page, WKFrameRef frame, WKTypeRef use obj->m_frameLoaded = true; } -static bool compareImages(const QImage& i1, const QImage& i2, const QPoint& p1, const QPoint& p2, int iter) -{ - const QPoint point((p1.x() + p2.x()) >> 1, (p1.y() + p2.y()) >> 1); - - if (i1.pixel(point) != i2.pixel(point)) - return false; - - if (!iter) - return true; - - --iter; - return compareImages(i1, i2, point, p1, iter) && compareImages(i1, i2, point, p2, iter) - && compareImages(i1, i2, point, QPoint(p1.x(), p2.y()), iter) && compareImages(i1, i2, point, QPoint(p2.x(), p1.y()), iter); -} - -static bool compareImages(const QImage& i1, const QImage& i2, int iter) +static bool compareImages(const QImage& i1, const QImage& i2, int count) { if (i1.size() != i2.size()) return false; - return compareImages(i1, i2, QPoint(0, 0), QPoint(i1.size().width(), i1.size().height()), iter); + for (int x = 0; x < count; ++x) { + for (int y = 0; y < count; ++y) { + QPoint point(x * i1.width() / count, y * i1.height() / count); + if (i1.pixel(point) != i2.pixel(point)) + return false; + } + } + + return true; } class tst_qrawwebview : public QObject {