summaryrefslogtreecommitdiffstats
path: root/tests/auto
Commit message (Collapse)AuthorAgeFilesLines
* Fix saving handle width in QSplitter::saveState()Alexander Volkov2014-09-161-0/+37
| | | | | | | | | | | QSplitter::handleWidth() returns either a style dependent value if d->handleWidth is negative or the value of d->handleWidth itself. So to preserve this choice after calling saveState()/restoreState() we should save and restore the value of d->handleWidth rather than a result of handleWidth() which is non-negative. Change-Id: Idc11f8063d34b6c4a5f9b0a0032868679766dfb9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Make the default value of QTreeView::indentation() be style dependentAlexander Volkov2014-09-151-2/+41
| | | | | | | | | | | | | Add a new PM_TreeViewIndentaion enum value to QStyle and get the corresponding pixel metric in QTreeView. [ChangeLog][QtWidgets][QTreeView] Indentation is now style-dependent by default. [ChangeLog][QtWidgets][QTreeView] Added resetIndentation(). Change-Id: Ifad7987b8f3c6cd32987b89d95390f33043d8f19 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Adam Majer <adamm@zombino.com>
* QNetworkDiskCache: fix expiration calculation heuristic with Last-Modified timeDong-Heon Jung2014-09-121-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Heuristic with last-modified time in Qt has some problems. 1) Remove redundant expirationDate.isInvalid() check expirationDate.isInvalid is already checked. So I removed. 2) Add dateHeader.isInvalid() check The dateHeader is used in expiration calculation. I add invalid check for the dateHeader. *. The dateHeader is the origin server's Date 3) Change diff time calculation. The expirationDate is calculated with time diff. Previous calculation is // The lastModified is earlier than the currentDateTime. // The diff has negative value. int diff = currentDateTime.secsTo(lastModified); // The expirationDate is earlier than lastModified // , currentDateTime and dateHeader. expirationDate = lastModified.addSecs(diff / 10); *. currentDateTime: current time *. lastModified: last modified date in server It means that files are not cached with the heuristic. I changed diff calculation. int diff = lastModified.secsTo(dateHeader); freshness_lifetime = diff / 10; // RFC 2616 13.2.4 4) httpRequest.headerField setting If current_age is larger than 1 day, the cache MUST attach Warning 113. *. The current_age is value of age in header or elapsed time from dateHeader in Qt source code. Previous code does not check current_age is larger than 1 day correctly. // dt = 1970-01-01T00:00:00 + current_age dt.setTime_t(current_age); // currentDateTime is much bigger than 1970-01-01T00:00:00 if (dt.daysTo(currentDateTime) > 1) Task-number: QTBUG-40836 Change-Id: I4b00c3b287e6fafeea6b02681533fe75a198247e Reviewed-by: Jung Dong-Heon <dongheon.jung@lge.com> Reviewed-by: Peter Hartmann <phartmann@blackberry.com>
* QVariant::compare shouldn't return match when QVariant::cmp does notAllan Sandfeld Jensen2014-09-111-0/+30
| | | | | | | | | | | | | | If the types doesn't match in QVariant::compare we do a comparison based on QString, this may end up indicating a full match, though the we don't match according to cmp. In this case it would be better if we preserved the non-matching to avoid breaking ordering. [ChangeLog][QtCore][QVariant] Fixed ordered comparison between QVariants that do not match but produce identical toString output. Task-number: QTBUG-40363 Change-Id: I84a8eca11e8875dba9948bde2906ae7c5aa35704 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Revert "Reading QJsonObject property should not modify the object itself."Jędrzej Nowacki2014-09-111-51/+0
| | | | | | | | | | This reverts commit 20cf632ad5f3ffe7b0fd231724c971f4e07304eb. The commit produced to many problems during statics destruction. For example causing QtCreator crash (QTBUG-40987). Change-Id: Ib52f6a449c2d84deab2de792559a6a065ca45e8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QLockFile: on Windows, retry deleting the lock file if it is being read.David Faure2014-09-111-0/+20
| | | | | | | | | | | | | | | | A "sharing violation" happens when trying to delete the lock file and another thread/process is reading it at that very moment. Detect the error and try again, up to 10000 times - to avoid an infinite loop if QFile::remove fails for another reason such as a sudden change of permissions preventing us from deleting our own lock file. On Unix the deletion can't fail because of readers, but it doesn't hurt to check the return value there too, to catch other reasons for failures such as a sudden permission change. Task-number: QTBUG-38853 Change-Id: Icf12a74faed4a4916e3427abc09d9c33aa141476 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix several issues in QCollatorLars Knoll2014-09-101-8/+26
| | | | | | | | | | | | | Refactor the code and move more things into the cross platform code path. Make sure the flags survive changing the locale of QCollator. Use the correct locale on Windows, WinRT and OS X. We now pass all QCollator autotests on these platforms. Task-number: QTBUG-40778 Change-Id: Ic2d3334b5018c323a35a3ea8fc1d7ab5f99b4e62 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix user defined conversions to numeric typesLars Knoll2014-09-101-0/+93
| | | | | | | | | The old code was completely broken. It did dereference val for user types, but val does in this case only contain garbage. Instead use the pointer to the correct data. Change-Id: I20ccf0bfa3dd3774c787d08c51cc8dd7b1ec9a1a Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Don't accept json strings with trailing garbageLars Knoll2014-09-101-0/+14
| | | | | | | | | | A well formed JSON document is not allowed to contain trailing garbage at the end. Don't accept this in the parser. Task-number: QTBUG-40062 Change-Id: I0a09dbd099a8c643f58023342546c4e67d026fec Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Fix bugs in internal comparison operatorsLars Knoll2014-09-101-0/+24
| | | | | | | | | | | The comparison operators between QJsonPrivate::String and QJsonPrivate::Latin1String weren't all correct, leading to wrong sorting of keys in QJsonObjects when the keys were outside of the latin1 range and resulting lookup errors. Task-number: QTBUG-41100 Change-Id: Idceff615f85d7ab874ad2a8e4a6c1ce8c2aa0f65 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* Add an option to share between TLWsLaszlo Agocs2014-09-101-0/+27
| | | | | | Task-number: QTBUG-41191 Change-Id: I510d1631926ed0d9e371703d22229aed92432aa6 Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* Fix linking of tst_qwindow with dynamic Open GL.Friedemann Kleint2014-09-081-0/+2
| | | | | | Task-number: QTBUG-40696 Change-Id: If80a5e9b96e2eb7e50e02eefbe6e54d0b028c144 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* ssl: common certificate parser support for extensionsJeremy Lainé2014-09-051-9/+3
| | | | | | | | | | | | This makes non-OpenSSL backends able to handle to certificate extensions. This also converts the Q_OS_WINRT #ifdef's in the unit test to QT_NO_OPENSSL as the behavior is the same for any non-OpenSSL backend. Change-Id: I6a8306dc5c97a659ec96063d5a59cee2ee9a63a9 Reviewed-by: Richard J. Moore <rich@kde.org>
* GraphicsView: Fix resolvePalette() for QGraphicsItem's childrenMaks Naumov2014-09-051-0/+17
| | | | | | | Use a proper function for that. Change-Id: I166ce44b8987d522cb01bae57009b2b862851b92 Reviewed-by: Andreas Aardal Hanssen <andreas@hanssen.name>
* ssl: make peerVerifyError test agnostic of error orderJeremy Lainé2014-09-051-2/+15
| | | | | | | | | | | | Currently the peerVerifyError test for QSslSocket makes an assumption about the order in which SSL errors are emitted by peerVerifyError. This assumption does not necessarily hold for non-OpenSSL backends. This change fixes this assumption, and also checks that HostNameMismatch was found both in the errors emitted by peerVerifyError and by sslErrors. Change-Id: I856d1ea43b36332db0f178d35fc14a4bb18ad673 Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: enable non-OpenSSL backends to compile QSslSocket testsJeremy Lainé2014-09-051-0/+8
| | | | | | | | Some of the QSslSocket tests use OpenSSL-specific symbols. This change fixes this issue. Change-Id: Ib67efa42a15facaf0ad34fc0466341a37d945d1e Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Fix endianness part of QSysInfo::buildAbi() stringAlex Trotsenko2014-09-041-0/+13
| | | | | | | | | | | Both Q_LITTLE_ENDIAN and Q_BIG_ENDIAN macros are always defined on all architectures. So, byte order detection results in "little_endian" value for big endian systems. Test the system endianness in a right way, according to Q_BYTE_ORDER macro documentation. Change-Id: I5523f90567e78d679a3ff2902a8f5377ed39ceb1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Accessibility: Improve line boundary helper functionsFrederik Gladhorn2014-09-043-46/+265
| | | | | | | | | These functions are supposed to make it easy for third parties (and QLineEdit) to implement the textAt/Before/AfterOffset functions. Before the functions were ignoring newlines completely and thus only somewhat useful. Change-Id: I7136b9502a7fa6f8ad9ad7236761a34c1a7fd4da Reviewed-by: Jan Arve Sæther <jan-arve.saether@digia.com>
* ssl: add support for ASN.1 boolean valuesJeremy Lainé2014-09-031-0/+60
| | | | | | | | | This adds support for reading and writing ASN.1 boolean values. It also adds an operator to test two ASN.1 elements for equality. Change-Id: I4a22cbf9808533d593fc59d27b63caaf650b1f57 Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: check critical certificate extensionsJeremy Lainé2014-09-031-0/+47
| | | | | | | | This adds a test for a QSslCertificate containing extensions which are marked as critical. Change-Id: I314e1f5c9943bcad5d43129a97f9f834882dc6fb Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: tighten QSslCertificateExtension testsJeremy Lainé2014-09-031-0/+13
| | | | | | | | | This tightens tests performed on a certificate's extensions by checking isCritical() and isSupported() for all extensions. It also explicitly checks the keys when value() returns a QVariantMap. Change-Id: If51c55be25bbcd09cc3a6712ddfea2bf9a01360f Reviewed-by: Richard J. Moore <rich@kde.org>
* Make QElapsedTimer default to invalid (and now non-POD).Robin Burchell2014-09-031-8/+2
| | | | | | | | | | | The practical uses of a POD QElapsedTimer are not really that clear, and the number of misuses of this API are quite high. Default the state to invalid to prevent against mistakes. [ChangeLog][QtCore][QElapsedTimer] Is no longer a POD. Change-Id: I267292acf2bfca7404e3e449dd04410441d7ce26 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* ssl: common key parser support for encrypted keysJeremy Lainé2014-09-023-9/+138
| | | | | | | | | | | | | | This adds the infrastructure for reading and writing encrypted private keys when using non-OpenSSL backends. Each platform must provide its cryptographic encrypt / decrypt functions. As WinRT already uses the common parser, this commit includes an implementation for that platform. Done-with: Andrew Knight <andrew.knight@digia.com> Task-number: QTBUG-40688 Change-Id: I0d153425ce63601ff03b784a111e13962061025f Reviewed-by: Richard J. Moore <rich@kde.org>
* Remove vestiges of d3dcompiler_qtAndrew Knight2014-09-021-3/+0
| | | | | Change-Id: I2a233cb0bfec27a7535a31818568955f8bf85c15 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* qasn1element: add QAsn1Element::toIntegerJeremy Lainé2014-09-021-0/+8
| | | | | | | | | | This change adds the ability to decode ASN.1 INTEGER fields, provided they represent a positive number of less than 64-bit. This is needed for PKCS#12 decoding. Change-Id: Iafb76f22383278d6773b9e879a8f3ef43c8d2c8f Reviewed-by: Oliver Wolff <oliver.wolff@digia.com>
* ssl: disable (broken) i/o on DER encoded keysJeremy Lainé2014-08-301-11/+3
| | | | | | | | | | | | | | | | | | | | | QSslKey currently has methods which supposedly allow decoding and encoding private keys as DER protected by a passphrase. This is broken by design as explained in QTBUG-41038, as storing the encrypted DER data alone makes no sense: such a file lacks the necessary information about the encryption algorithm and initialization vector. This change: - explicitly stops using the passphrase when decoding DER in the constructor. The behavior is unchanged, it is not possible to read the encrypted DER alone. - refuses to honor the passphrase to DER encode a private key. The toDer method now outputs an empty QByteArray instead of garbage. Task-number: QTBUG-41038 Change-Id: I4281050cf1104f12d154db201a173633bfe22bd9 Reviewed-by: Richard J. Moore <rich@kde.org>
* ssl: add a test for 3DES encrypted keysJeremy Lainé2014-08-303-63/+94
| | | | | | | | This adds a test for 3DES encrypted keys in addition to the current DES encrypted keys. Change-Id: I229e3ef710e9ee23efa2a3275b89d958491de4a2 Reviewed-by: Richard J. Moore <rich@kde.org>
* winrt: complete QSslCertificate implementationOliver Wolff2014-08-301-0/+12
| | | | | | | | | The native handle and import functions are now available for use in other parts of the winrt backend. Change-Id: I07e6f95b3411c3dc7c1a7a164544b18e5e435d01 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* ssl: Add common key parser for backendsJeremy Lainé2014-08-291-26/+5
| | | | | | | | | | | | | | | | This internal implementation of QSslKey can be used when OpenSSL is not available. Encrypted keys are not supported, as the cryptography must be supplied by a separate library. With this commit, WinRT is migrated to the new implementation, but qsslkey_winrt.cpp is left in place so that the missing crypto implementation can be added later. This also means most of the expected failures for that platform can be removed from the autotest. Change-Id: I24a3ad1053bb72311613b28b3ae845aa1645a321 Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Maurice Kalinowski <maurice.kalinowski@digia.com> Reviewed-by: Richard J. Moore <rich@kde.org>
* QListView: Catch stack overflow on mutual scrollbar calculation.Christoph Schleifenbaum2014-08-291-0/+25
| | | | | | Task-number: QTBUG-39902 Change-Id: Ie850371098070e8ce485d5cb122aa89c18d97359 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QLineEdit: Disable standard key 'cut' when there is no selection.Friedemann Kleint2014-08-281-1/+32
| | | | | | Task-number: QTBUG-40477 Change-Id: I0741a1a769c9e7e0d19e8aec231acc29461d44ea Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* tst_qstatusbar: Allow a little more leeway in timer checking.Robin Burchell2014-08-281-1/+6
| | | | | | | | | Timer granularity means that sometimes this won't wait the full timeout before vanishing the message. Add some extra tolerance so we don't unnecessarily fail integrations. Change-Id: I203ac16cda7bd1f0437dd3febc0509c17e86c25a Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Check certificate nullity instead of handleJeremy Lainé2014-08-281-7/+7
| | | | | | | | | | | This changes tests which use QSslCertificate::handle() to determine if a certificate is null to use QSslCertificate::isNull() instead. This is required for non-OpenSSL backends which do not actually expose a private handle. Change-Id: I9523ba0dd00d47ba337b543ad34840125db99bfb Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* Windows: Prevent hidden transient children from being re-shown by Windows.Friedemann Kleint2014-08-281-1/+58
| | | | | | | | | Bring back code from Qt 4 to handle WM_SHOWWINDOW / SW_PARENTOPENING correctly. Task-number: QTBUG-40696 Change-Id: If018bf90573f495dbe32d0c46f522ccde0691ebb Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* Mark QByteArrayList as metatype built-in type.Jędrzej Nowacki2014-08-282-23/+61
| | | | | | | As a side effects it also adds core templates types to the tests Change-Id: I0e3338e0bffdf21982aa83d404c83288e54411f4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* ssl: Share the host name matching utilitiesAndrew Knight2014-08-271-17/+17
| | | | | | | | | This moves the socket backend's host name matching functions up to QSslSocketPrivate so that they can be shared between backends. This works, as there is no OpenSSL-specific code here. Change-Id: I73c2081fdc2e60a44c90e90800d1e1877391a626 Reviewed-by: Richard J. Moore <rich@kde.org>
* Close popup widgets when wheel events are receivedFriedemann Kleint2014-08-261-0/+28
| | | | | | Task-number: QTBUG-40656 Change-Id: I134b07705744c23af9718dee486ab5e9ad4352cf Reviewed-by: Jørgen Lind <jorgen.lind@digia.com>
* tst_qtreewidget: Skip test that crashes on Wayland.Robin Burchell2014-08-251-0/+3
| | | | | Change-Id: I6cc2eb90df57eb5c33d3a93920ea719b5e2cfc0d Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qtreeview: Skip test that crashes on Wayland.Robin Burchell2014-08-251-0/+3
| | | | | Change-Id: Iff2499dff1906a7c65fc5c007b96675f4bac2b42 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* OS X: Fix pan gestures.Morten Johan Sørvig2014-08-251-1/+3
| | | | | | | | | | | | | | | | | | The QPanGesture recognizer requires single-point touch events. The touch implementation in Qt 4 would test Qt::WA_TouchPadAcceptSingleTouchEvents and forward single touch events if set. Making this work in Qt 5 is a little bit more involved since the platform plugins don't know about widgets. Change the Cocoa touch implementation to send single-point touch events to QWidgetWindow windows only. Make QApplication forward single-point touch events only if the target widget has the Qt::WA_TouchPadAcceptSingleTouchEvents attribute set. Task-number: QTBUG-35893 Change-Id: I68712a5e3efb4ece7a81ca42f49c412e525eeb3a Reviewed-by: Jake Petroules <jake.petroules@petroules.com>
* Add operator-> to QJson iteratorsAllan Sandfeld Jensen2014-08-251-0/+4
| | | | | | | | | | | | | The iterators for QJsonArray and QJsonObject are currently lacking an operator-> definition. Unfortunately it is not possible to do in clean way without redefining either the iterators or QJsonValueRef class. This patch instead adds two fake pointer classes that are only used to handle the operator-> return value. Task-number: QTBUG-29573 Change-Id: Ief785a6afbbedc9e89cf3b6f3958c2c755997a66 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Added QAsn1ElementJeremy Lainé2014-08-243-0/+221
| | | | | | | | | | | | | | This element can be used for backends that do not offer all the information that is needed when implementing a ssl certificate backend. WinRT and the SecureTransport lack functionality in this area for example. The sources and tests are added for ssl and openssl configurations in order to be tested. The condition for adding these can be changed as soon as they are used by an actual implementation Change-Id: I2b836133105afdc178bf3b1ee7d732bea069effa Reviewed-by: Andrew Knight <andrew.knight@digia.com>
* tst_dialog: Skip test that doesn't pass on Wayland.Robin Burchell2014-08-231-0/+3
| | | | | | | Wayland does not support QCursor::setPos. Change-Id: Ic50bc31944db70605af01529cc2b7483dfc334a5 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qtouchevent: Skip tests that fail with qwindow-compositor.Robin Burchell2014-08-231-0/+18
| | | | | Change-Id: I6b37e04b8a25942f36ae09a8b0c6a3e3610eec19 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qwindow: Skip tests that fail with qwindow-compositor.Robin Burchell2014-08-231-0/+30
| | | | | Change-Id: I95d180cfa30b7398344f5a851e0bf849e7834a7a Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qinputmethod: Skip tests that fail with qwindow-compositor.Robin Burchell2014-08-231-0/+6
| | | | | Change-Id: I0163bffe49e3fcbb8132c4926ec975e3a6979285 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qguiapplication: Skip tests that fail with qwindow-compositor.Robin Burchell2014-08-231-0/+7
| | | | | Change-Id: Iac3e9e8d4d857af944de66a95cebc9955bd8beda Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qsqlthread: Add debug about when threads finished.Robin Burchell2014-08-231-1/+4
| | | | | | | Useful if someone is ever forced to try diagnose what goes wrong with this test. Change-Id: I4b5e607e6329b6ebad2b40b3f65d6cacbb6b7fcf Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
* tst_QWidget: Skip tests that don't pass with qwindow-compositor.Robin Burchell2014-08-201-0/+43
| | | | | | | Everything else passes, after some pending fixes in QtWayland. Change-Id: Ibd8efcaab8c5210111854f1a7362434046a62898 Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
* tst_qsqlthread: Move manual qWait calls into QTRY_VERIFYRobin Burchell2014-08-201-10/+5
| | | | | | | | Reduces the average runtime of this test for me by ~600ms, but due to the threading variance the exact reduction is hard to tell. Change-Id: I96a9f949ae2381f69d9364e6637db0db4bd3b165 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>