on xenial help sign in
move the test where it belongs
c6ce625Lukáš Tinkl
tests/qmltests/Launcher/tst_Drawer.qml+20
@@ -26,6 +26,7 @@ import Unity.Test 0.1
26StyledItem {
26StyledItem {
27 id: root
27 id: root
28 theme.name: "Ubuntu.Components.Themes.SuruDark"
28 theme.name: "Ubuntu.Components.Themes.SuruDark"
29+ focus: true
29
30
30 width: units.gu(140)
31 width: units.gu(140)
31 height: units.gu(70)
32 height: units.gu(70)
@@ -86,6 +87,12 @@ StyledItem {
86 }
87 }
87 }
88 }
88
89
90+ Binding {
91+ target: launcher
92+ property: "panelWidth"
93+ value: units.gu(Math.round(widthSlider.value))
94+ }
95+
89 UnityTestCase {
96 UnityTestCase {
90 id: testCase
97 id: testCase
91 when: windowShown
98 when: windowShown
@@ -260,5 +267,18 @@ StyledItem {
260
267
261 tryCompare(launcher, "state", data.endState)
268 tryCompare(launcher, "state", data.endState)
262 }
269 }
270+
271+ function test_directSearch() {
272+ dragDrawerIntoView();
273+ var drawer = findChild(launcher, "drawer");
274+ verify(!!drawer);
275+
276+ tryCompare(drawer, "focus", true);
277+
278+ var searchField = findChild(drawer, "searchField");
279+ verify(searchField);
280+ typeString("cam");
281+ tryCompare(searchField, "displayText", "cam");
282+ }
263 }
283 }
264}
284}
tests/qmltests/Launcher/tst_Launcher.qml−33
@@ -1478,38 +1478,5 @@ Rectangle {
1478
1478
1479 launcher.available = true;
1479 launcher.available = true;
1480 }
1480 }
1481−
1482− function dragDrawerIntoView() {
1483− var startX = launcher.dragAreaWidth/2;
1484− var startY = launcher.height/2;
1485− touchFlick(launcher,
1486− startX, startY,
1487− startX+units.gu(35), startY);
1488−
1489− var drawer = findChild(launcher, "drawer");
1490− verify(!!drawer);
1491−
1492− // wait until it gets fully extended
1493− // a tryCompare doesn't work since
1494− // compare(-0.000005917593600024418, 0);
1495− // is true and in this case we want exactly 0 or will have pain later on
1496− tryCompareFunction( function(){ return drawer.x === 0; }, true );
1497− tryCompare(launcher, "state", "drawer");
1498− tryCompare(launcher, "drawerShown", true);
1499−
1500− return drawer;
1501− }
1502−
1503− function test_directSearch() {
1504− var drawer = dragDrawerIntoView();
1505− verify(!!drawer);
1506−
1507− tryCompare(drawer, "focus", true);
1508−
1509− var searchField = findChild(drawer, "searchField");
1510− verify(searchField);
1511− typeString("cam");
1512− tryCompare(searchField, "displayText", "cam");
1513− }
1514 }
1481 }
1515}
1482}