Need test for url property in QDesktopWebView
Created attachment 105523 [details] url property test for DesktopWebView Here is the test results: ********* Start testing of tst_CommonViewTests ********* Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_CommonViewTests::initTestCase() PASS : tst_CommonViewTests::baseUrl() PASS : tst_CommonViewTests::loadEmptyUrl() QWARN : tst_CommonViewTests::loadEmptyPageViewVisible() QSocketNotifier: socket notifiers cannot be enabled from another thread QWARN : tst_CommonViewTests::loadEmptyPageViewVisible() QSocketNotifier: socket notifiers cannot be enabled from another thread QWARN : tst_CommonViewTests::loadEmptyPageViewVisible() QObject::startTimer: timers cannot be started from another thread PASS : tst_CommonViewTests::loadEmptyPageViewVisible() QWARN : tst_CommonViewTests::loadEmptyPageViewHidden() QSocketNotifier: socket notifiers cannot be enabled from another thread PASS : tst_CommonViewTests::loadEmptyPageViewHidden() QWARN : tst_CommonViewTests::loadNonexistentFileUrl() QSocketNotifier: socket notifiers cannot be enabled from another thread PASS : tst_CommonViewTests::loadNonexistentFileUrl() QWARN : tst_CommonViewTests::backAndForward() QSocketNotifier: socket notifiers cannot be enabled from another thread PASS : tst_CommonViewTests::backAndForward() QWARN : tst_CommonViewTests::reload() QSocketNotifier: socket notifiers cannot be enabled from another thread PASS : tst_CommonViewTests::reload() PASS : tst_CommonViewTests::stop() PASS : tst_CommonViewTests::loadProgress() QWARN : tst_CommonViewTests::show() QSocketNotifier: socket notifiers cannot be enabled from another thread QWARN : tst_CommonViewTests::show() QObject::startTimer: timers cannot be started from another thread PASS : tst_CommonViewTests::show() PASS : tst_CommonViewTests::cleanupTestCase() Totals: 12 passed, 0 failed, 0 skipped ********* Finished testing of tst_CommonViewTests ********* ********* Start testing of tst_QTouchWebView ********* Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_QTouchWebView::initTestCase() PASS : tst_QTouchWebView::accessPage() PASS : tst_QTouchWebView::navigationActionsStatusAtStartup() PASS : tst_QTouchWebView::cleanupTestCase() Totals: 4 passed, 0 failed, 0 skipped ********* Finished testing of tst_QTouchWebView ********* ********* Start testing of tst_QDesktopWebView ********* Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : tst_QDesktopWebView::initTestCase() PASS : tst_QDesktopWebView::navigationActionsStatusAtStartup() QWARN : tst_QDesktopWebView::stopActionEnabledAfterLoadStarted() QSocketNotifier: socket notifiers cannot be enabled from another thread PASS : tst_QDesktopWebView::stopActionEnabledAfterLoadStarted() PASS : tst_QDesktopWebView::cleanupTestCase() Totals: 4 passed, 0 failed, 0 skipped ********* Finished testing of tst_QDesktopWebView ********* ********* Start testing of qmltests ********* Config: Using QTest library 5.0.0, Qt 5.0.0 PASS : DesktopWebViewNavigationPolicyForUrl::initTestCase() QWARN : DesktopWebViewNavigationPolicyForUrl::test_ignorePolicy() QObject::startTimer: timers cannot be started from another thread PASS : DesktopWebViewNavigationPolicyForUrl::test_ignorePolicy() PASS : DesktopWebViewNavigationPolicyForUrl::test_usePolicy() PASS : DesktopWebViewNavigationPolicyForUrl::cleanupTestCase() PASS : DesktopWebViewProperties::initTestCase() PASS : DesktopWebViewProperties::test_title() PASS : DesktopWebViewProperties::test_url() PASS : DesktopWebViewProperties::cleanupTestCase() PASS : TouchWebViewProperties::initTestCase() PASS : TouchWebViewProperties::test_title() PASS : TouchWebViewProperties::cleanupTestCase() Totals: 11 passed, 0 failed, 0 skipped ********* Finished testing of qmltests ********* ********************************************************************** ** TOTALS: 31 passed, 0 failed, 0 skipped ** **********************************************************************
Comment on attachment 105523 [details] url property test for DesktopWebView View in context: https://bugs.webkit.org/attachment.cgi?id=105523&action=review > Source/WebKit2/ChangeLog:8 > + Added qml test case to check url property Period at end of sentence please. > Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_properties.qml:30 > + var tstUrl = Qt.resolvedUrl("../common/test1.html") > + webView.load(tstUrl) > + spy.wait() > + compare(webView.url, tstUrl) > + } This doesn't test anything. Please test that the page actually loaded, e.g. by testing that the title has changed (like the test above it). Also, use testUrl instead of tstUrl. Abbvs don't smplfy reading the code :)
webView.url is a read only property. All it does is to check and see if the url is set properly. This is not a title test. That is already take care of in previous test case. I can take care of tstUrl. Thanks
Created attachment 105526 [details] updated desktopwebview patch Taken care of reviewer comments.
(In reply to comment #3) > webView.url is a read only property. All it does is to check and see if the url is set properly. > This is not a title test. That is already take care of in previous test case. > > I can take care of tstUrl. > Thanks What Noam said is that load is async therefore in theory testing the property right away is not valid.
That's why we wait on spy for signal "loadSucceeded".
Comment on attachment 105526 [details] updated desktopwebview patch Ah yes perfect then.
Comment on attachment 105526 [details] updated desktopwebview patch Clearing flags on attachment: 105526 Committed r94027: <http://trac.webkit.org/changeset/94027>
All reviewed patches have been landed. Closing bug.