Title: [121698] trunk/Source/WebKit2
Revision
121698
Author
[email protected]
Date
2012-07-02 12:12:23 -0700 (Mon, 02 Jul 2012)

Log Message

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

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (121697 => 121698)


--- trunk/Source/WebKit2/ChangeLog	2012-07-02 19:11:31 UTC (rev 121697)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-02 19:12:23 UTC (rev 121698)
@@ -1,3 +1,15 @@
+2012-07-02  No'am Rosenthal  <[email protected]>
+
+        [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  <[email protected]>
 
         [Qt] Fix WebProcess crash on Mac when accessing a site with video tag.

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp (121697 => 121698)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-07-02 19:11:31 UTC (rev 121697)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qrawwebview/tst_qrawwebview.cpp	2012-07-02 19:12:23 UTC (rev 121698)
@@ -119,28 +119,21 @@
     obj->m_frameLoaded = true;
 }
 
-static bool compareImages(const QImage& i1, const QImage& i2, const QPoint& p1, const QPoint& p2, int iter)
+static bool compareImages(const QImage& i1, const QImage& i2, int count)
 {
-    const QPoint point((p1.x() + p2.x()) >> 1, (p1.y() + p2.y()) >> 1);
-
-    if (i1.pixel(point) != i2.pixel(point))
+    if (i1.size() != i2.size())
         return false;
+    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;
+        }
+    }
 
-    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);
+    return true;
 }
 
-static bool compareImages(const QImage& i1, const QImage& i2, int iter)
-{
-    if (i1.size() != i2.size())
-        return false;
-    return compareImages(i1, i2, QPoint(0, 0), QPoint(i1.size().width(), i1.size().height()), iter);
-}
-
 class tst_qrawwebview : public QObject {
     Q_OBJECT
 public:
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to