From 919cc4ac1bd3528ec367a06f32c98b5f2934d0c6 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 Reviewed-by: Liang Qi (cherry picked from commit a749525164b771452599e67e277d2ea6b3866479) Change-Id: Icebda05c872ba2de690e87bd0a9968670f203ce2 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_combobox.qml | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/tests/auto/controls/data/tst_combobox.qml b/tests/auto/controls/data/tst_combobox.qml index 632a1d15..d6a5f6c3 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,17 +497,13 @@ 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 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.destroy() -- cgit v1.2.1