RESOLVED FIXED 73922
[Qt] Public API watch dog auto test.
https://bugs.webkit.org/show_bug.cgi?id=73922
Summary [Qt] Public API watch dog auto test.
Jocelyn Turcotte
Reported 2011-12-06 07:18:31 PST
[Qt] Public API watch dog auto test.
Attachments
Patch (11.52 KB, patch)
2011-12-06 07:22 PST, Jocelyn Turcotte
no flags
Patch (9.71 KB, patch)
2012-01-19 04:43 PST, Jocelyn Turcotte
no flags
Patch (9.71 KB, patch)
2012-01-19 06:55 PST, Jocelyn Turcotte
hausmann: review+
Jocelyn Turcotte
Comment 1 2011-12-06 07:22:10 PST
WebKit Review Bot
Comment 2 2011-12-06 07:35:23 PST
Attachment 118048 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'Source/WebKit2/ChangeLog', u..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:111: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5] Total errors found: 1 in 6 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jocelyn Turcotte
Comment 3 2011-12-06 07:47:00 PST
(In reply to comment #2) > Attachment 118048 [details] did not pass style-queue: Please ignore that one, it's on its own line to make editing the list easier.
Simon Hausmann
Comment 4 2011-12-07 11:56:17 PST
Comment on attachment 118048 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=118048&action=review > Source/WebKit2/UIProcess/API/qt/tests/publicapi/publicapi.pro:3 > +DEFINES += IMPORT_DIR=\"\\\"$${ROOT_BUILD_DIR}$${QMAKE_DIR_SEP}imports\\\"\" Would it make sense to have this in tests.pri shared with qmltests? > Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:126 > + QVariant val = property.read(obj); > + if (val.type() == QVariant::UserType) { > + QObject* childObj = *reinterpret_cast<QObject**>(val.data()); > + if (childObj) I think you can write this as if (QObject* childObj = qvariant_cast<QObject*>(val)) { } Even if that doesn't work I'm almost sure there's a nicer way instead of using a reinterpret_cast on val.data() :) </nitpick> > Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:157 > + view.setSource(QUrl(QUICK_TEST_SOURCE_DIR "/tst_publicapi.qml")); I think instead of a separate file you can also use a data url here. Saves you the dummy external file :). I think some other auto-test uses that. Or no, I think Qt WTR uses that trick :)
Jocelyn Turcotte
Comment 5 2012-01-19 04:43:08 PST
Created attachment 123107 [details] Patch Updated the patch to work with the latest API. A signal now contains a QWebNavigationRequest which wasn't possible to check just with the root item. The approach is now to manually keep a list of types to check and access their ::staticMetaObject directly. Firing up a WebView in a QQuickView or accessing a QVariant value isn't necessary anymore. The semicolon style error is intentional to make copy-pasting the API in the source file easier.
WebKit Review Bot
Comment 6 2012-01-19 04:47:08 PST
Attachment 123107 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'Source/WebKit2/ChangeLog', u..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:77: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5] Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:108: Tests for true/false, null/non-null, and zero/non-zero should all be done without equality comparisons. [readability/comparison_to_zero] [5] Total errors found: 2 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jocelyn Turcotte
Comment 7 2012-01-19 06:55:57 PST
Created attachment 123121 [details] Patch Add the style fix that was lying in my working tree.
WebKit Review Bot
Comment 8 2012-01-19 07:00:27 PST
Attachment 123121 [details] did not pass style-queue: Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'ChangeLog', u'Source/WebKit2/ChangeLog', u..." exit_code: 1 Source/WebKit2/UIProcess/API/qt/tests/publicapi/tst_publicapi.cpp:77: Line contains only semicolon. If this should be an empty statement, use { } instead. [whitespace/semicolon] [5] Total errors found: 1 in 5 files If any of these errors are false positives, please file a bug against check-webkit-style.
Jocelyn Turcotte
Comment 9 2012-01-20 02:05:07 PST
Note You need to log in before you can comment on or make changes to this bug.