From 9213929a0061020b7ff18674c931acc62f42f72f Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 17 Nov 2015 15:06:34 +0100 Subject: Skip PieMenu tests when touch screen is present. Task-number: QTBUG-49353 Change-Id: I285f058f7df9cceb9d9c52bd822cd3ad772627fc Reviewed-by: Mitch Curtis --- tests/auto/extras/data/tst_piemenu.qml | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'tests') diff --git a/tests/auto/extras/data/tst_piemenu.qml b/tests/auto/extras/data/tst_piemenu.qml index 12dbe223..d709f513 100644 --- a/tests/auto/extras/data/tst_piemenu.qml +++ b/tests/auto/extras/data/tst_piemenu.qml @@ -41,6 +41,7 @@ import QtTest 1.0 import QtQuick 2.1 import QtQuick.Controls 1.1 +import QtQuick.Controls.Private 1.0 import QtQuick.Extras 1.4 import QtQuick.Extras.Private 1.0 import QtQuick.Extras.Private.CppUtils 1.0 @@ -354,6 +355,8 @@ Item { } function test_selectionAngle(data) { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var pieMenuComponent = Qt.createComponent("PieMenu3Items.qml"); tryCompare(pieMenuComponent, "status", Component.Ready); root = pieMenuComponent.createObject(container); @@ -505,6 +508,8 @@ Item { } function test_hideItem(data) { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var pieMenuComponent = Qt.createComponent("PieMenu3Items.qml"); tryCompare(pieMenuComponent, "status", Component.Ready); root = pieMenuComponent.createObject(container); @@ -605,6 +610,8 @@ Item { } function test_selectionItemOnMouseMove_QTRD3024() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); // Check when an item is hovered by the mouse, it gets made current // as expected and the current item is cleared when the mouse moves outside the menu var pieMenuComponent = Qt.createComponent("PieMenu3Items.qml"); @@ -676,6 +683,8 @@ Item { function test_QTRD3027() { // Check that an item's selection is cleared when the mouse moves outside // its boundaries without changing the selectionAngle + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var pieMenuComponent = Qt.createComponent("PieMenu3Items.qml"); tryCompare(pieMenuComponent, "status", Component.Ready); root = pieMenuComponent.createObject(container); @@ -702,6 +711,8 @@ Item { } function test_rotatedBoundingItem() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var pieMenuComponent = Qt.createComponent("PieMenuRotatedBoundingItem.qml"); tryCompare(pieMenuComponent, "status", Component.Ready); root = pieMenuComponent.createObject(container); -- cgit v1.2.1 From 0f3f31334485dab7ff21a01c14f9411c05901f2b Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Tue, 17 Nov 2015 15:31:36 +0100 Subject: Skip controls tests when touch screen is present. Task-number: QTBUG-49359 Task-number: QTBUG-49360 Change-Id: I96ec6d46de189ec396ef26c0d059c65360da4ec0 Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_slider.qml | 4 ++++ tests/auto/controls/data/tst_spinbox.qml | 3 +++ tests/auto/controls/data/tst_treeview.qml | 23 +++++++++++++++++++++++ 3 files changed, 30 insertions(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_slider.qml b/tests/auto/controls/data/tst_slider.qml index 1589f2ab..83ba299e 100644 --- a/tests/auto/controls/data/tst_slider.qml +++ b/tests/auto/controls/data/tst_slider.qml @@ -280,6 +280,8 @@ Item { } function test_sliderOffset() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var control = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {x: 20; y: 20; width: 100; height: 50}', container, '') // Don't move slider value if mouse is inside handle regtion mouseMove(control, control.width/2, control.height/2) @@ -309,6 +311,8 @@ Item { } function test_dragThreshold() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var control = Qt.createQmlObject('import QtQuick.Controls 1.2; Slider {x: 20; y: 20; width: 100; height: 50}', container, '') var pt = { x: control.width/2, y: control.height/2 } diff --git a/tests/auto/controls/data/tst_spinbox.qml b/tests/auto/controls/data/tst_spinbox.qml index a5da7b91..610aa452 100644 --- a/tests/auto/controls/data/tst_spinbox.qml +++ b/tests/auto/controls/data/tst_spinbox.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.2 +import QtQuick.Controls.Private 1.0 import QtTest 1.0 Item { @@ -367,6 +368,8 @@ Item { } function test_get_active_focus_when_up_or_down_was_pressed(){ + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var test_control = 'import QtQuick 2.2; \ import QtQuick.Controls 1.2; \ Column { \ diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index 33e64e65..6cc9705f 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -41,6 +41,7 @@ import QtQuick 2.4 import QtTest 1.0 import QtQuick.Controls 1.4 +import QtQuick.Controls.Private 1.0 import QtQuickControlsTests 1.0 Item { @@ -103,6 +104,8 @@ Item { function test_clicked_signals() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -152,6 +155,8 @@ Item { function test_headerHidden() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -175,6 +180,8 @@ Item { function test_expand_collapse() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -239,6 +246,8 @@ Item { function test_pressAndHold() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -263,6 +272,8 @@ Item { function test_keys_navigation() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_2.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -317,6 +328,8 @@ Item { function test_selection_singleSelection() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -442,6 +455,8 @@ Item { function test_selection_multiSelection() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -551,6 +566,8 @@ Item { function test_selection_extendedSelection() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -637,6 +654,8 @@ Item { function test_selection_contiguousSelection() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -732,6 +751,8 @@ Item { } function test_indexAt() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); @@ -800,6 +821,8 @@ Item { function test_QTBUG_46891_selection_collapse_parent() { + if (Settings.hasTouchScreen) + skip("Fails with touch screens"); var component = Qt.createComponent("treeview/treeview_1.qml") compare(component.status, Component.Ready) var tree = component.createObject(container); -- cgit v1.2.1 From 2407d7ede10547025af05d875f33f4580cdbb565 Mon Sep 17 00:00:00 2001 From: J-P Nurmi Date: Tue, 17 Nov 2015 14:18:33 +0100 Subject: Fix tst_treeview Change-Id: I662eea96b72043d06fe94707e77a9ead5a951e3d Reviewed-by: Mitch Curtis --- tests/auto/controls/data/tst_treeview.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_treeview.qml b/tests/auto/controls/data/tst_treeview.qml index 6cc9705f..d144b9c1 100644 --- a/tests/auto/controls/data/tst_treeview.qml +++ b/tests/auto/controls/data/tst_treeview.qml @@ -768,8 +768,8 @@ Item { if (treeIndex.row !== modelIndex.row || treeIndex.column !== modelIndex.column || treeIndex.internalId !== modelIndex.internalId) { - console.log("Test about to fail: row = " + row + ", __listView.count =" + __listView.count) - console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + getColumn(0).width) + console.log("Test about to fail: row = " + row + ", __listView.count =" + tree.__listView.count) + console.log(" . . . . . . . . . x =" + x + ", getColumn(0).width =" + tree.getColumn(0).width) } compare(treeIndex.row, modelIndex.row) compare(treeIndex.column, modelIndex.column) -- cgit v1.2.1 From 812f5779855d94cbe779f77003cc14935e02ef63 Mon Sep 17 00:00:00 2001 From: Filippo Cucchetto Date: Tue, 24 Nov 2015 22:35:51 +0100 Subject: Menubar popups should handle only release events of a previous press event When a popup is brought up by a press event for a menu inside the menubar it should not handle the relative next release event if it falls outside the popup. Before forwarding the release event we first check if a previous press event was seen, if not we simply discard the event. Task-number: QTBUG-47295 Task-number: QTBUG-45117 Change-Id: I632fab0a3abfdfc9872f85f99f9d7f50d41526cc Reviewed-by: J-P Nurmi --- tests/auto/controls/data/tst_menubar.qml | 51 ++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'tests') diff --git a/tests/auto/controls/data/tst_menubar.qml b/tests/auto/controls/data/tst_menubar.qml index bf6371e0..44238e21 100644 --- a/tests/auto/controls/data/tst_menubar.qml +++ b/tests/auto/controls/data/tst_menubar.qml @@ -39,6 +39,7 @@ ****************************************************************************/ import QtQuick 2.2 +import QtQuick.Controls 1.4 import QtTest 1.0 TestCase { @@ -48,8 +49,58 @@ TestCase { width:400 height:400 + Component { + id: windowComponent + ApplicationWindow { + width: 300; height: 300 + visible: true + menuBar: MenuBar { + Menu { + title: "&File"; objectName: "fileMenu" + Menu { + title: "&Recent Files"; objectName: "recentFilesSubMenu" + MenuItem { text: "RecentFile1"; objectName: "recentFile1MenuItem" } + MenuItem { text: "RecentFile2"; objectName: "recentFile2MenuItem" } + } + MenuItem { text: "&Save"; objectName: "saveMenuItem" } + MenuItem { text: "&Load"; objectName: "loadMenuItem" } + MenuItem { text: "&Exit"; objectName: "exitMenuItem" } + } + Menu { + title: "&Edit"; objectName: "editMenu" + Menu { + title: "&Advanced"; objectName: "advancedSubMenu" + MenuItem { text: "advancedOption1"; objectName: "advancedOption1MenuItem" } + } + MenuItem { text: "&Preferences"; objectName: "preferencesMenuItem" } + } + } + } + } + function test_createMenuBar() { var menuBar = Qt.createQmlObject('import QtQuick.Controls 1.2; MenuBar {}', testCase, ''); menuBar.destroy() } + + + function test_qtBug47295() + { + if (Qt.platform.os === "osx") + skip("MenuBar cannot be reliably tested on OS X") + + var window = windowComponent.createObject() + waitForRendering(window.contentItem) + var fileMenu = findChild(window, "fileMenu") + verify(fileMenu) + tryCompare(fileMenu, "__popupVisible", false) + mousePress(fileMenu.__visualItem) + wait(200); + tryCompare(fileMenu, "__popupVisible", true) + mouseMove(fileMenu.__contentItem, 0, -10) + wait(200) + mouseRelease(fileMenu.__contentItem, 0, -10) + tryCompare(fileMenu, "__popupVisible", true) + wait(200) + } } -- cgit v1.2.1