on xenial help sign in
panelState fixes
commite88688e1c0f7f355d5ec8ad73db7ca4fc23eaae6 authorNick Dedekind <nick.dedekind@canonical.com> dateTue 28 Mar 2017, 17:43 (10 years ago) parent5d5daa3
4 files changed+15−10
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+2 tests/qmltests/ApplicationMenus/tst_MenuPopup.qml+2 tests/qmltests/Panel/tst_Panel.qml+4−2 tests/qmltests/tst_Shell.qml+7−8
tests/qmltests/ApplicationMenus/tst_MenuBar.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
2424import Utils 0.1
2525
2626import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
2728import ".."
2829
2930Item {
@@ -67,6 +68,7 @@ Item {
6768 id: menuBackend
6869 modelData: appMenuData.generateTestData(10,5,2,3)
6970 }
71+ panelState: PanelState {}
7072 }
7173 }
7274
tests/qmltests/ApplicationMenus/tst_MenuPopup.qml+2
@@ -24,6 +24,7 @@ import Unity.Test 0.1
2424import Utils 0.1
2525
2626import "../../../qml/ApplicationMenus"
27+import "../../../qml/Components/PanelState"
2728import ".."
2829
2930Item {
@@ -59,6 +60,7 @@ Item {
5960 }}
6061 ]
6162 }
63+ panelState: PanelState {}
6264 }
6365 }
6466
tests/qmltests/Panel/tst_Panel.qml+4−2
@@ -101,6 +101,8 @@ PanelTest {
101101 model: root.indicatorsModel
102102 hides: [ panel.applicationMenus ]
103103 }
104+
105+ panelState: PanelState {}
104106 }
105107 }
106108 }
@@ -857,7 +859,7 @@ PanelTest {
857859
858860 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
859861
860− PanelState.title = "Fake Title"
862+ panelState.title = "Fake Title"
861863 pullDownApplicationsMenu(0 /*xPos*/);
862864 compare(aboutToShowCalledSpy.count, 1);
863865
@@ -890,7 +892,7 @@ PanelTest {
890892
891893 var indicatorsBar = findChild(panel.applicationMenus, "indicatorsBar");
892894
893− PanelState.title = "Fake Title"
895+ panelState.title = "Fake Title"
894896 pullDownApplicationsMenu(0 /*xPos*/);
895897
896898 tryCompare(indicatorsBar, "currentItemIndex", 0);
tests/qmltests/tst_Shell.qml+7−8
@@ -38,7 +38,6 @@ import Unity.Indicators 0.1 as Indicators
3838
3939import "../../qml"
4040import "../../qml/Components"
41−import "../../qml/Components/PanelState"
4241import "Stage"
4342
4443Rectangle {
@@ -66,12 +65,12 @@ Rectangle {
6665 } else {
6766 topLevelSurfaceList = null;
6867 appMenuData.surfaceManager = null;
69− panelState = undefined;
68+ panelState = null;
7069 }
7170 }
7271
7372 property var topLevelSurfaceList: null
74− property var panelState: undefined
73+ property var panelState: null
7574
7675 QtObject {
7776 id: _screenWindow
@@ -2666,9 +2665,9 @@ Rectangle {
26662665
26672666 function test_oskDisplacesWindow_data() {
26682667 return [
2669− {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: units.gu(5), oskEnabled: true},
2670− {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: panelState.panelHeight, oskEnabled: true},
2671− {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: units.gu(10), oskEnabled: false},
2668+ {tag: "no need to displace", windowHeight: units.gu(10), windowY: units.gu(5), targetDisplacement: function() { return units.gu(5); }, oskEnabled: true},
2669+ {tag: "displace to top", windowHeight: units.gu(50), windowY: units.gu(10), targetDisplacement: function() { return panelState.panelHeight; }, oskEnabled: true},
2670+ {tag: "osk not on this screen", windowHeight: units.gu(40), windowY: units.gu(10), targetDisplacement: function() { return units.gu(10); }, oskEnabled: false},
26722671 ]
26732672 }
26742673
@@ -2694,7 +2693,7 @@ Rectangle {
26942693 verify(initialY > panelState.panelHeight);
26952694
26962695 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, root.height / 2, root.width, root.height / 2));
2697− tryCompare(dashAppDelegate, "y", data.targetDisplacement);
2696+ tryCompare(dashAppDelegate, "y", data.targetDisplacement());
26982697
26992698 topLevelSurfaceList.inputMethodSurface.setInputBounds(Qt.rect(0, 0, 0, 0));
27002699 tryCompare(dashAppDelegate, "y", initialY);
@@ -3127,7 +3126,7 @@ Rectangle {
31273126 // double click the panel
31283127 var panel = findChild(shell, "panel");
31293128 verify(panel);
3130− mouseDoubleClickSequence(panel, panel.width/2, PanelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
3129+ mouseDoubleClickSequence(panel, panel.width/2, panelState.panelHeight/2, Qt.LeftButton, Qt.NoModifier, 300);
31313130 tryCompare(appDelegate, "state", "restored");
31323131 }
31333132