Summary: | [Qt] Public API watch dog auto test. | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Jocelyn Turcotte <jturcotte> | ||||||||
Component: | New Bugs | Assignee: | Jocelyn Turcotte <jturcotte> | ||||||||
Status: | RESOLVED FIXED | ||||||||||
Severity: | Normal | CC: | hausmann, laszlo.gombos, webkit.review.bot, zoltan | ||||||||
Priority: | P2 | ||||||||||
Version: | 528+ (Nightly build) | ||||||||||
Hardware: | Unspecified | ||||||||||
OS: | Unspecified | ||||||||||
Attachments: |
|
Description
Jocelyn Turcotte
2011-12-06 07:18:31 PST
Created attachment 118048 [details]
Patch
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.
(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. 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 :) 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.
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.
Created attachment 123121 [details]
Patch
Add the style fix that was lying in my working tree.
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.
Committed r105498: <http://trac.webkit.org/changeset/105498> |