summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/dialogs/qprogressdialog
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/dialogs/qprogressdialog')
-rw-r--r--tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
index 68502f0d8d..060fa51293 100644
--- a/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
+++ b/tests/auto/widgets/dialogs/qprogressdialog/tst_qprogressdialog.cpp
@@ -57,6 +57,8 @@ public:
virtual ~tst_QProgressDialog();
private slots:
+ void autoShow_data();
+ void autoShow();
void getSetCheck();
void task198202();
void QTBUG_31046();
@@ -70,6 +72,34 @@ tst_QProgressDialog::~tst_QProgressDialog()
{
}
+void tst_QProgressDialog::autoShow_data()
+{
+ QTest::addColumn<int>("min");
+ QTest::addColumn<int>("max");
+ QTest::addColumn<int>("delay");
+ QTest::addColumn<bool>("expectedAutoShow");
+
+ QTest::newRow("50_to_100_long") << 50 << 100 << 100 << true; // 50*100ms = 5s
+ QTest::newRow("50_to_100_short") << 50 << 1 << 100 << false; // 50*1ms = 50ms
+
+ QTest::newRow("0_to_100_long") << 0 << 100 << 100 << true; // 100*100ms = 10s
+ QTest::newRow("0_to_10_short") << 0 << 10 << 100 << false; // 10*100ms = 1s
+}
+
+void tst_QProgressDialog::autoShow()
+{
+ QFETCH(int, min);
+ QFETCH(int, max);
+ QFETCH(int, delay);
+ QFETCH(bool, expectedAutoShow);
+
+ QProgressDialog dlg("", "", min, max);
+ dlg.setValue(0);
+ QThread::msleep(delay);
+ dlg.setValue(min+1);
+ QCOMPARE(dlg.isVisible(), expectedAutoShow);
+}
+
// Testing get/set functions
void tst_QProgressDialog::getSetCheck()
{