Bug 80503

Summary: [Qt] Fix compilation without QtQuick1
Product: WebKit Reporter: Simon Hausmann <hausmann>
Component: New BugsAssignee: Simon Hausmann <hausmann>
Status: RESOLVED FIXED    
Severity: Normal CC: ossy, vestbo
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
proposed Qt4.8 API tests fix after r110050
none
proposed Qt4.8 API tests fix after r110050 none

Description Simon Hausmann 2012-03-07 01:26:48 PST
[Qt] Fix compilation without QtQuick1
Comment 1 Simon Hausmann 2012-03-07 01:28:27 PST
Created attachment 130566 [details]
Patch
Comment 2 Tor Arne Vestbø 2012-03-07 02:31:30 PST
Comment on attachment 130566 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=130566&action=review

> Source/WebKit/qt/declarative/public.pri:37
> +haveQt(4)|!isEmpty(QT.quick1.name) {
> +    haveQt(5): QT += quick1
> +    DEFINES += HAVE_QQUICK1
> +    SOURCES += qdeclarativewebview.cpp
> +    HEADERS += qdeclarativewebview_p.h
> +}

The detection part of this should be in features.prf, and this part should do contains(DEFINES, HAVE_QQUICK1=1) {}

> Source/tests.pri:30
> +!isEmpty(QT.quick1.name)|haveQt(4) {
> +    contains(QT_CONFIG, declarative): SUBDIRS += $$WEBKIT_TESTS_DIR/qdeclarativewebview

That way you can reuse the detection from features.prf here
Comment 3 Simon Hausmann 2012-03-07 05:43:21 PST
Created attachment 130607 [details]
Patch
Comment 4 Simon Hausmann 2012-03-07 05:55:48 PST
Committed r110050: <http://trac.webkit.org/changeset/110050>
Comment 5 Csaba Osztrogonác 2012-03-07 07:47:49 PST
Reopen, because it broke API tests on Qt 4.8 bots:

********* Start testing of tst_QDeclarativeWebView *********
Config: Using QTest library 4.8.0, Qt 4.8.0
PASS   : tst_QDeclarativeWebView::initTestCase()
QWARN  : tst_QDeclarativeWebView::basicProperties() "1:1:module "QtWebKit" is not installed" 
FAIL!  : tst_QDeclarativeWebView::basicProperties() '!component.isError()' returned FALSE. ()
   Loc: [/ramdisk/qt-linux-release/build/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp(552)]
QWARN  : tst_QDeclarativeWebView::basicProperties() QDeclarativeComponent: Component is not ready
FAIL!  : tst_QDeclarativeWebView::basicProperties() 'wv' returned FALSE. ()
   Loc: [/ramdisk/qt-linux-release/build/Source/WebKit/qt/tests/qdeclarativewebview/tst_qdeclarativewebview.cpp(106)]
....
Comment 6 Csaba Osztrogonác 2012-03-07 08:05:34 PST
And one more problem because of this patch:
ERROR:Exec:Timeout, process 'WebKitBuild/Release/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl' (2608) was terminated

Before this patch tst_webgl wasn't run at all.
Comment 7 Csaba Osztrogonác 2012-03-07 08:12:44 PST
WebGL tests pass for me with x forward:

********* Start testing of tst_WebGlPerformance *********
Config: Using QTest library 4.8.0, Qt 4.8.0
PASS   : tst_WebGlPerformance::initTestCase()
QDEBUG : tst_WebGlPerformance::benchSoftwareFallbackRgb16() loaded the Generic plugin
RESULT : tst_WebGlPerformance::benchSoftwareFallbackRgb16():
     58 msecs per iteration (total: 58, iterations: 1)
PASS   : tst_WebGlPerformance::benchSoftwareFallbackRgb16()
RESULT : tst_WebGlPerformance::benchSoftwareFallbackRgb32():
     129 msecs per iteration (total: 259, iterations: 2)
PASS   : tst_WebGlPerformance::benchSoftwareFallbackRgb32()
RESULT : tst_WebGlPerformance::benchSoftwareFallbackArgb32():
     156 msecs per iteration (total: 156, iterations: 1)
PASS   : tst_WebGlPerformance::benchSoftwareFallbackArgb32()
RESULT : tst_WebGlPerformance::benchSoftwareFallbackArgb32Premultiplied():
     155 msecs per iteration (total: 155, iterations: 1)
PASS   : tst_WebGlPerformance::benchSoftwareFallbackArgb32Premultiplied()
PASS   : tst_WebGlPerformance::cleanupTestCase()
Totals: 6 passed, 0 failed, 0 skipped
********* Finished testing of tst_WebGlPerformance *********


But unfortunately they times out with xvfb (on the bots):
********* Start testing of tst_WebGlPerformance *********
Config: Using QTest library 4.8.0, Qt 4.8.0
PASS   : tst_WebGlPerformance::initTestCase()
QDEBUG : tst_WebGlPerformance::benchSoftwareFallbackRgb16() loaded the Generic plugin 
RESULT : tst_WebGlPerformance::benchSoftwareFallbackRgb16():
     0.52 msecs per iteration (total: 67, iterations: 128)
PASS   : tst_WebGlPerformance::benchSoftwareFallbackRgb16()
QFATAL : tst_WebGlPerformance::benchSoftwareFallbackRgb32() Received signal 15
FAIL!  : tst_WebGlPerformance::benchSoftwareFallbackRgb32() Received a fatal error.
   Loc: [Unknown file(0)]
Totals: 2 passed, 1 failed, 0 skipped
Comment 8 Csaba Osztrogonác 2012-03-07 08:27:56 PST
I tested webgl tests locally, all of them work in xvfb, but they are very slow:
--------------------------------------------------------------------------------
$ time run-in-xvfb.sh WebKitBuild/Release/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl
real    4m30.404s

$ time WebKitBuild/Release/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl
real    1m20.001s

Additionally I tested webgl tests with Qt5 in xvfb, they are quite fast:
-------------------------------------------------------------------------
$ time run-in-xvfb.sh WebKitBuild/Release/Source/WebKit/qt/tests/benchmarks/webgl/tst_webgl
real    0m22.439s
Comment 9 Csaba Osztrogonác 2012-03-09 05:06:27 PST
Comment on attachment 130607 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=130607&action=review

> Source/WebKit/qt/declarative/plugin.cpp:57
> +#if defined(HAVE_QQUICK1)
>          qmlRegisterType<QDeclarativeWebSettings>();
>          qmlRegisterType<QDeclarativeWebView>(uri, 1, 0, "WebView");
>  #ifdef Q_REVISION
>          qmlRegisterRevision<QDeclarativeWebView, 0>("QtWebKit", 1, 0);
>          qmlRegisterRevision<QDeclarativeWebView, 1>("QtWebKit", 1, 1);
>  #endif
> +#endif

I got the problem. :) Tests fail only on Qt 4.8, because HAVE_QQUICK1 isn't 
defined here, because features.pri isn't included by WebKit/qt/declarative/public.pri

Patch is coming soon.
Comment 10 Csaba Osztrogonác 2012-03-09 05:07:31 PST
Created attachment 131030 [details]
proposed Qt4.8 API tests fix after r110050
Comment 11 Csaba Osztrogonác 2012-03-09 05:08:45 PST
Created attachment 131031 [details]
proposed Qt4.8 API tests fix after r110050

I shouldn't have submit "git --color" patch. :))
Comment 12 Csaba Osztrogonác 2012-03-09 05:10:11 PST
Additionally I disabled WebGL performance tests about Simons suggestion - http://trac.webkit.org/changeset/110288
Comment 13 Zoltan Herczeg 2012-03-09 05:10:38 PST
Comment on attachment 131031 [details]
proposed Qt4.8 API tests fix after r110050

r=me
Comment 14 Csaba Osztrogonác 2012-03-09 05:14:21 PST
(In reply to comment #13)
> (From update of attachment 131031 [details])
> r=me

Landed in http://trac.webkit.org/changeset/110291