qt5base-lts/tests/auto/widgets/dialogs
Friedemann Kleint 315b359bc1 QFileDialog: Stabilize tests.
The init()/cleanup() code in tst_qfiledialog and tst_qfiledialog2
currently differs and fails to clean up the settings file
since it only removes the legacy settings under the Qt group
and instantiates a new QFileDialog while the QSettings class
is still in scope. Also, it has no means of clearing the
setLastVisitedDirectory(), which causes the
tst_QFiledialog::completer() and tst_QFiledialog::history() tests
to interfere, leaving the settings in an invalid state.
tst_qfiledialog2 does not use QStandardPaths::setTestModeEnabled(().

- Ensure the last visited URL is always clean by
  making QFileDialogPrivate::setLastVisitedDirectory()
  static and calling it from init().
- Introduce a cleanupSettingsFile() function to the tests that
  cleans both groups and call it from initTestCase() and cleanup()
  to ensure a clean state.
- Add QStandardPaths::setTestModeEnabled() to tst_qfiledialog2.

Fixes sporadic test fails when executing
tst_QFiledialog::completer() and tst_QFiledialog::history()
in a sequence.

Task-number: QTBUG-45764
Change-Id: I24de3caabf77be067b385d64ff11b7a07fe12b72
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
2015-05-01 06:03:10 +00:00
..
qcolordialog Update copyright headers 2015-02-11 06:49:51 +00:00
qdialog Update copyright headers 2015-02-11 06:49:51 +00:00
qerrormessage Update copyright headers 2015-02-11 06:49:51 +00:00
qfiledialog QFileDialog: Stabilize tests. 2015-05-01 06:03:10 +00:00
qfiledialog2 QFileDialog: Stabilize tests. 2015-05-01 06:03:10 +00:00
qfilesystemmodel Update copyright headers 2015-02-11 06:49:51 +00:00
qfontdialog Fixed license headers 2015-02-17 18:46:09 +00:00
qinputdialog Update copyright headers 2015-02-11 06:49:51 +00:00
qmessagebox Update copyright headers 2015-02-11 06:49:51 +00:00
qprogressdialog Update copyright headers 2015-02-11 06:49:51 +00:00
qsidebar Update copyright headers 2015-02-11 06:49:51 +00:00
qwizard Update copyright headers 2015-02-11 06:49:51 +00:00
dialogs.pro Replace win32-g++ with mingw scope 2014-01-17 12:08:24 +01:00