| 1 | /* |
| 2 | SPDX-FileCopyrightText: 2013 Albert Astals Cid <[email protected]> |
| 3 | |
| 4 | SPDX-License-Identifier: LGPL-2.0-or-later |
| 5 | */ |
| 6 | |
| 7 | #include "kcolorbuttontest.h" |
| 8 | |
| 9 | #include <QColorDialog> |
| 10 | #include <QTest> |
| 11 | #include <kcolorbutton.h> |
| 12 | |
| 13 | #include "windowscheck.h" |
| 14 | |
| 15 | QTEST_MAIN(KColorButtonTest) |
| 16 | |
| 17 | void KColorButtonTest::testOpenDialog() |
| 18 | { |
| 19 | if (isWindowsCI()) { |
| 20 | QSKIP("GUI Tests on Windows CI are not supported"); |
| 21 | } |
| 22 | |
| 23 | KColorButton colorButton(Qt::red); |
| 24 | colorButton.show(); |
| 25 | QVERIFY(QTest::qWaitForWindowExposed(&colorButton)); |
| 26 | QTest::mouseClick(&colorButton, Qt::LeftButton); |
| 27 | QColorDialog *dialog = colorButton.findChild<QColorDialog *>(); |
| 28 | QVERIFY(dialog != nullptr); |
| 29 | QVERIFY(QTest::qWaitForWindowExposed(dialog)); |
| 30 | QCOMPARE(dialog->currentColor(), QColor(Qt::red)); |
| 31 | } |
| 32 | |
| 33 | #include "moc_kcolorbuttontest.cpp" |