From a749525164b771452599e67e277d2ea6b3866479 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Thu, 23 Nov 2017 11:43:38 +0100 Subject: Fix tst_combobox There was a bogus timer firing once after the test had been running 500 ms. The timer was supposed to be used as a workaround on Mac, but since it had running set to true, it was actually firing once on all platforms. The timer was originally added in 6254af5. The test function ended up being skipped on Mac, so the timer was actually pointless. Task-number: QTBUG-64664 Change-Id: I5b4803ba49db0ab7e1b4dd632a34d51af59bbf91 Reviewed-by: Liang Qi --- tests/auto/controls/data/tst_combobox.qml | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index ce8b6c42..c380c63a 100644 --- a/tests/auto/controls/data/tst_combobox.qml +++ b/tests/auto/controls/data/tst_combobox.qml @@ -66,14 +66,6 @@ TestCase { property var model - Timer { - id: timer - running: true - repeat: false - interval: 500 - onTriggered: testCase.keyPress(Qt.Key_Escape) - } - function init() { model = Qt.createQmlObject("import QtQuick 2.2; ListModel {}", testCase, '') model.append({ text: "Banana", color: "Yellow" }) @@ -505,20 +497,14 @@ TestCase { var comboBox = Qt.createQmlObject('import QtQuick.Controls 1.2 ; ComboBox { model: 4 }', container, ''); comboBox.activeFocusOnPress = false verify(!comboBox.activeFocus) - if (Qt.platform.os === "osx") // on mac when the menu open, the __popup function does not return - timer.start() - else // two mouse clicks to open and close the popup menu - mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) + // two mouse clicks to open and close the popup menu + mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) verify(!comboBox.activeFocus) comboBox.activeFocusOnPress = true - if (Qt.platform.os === "osx") { // on macOS when the menu open, the __popup function does not return - timer.start() - } else { - // two mouse clicks to open and close the popup menu. The 1ms delay between mouse presses is - // needed with software quick renderer. Without the delay, this test is flaky. - mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1, Qt.LeftButton, Qt.NoModifier, 1) - } + // two mouse clicks to open and close the popup menu. The 1ms delay between mouse presses is + // needed with software quick renderer. Without the delay, this test is flaky. + mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1, Qt.LeftButton, Qt.NoModifier, 1) mouseClick(comboBox, comboBox.x + 1, comboBox.y + 1) verify(comboBox.activeFocus) comboBox.destroy() -- cgit v1.2.1