Title: [122355] trunk/Source/WebKit2
Revision
122355
Author
[email protected]
Date
2012-07-11 12:29:43 -0700 (Wed, 11 Jul 2012)

Log Message

[Qt][WK2] Test actual rendering results in API tests
https://bugs.webkit.org/show_bug.cgi?id=80609

Reviewed by Alexis Menard.

Added a very basic test to tst_QQuickWebView to make sure rendering actually occurs.

* UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
(tst_QQuickWebView):
(tst_QQuickWebView::basicRenderingSanity):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (122354 => 122355)


--- trunk/Source/WebKit2/ChangeLog	2012-07-11 19:29:30 UTC (rev 122354)
+++ trunk/Source/WebKit2/ChangeLog	2012-07-11 19:29:43 UTC (rev 122355)
@@ -1,3 +1,16 @@
+2012-07-11  No'am Rosenthal  <[email protected]>
+
+        [Qt][WK2] Test actual rendering results in API tests
+        https://bugs.webkit.org/show_bug.cgi?id=80609
+
+        Reviewed by Alexis Menard.
+
+        Added a very basic test to tst_QQuickWebView to make sure rendering actually occurs.
+
+        * UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp:
+        (tst_QQuickWebView):
+        (tst_QQuickWebView::basicRenderingSanity):
+
 2012-07-11  Mark Rowe  <[email protected]>
 
         Add a Mountain Lion version of libWebKitSystemInterface.a.

Modified: trunk/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp (122354 => 122355)


--- trunk/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp	2012-07-11 19:29:30 UTC (rev 122354)
+++ trunk/Source/WebKit2/UIProcess/API/qt/tests/qquickwebview/tst_qquickwebview.cpp	2012-07-11 19:29:43 UTC (rev 122355)
@@ -58,6 +58,7 @@
     void transparentWebViews();
 
     void inputMethod();
+    void basicRenderingSanity();
 
 private:
     void prepareWebViewComponent();
@@ -329,6 +330,28 @@
     QTest::qWait(200);
 }
 
+void tst_QQuickWebView::basicRenderingSanity()
+{
+    showWebView();
+    webView()->setSize(QSizeF(300, 400));
+
+    webView()->setUrl(QUrl(QString::fromUtf8("data:text/html,<html><body bgcolor=\"#00ff00\"></body></html>")));
+    QVERIFY(waitForLoadSucceeded(webView()));
+
+    // We have to explicitly move the window into the screen, otherwise it's not rendered.
+    m_window->setGeometry(0, 0, 300, 400);
+    m_window->show();
+    // This should not crash.
+    webView()->setVisible(true);
+    QTest::qWait(200);
+    QImage grabbedWindow = m_window->grabFrameBuffer();
+    QRgb testColor = qRgba(0, 0xff, 0, 0xff);
+    QVERIFY(grabbedWindow.pixel(10, 10) == testColor);
+    QVERIFY(grabbedWindow.pixel(100, 10) == testColor);
+    QVERIFY(grabbedWindow.pixel(10, 100) == testColor);
+    QVERIFY(grabbedWindow.pixel(100, 100) == testColor);
+}
+
 void tst_QQuickWebView::titleUpdate()
 {    
     QSignalSpy titleSpy(webView(), SIGNAL(titleChanged()));
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to